Don't import plugins that don't support android in settings.gradle (#54407)
This commit is contained in:
@@ -1,35 +1,20 @@
|
||||
// Generated file. Do not edit.
|
||||
// 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
|
||||
|
||||
gradle.include ':flutter'
|
||||
gradle.project(':flutter').projectDir = new File(flutterProjectRoot, '.android/Flutter')
|
||||
gradle.include ":flutter"
|
||||
gradle.project(":flutter").projectDir = new File(flutterProjectRoot, ".android/Flutter")
|
||||
|
||||
def plugins = new Properties()
|
||||
def pluginsFile = new File(flutterProjectRoot, '.flutter-plugins')
|
||||
if (pluginsFile.exists()) {
|
||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
||||
}
|
||||
def localPropertiesFile = new File(flutterProjectRoot, ".android/local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
plugins.each { name, path ->
|
||||
def pluginDirectory = flutterProjectRoot.toPath().resolve(path).resolve('android').toFile()
|
||||
gradle.include ":$name"
|
||||
gradle.project(":$name").projectDir = pluginDirectory
|
||||
}
|
||||
assert localPropertiesFile.exists(), "❗️The Flutter module doesn't have a `$localPropertiesFile` file." +
|
||||
"\nYou must run `flutter pub get` in `$flutterProjectRoot`."
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
gradle.getGradle().projectsLoaded { g ->
|
||||
g.rootProject.beforeEvaluate { p ->
|
||||
_mainModuleName = binding.variables['mainModuleName']
|
||||
if (_mainModuleName != null && !_mainModuleName.empty) {
|
||||
p.ext.mainModuleName = _mainModuleName
|
||||
}
|
||||
}
|
||||
g.rootProject.afterEvaluate { p ->
|
||||
p.subprojects { sp ->
|
||||
if (sp.name != 'flutter') {
|
||||
sp.evaluationDependsOn(':flutter')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
gradle.apply from: "$flutterSdkPath/packages/flutter_tools/gradle/module_plugin_loader.gradle"
|
||||
|
||||
@@ -1,35 +1,20 @@
|
||||
// Generated file. Do not edit.
|
||||
// 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
|
||||
|
||||
gradle.include ':flutter'
|
||||
gradle.project(':flutter').projectDir = new File(flutterProjectRoot, '.android/Flutter')
|
||||
gradle.include ":flutter"
|
||||
gradle.project(":flutter").projectDir = new File(flutterProjectRoot, ".android/Flutter")
|
||||
|
||||
def plugins = new Properties()
|
||||
def pluginsFile = new File(flutterProjectRoot, '.flutter-plugins')
|
||||
if (pluginsFile.exists()) {
|
||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
||||
}
|
||||
def localPropertiesFile = new File(flutterProjectRoot, ".android/local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
plugins.each { name, path ->
|
||||
def pluginDirectory = flutterProjectRoot.toPath().resolve(path).resolve('android').toFile()
|
||||
gradle.include ":$name"
|
||||
gradle.project(":$name").projectDir = pluginDirectory
|
||||
}
|
||||
assert localPropertiesFile.exists(), "❗️The Flutter module doesn't have a `$localPropertiesFile` file." +
|
||||
"\nYou must run `flutter pub get` in `$flutterProjectRoot`."
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
gradle.getGradle().projectsLoaded { g ->
|
||||
g.rootProject.beforeEvaluate { p ->
|
||||
_mainModuleName = binding.variables['mainModuleName']
|
||||
if (_mainModuleName != null && !_mainModuleName.empty) {
|
||||
p.ext.mainModuleName = _mainModuleName
|
||||
}
|
||||
}
|
||||
g.rootProject.afterEvaluate { p ->
|
||||
p.subprojects { sp ->
|
||||
if (sp.name != 'flutter') {
|
||||
sp.evaluationDependsOn(':flutter')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
gradle.apply from: "$flutterSdkPath/packages/flutter_tools/gradle/module_plugin_loader.gradle"
|
||||
|
||||
Reference in New Issue
Block a user