"Fossies" - the Fresh Open Source Software Archive

Member "flutter-1.22.4/packages/flutter_tools/gradle/app_plugin_loader.gradle" (13 Nov 2020, 1156 Bytes) of package /linux/misc/flutter-1.22.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Java source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Copyright 2014 The Flutter Authors. All rights reserved.
    2 // Use of this source code is governed by a BSD-style license that can be
    3 // found in the LICENSE file.
    4 
    5 // This file is included from `<app>/android/settings.gradle`,
    6 // so it can be versioned with the Flutter SDK.
    7 
    8 import groovy.json.JsonSlurper
    9 
   10 def flutterProjectRoot = rootProject.projectDir.parentFile
   11 
   12 // Note: if this logic is changed, also change the logic in module_plugin_loader.gradle.
   13 def pluginsFile = new File(flutterProjectRoot, '.flutter-plugins-dependencies')
   14 if (!pluginsFile.exists()) {
   15   return
   16 }
   17 
   18 def object = new JsonSlurper().parseText(pluginsFile.text)
   19 assert object instanceof Map
   20 assert object.plugins instanceof Map
   21 assert object.plugins.android instanceof List
   22 // Includes the Flutter plugins that support the Android platform.
   23 object.plugins.android.each { androidPlugin ->
   24   assert androidPlugin.name instanceof String
   25   assert androidPlugin.path instanceof String
   26   def pluginDirectory = new File(androidPlugin.path, 'android')
   27   assert pluginDirectory.exists()
   28   include ":${androidPlugin.name}"
   29   project(":${androidPlugin.name}").projectDir = pluginDirectory
   30 }