@@ -372,17 +372,28 @@ class FlutterPlugin implements Plugin<Project> {
372
372
}
373
373
374
374
private Properties getPluginList () {
375
- File pluginsFile = new File (project. projectDir. parentFile. parentFile, ' .flutter-plugins' )
376
- Properties allPlugins = readPropertiesIfExist(pluginsFile)
375
+
377
376
Properties androidPlugins = new Properties ()
378
- allPlugins. each { name , path ->
379
- if (doesSupportAndroidPlatform(path)) {
380
- androidPlugins. setProperty(name, path)
381
- }
382
- // TODO(amirh): log an error if this plugin was specified to be an Android
383
- // plugin according to the new schema, and was missing a build.gradle file.
384
- // https://github.com/flutter/flutter/issues/40784
377
+
378
+ def flutterProjectRoot = project. projectDir. parentFile. parentFile
379
+ def pluginsFile = new File (flutterProjectRoot, ' .flutter-plugins-dependencies' )
380
+ if (! pluginsFile. exists()) {
381
+ return androidPlugins
385
382
}
383
+
384
+ def object = new JsonSlurper (). parseText(pluginsFile. text)
385
+ assert object instanceof Map
386
+ assert object. plugins instanceof Map
387
+ assert object. plugins. android instanceof List
388
+ // Includes the Flutter plugins that support the Android platform.
389
+ object. plugins. android. each { androidPlugin ->
390
+ assert androidPlugin. name instanceof String
391
+ assert androidPlugin. path instanceof String
392
+ def pluginDirectory = new File (androidPlugin. path, ' android' )
393
+ assert pluginDirectory. exists()
394
+ androidPlugins. setProperty(androidPlugin. name, androidPlugin. path)
395
+ }
396
+
386
397
return androidPlugins
387
398
}
388
399
0 commit comments