-
-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(share_plus): Migrate Android example to use the new plugins …
…declaration (#2742)
- Loading branch information
Showing
4 changed files
with
24 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,3 @@ plugins { | |
} | ||
|
||
include ":app" | ||
|
||
rootProject.name = 'package_info_plus' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
packages/share_plus/share_plus/example/android/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 19 additions & 10 deletions
29
packages/share_plus/share_plus/example/android/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
include ':app' | ||
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 | ||
}() | ||
|
||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() | ||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") | ||
|
||
def plugins = new Properties() | ||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') | ||
if (pluginsFile.exists()) { | ||
pluginsFile.withInputStream { stream -> plugins.load(stream) } | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
plugins.each { name, path -> | ||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() | ||
include ":$name" | ||
project(":$name").projectDir = pluginDirectory | ||
plugins { | ||
id "dev.flutter.flutter-plugin-loader" version "1.0.0" | ||
id "com.android.application" version "8.3.0" apply false | ||
} | ||
|
||
include ":app" |