Remove license statements in template files. (#57268)
This commit is contained in:
parent
e02265dd68
commit
6202476691
@ -45,3 +45,15 @@ 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"
|
||||
;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) {
|
||||
timeout: timeoutConfiguration.fastOperation);
|
||||
|
||||
final String flutterRoot = globals.fs.path.absolute(Cache.flutterRoot);
|
||||
final File deprecatedFile = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools',
|
||||
'gradle', 'deprecated_settings.gradle'));
|
||||
assert(deprecatedFile.existsSync());
|
||||
final File legacySettingsDotGradleFiles = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools',
|
||||
'gradle', 'settings.gradle.legacy_versions'));
|
||||
assert(legacySettingsDotGradleFiles.existsSync());
|
||||
final String settingsAarContent = globals.fs.file(globals.fs.path.join(flutterRoot, 'packages','flutter_tools',
|
||||
'gradle', 'settings_aar.gradle.tmpl')).readAsStringSync();
|
||||
|
||||
// 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);
|
||||
|
||||
bool exactMatch = false;
|
||||
|
@ -1,7 +1,3 @@
|
||||
// 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'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
|
@ -1,7 +1,3 @@
|
||||
// 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 flutterProjectRoot = new File(scriptFile).parentFile.parentFile
|
||||
|
||||
|
@ -1,7 +1,3 @@
|
||||
// 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 flutterProjectRoot = new File(scriptFile).parentFile.parentFile
|
||||
|
||||
|
@ -391,7 +391,7 @@ include ':app'
|
||||
'flutter_tools',
|
||||
'gradle');
|
||||
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);
|
||||
|
||||
globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings_aar.gradle.tmpl'))
|
||||
@ -424,7 +424,7 @@ include ':app'
|
||||
'flutter_tools',
|
||||
'gradle');
|
||||
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);
|
||||
|
||||
globals.fs.file(globals.fs.path.join(toolGradlePath, 'settings_aar.gradle.tmpl'))
|
||||
@ -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].
|
||||
|
Loading…
x
Reference in New Issue
Block a user