mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Collect list of Android plugins from .flutter-plugins-dependencies (#57907)
This commit is contained in:
parent
10ae8698b4
commit
253eb1cfbd
@ -372,17 +372,28 @@ class FlutterPlugin implements Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Properties getPluginList() {
|
private Properties getPluginList() {
|
||||||
File pluginsFile = new File(project.projectDir.parentFile.parentFile, '.flutter-plugins')
|
|
||||||
Properties allPlugins = readPropertiesIfExist(pluginsFile)
|
|
||||||
Properties androidPlugins = new Properties()
|
Properties androidPlugins = new Properties()
|
||||||
allPlugins.each { name, path ->
|
|
||||||
if (doesSupportAndroidPlatform(path)) {
|
def flutterProjectRoot = project.projectDir.parentFile.parentFile
|
||||||
androidPlugins.setProperty(name, path)
|
def pluginsFile = new File(flutterProjectRoot, '.flutter-plugins-dependencies')
|
||||||
|
if (!pluginsFile.exists()) {
|
||||||
|
return androidPlugins
|
||||||
}
|
}
|
||||||
// TODO(amirh): log an error if this plugin was specified to be an Android
|
|
||||||
// plugin according to the new schema, and was missing a build.gradle file.
|
def object = new JsonSlurper().parseText(pluginsFile.text)
|
||||||
// https://github.com/flutter/flutter/issues/40784
|
assert object instanceof Map
|
||||||
|
assert object.plugins instanceof Map
|
||||||
|
assert object.plugins.android instanceof List
|
||||||
|
// Includes the Flutter plugins that support the Android platform.
|
||||||
|
object.plugins.android.each { androidPlugin ->
|
||||||
|
assert androidPlugin.name instanceof String
|
||||||
|
assert androidPlugin.path instanceof String
|
||||||
|
def pluginDirectory = new File(androidPlugin.path, 'android')
|
||||||
|
assert pluginDirectory.exists()
|
||||||
|
androidPlugins.setProperty(androidPlugin.name, androidPlugin.path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return androidPlugins
|
return androidPlugins
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user