Unverified Commit 62024766 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Remove license statements in template files. (#57268)

parent e02265dd
...@@ -45,3 +45,15 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } ...@@ -45,3 +45,15 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk") def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
;EOF
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
...@@ -171,14 +171,14 @@ void createSettingsAarGradle(Directory androidDirectory) { ...@@ -171,14 +171,14 @@ void createSettingsAarGradle(Directory androidDirectory) {
timeout: timeoutConfiguration.fastOperation); timeout: timeoutConfiguration.fastOperation);
final String flutterRoot = globals.fs.path.absolute(Cache.flutterRoot); final String flutterRoot = globals.fs.path.absolute(Cache.flutterRoot);
final File deprecatedFile = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools', final File legacySettingsDotGradleFiles = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools',
'gradle', 'deprecated_settings.gradle')); 'gradle', 'settings.gradle.legacy_versions'));
assert(deprecatedFile.existsSync()); assert(legacySettingsDotGradleFiles.existsSync());
final String settingsAarContent = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools', final String settingsAarContent = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools',
'gradle', 'settings_aar.gradle.tmpl')).readAsStringSync(); 'gradle', 'settings_aar.gradle.tmpl')).readAsStringSync();
// Get the `settings.gradle` content variants that should be patched. // Get the `settings.gradle` content variants that should be patched.
final List<String> existingVariants = deprecatedFile.readAsStringSync().split(';EOF'); final List<String> existingVariants = legacySettingsDotGradleFiles.readAsStringSync().split(';EOF');
existingVariants.add(settingsAarContent); existingVariants.add(settingsAarContent);
bool exactMatch = false; bool exactMatch = false;
......
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
include ':app' include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties") def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
......
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
def scriptFile = getClass().protectionDomain.codeSource.location.toURI() def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
def flutterProjectRoot = new File(scriptFile).parentFile.parentFile def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
......
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
def scriptFile = getClass().protectionDomain.codeSource.location.toURI() def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
def flutterProjectRoot = new File(scriptFile).parentFile.parentFile def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
......
...@@ -391,7 +391,7 @@ include ':app' ...@@ -391,7 +391,7 @@ include ':app'
'flutter_tools', 'flutter_tools',
'gradle'); 'gradle');
globals.fs.directory(toolGradlePath).createSync(recursive: true); globals.fs.directory(toolGradlePath).createSync(recursive: true);
globals.fs.file(globals.fs.path.join(toolGradlePath, 'deprecated_settings.gradle')) globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings.gradle.legacy_versions'))
.writeAsStringSync(currentSettingsGradle); .writeAsStringSync(currentSettingsGradle);
globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings_aar.gradle.tmpl')) globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings_aar.gradle.tmpl'))
...@@ -424,7 +424,7 @@ include ':app' ...@@ -424,7 +424,7 @@ include ':app'
'flutter_tools', 'flutter_tools',
'gradle'); 'gradle');
globals.fs.directory(toolGradlePath).createSync(recursive: true); globals.fs.directory(toolGradlePath).createSync(recursive: true);
globals.fs.file(globals.fs.path.join(toolGradlePath, 'deprecated_settings.gradle')) globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings.gradle.legacy_versions'))
.writeAsStringSync(currentSettingsGradle); .writeAsStringSync(currentSettingsGradle);
globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings_aar.gradle.tmpl')) globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings_aar.gradle.tmpl'))
...@@ -2484,6 +2484,18 @@ plugin1=${plugin1.path} ...@@ -2484,6 +2484,18 @@ plugin1=${plugin1.path}
); );
}); });
}); });
test('Current settings.gradle is in our legacy settings.gradle file set', () {
// If this test fails, you probably edited templates/app/android.tmpl.
// That's fine, but you now need to add a copy of that file to gradle/settings.gradle.legacy_versions, separated
// from the previous versions by a line that just says ";EOF".
final File templateSettingsDotGradle = globals.fs.file(globals.fs.path.join(Cache.flutterRoot, 'packages', 'flutter_tools', 'templates', 'app', 'android.tmpl', 'settings.gradle'));
final File legacySettingsDotGradleFiles = globals.fs.file(globals.fs.path.join(Cache.flutterRoot, 'packages','flutter_tools', 'gradle', 'settings.gradle.legacy_versions'));
expect(
legacySettingsDotGradleFiles.readAsStringSync().split(';EOF').map<String>((String body) => body.trim()),
contains(templateSettingsDotGradle.readAsStringSync().trim()),
);
});
} }
/// Generates a fake app bundle at the location [directoryName]/[fileName]. /// Generates a fake app bundle at the location [directoryName]/[fileName].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment