Revert automated changes made to deprecated settings.gradle (plugins.each) (#140037)

Restore testing deprecated settings.gradle (plugins.each).

Updated presumably by accident in #83067

Split from #137115
See also https://github.com/flutter/flutter/pull/137115#issuecomment-1781909865
This commit is contained in:
Gustl22
2023-12-20 16:45:08 +01:00
committed by GitHub
parent 62d699961f
commit da0cd69659
3 changed files with 54 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
# Deprecated settings.gradle
This project is meant to test that apps using the current `android/settings.gradle`
can still be built. This project can be removed once apps have been migrated to
this new file.
This project is meant to test that apps using the deprecated
`android/settings.gradle` (_PluginEach_ used until Flutter v1.22.0) can still be built.
This project can be removed once apps have been migrated to this new file.
Issue: https://github.com/flutter/flutter/issues/54566

View File

@@ -2,27 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is auto generated.
// To update all the settings.gradle files in the Flutter repo,
// See dev/tools/bin/generate_gradle_lockfiles.dart.
// This is the `settings.gradle` file that apps were created with until Flutter
// v1.22.0. This file has changed, so it must be migrated in existing projects.
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
include ':app'
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
plugins {
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
}
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
include ":app"
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}