Fix Gradle lockfiles. (#137190)
This commit is contained in:
committed by
GitHub
parent
ad448db6b5
commit
ccbe221b3d
@@ -4,6 +4,7 @@
|
||||
|
||||
// This script generates `android/build.gradle` for each directory specify in the stdin.
|
||||
// Then it generate the lockfiles for each Gradle project.
|
||||
// Prerequisite: make sure `flutter doctor -v` outputs the same version of java as `java --version`.
|
||||
// To regenerate these files, run `find . -type d -name 'android' | dart dev/tools/bin/generate_gradle_lockfiles.dart`
|
||||
|
||||
import 'dart:io';
|
||||
@@ -193,15 +194,24 @@ const String settingGradleFile = r'''
|
||||
// To update all the settings.gradle files in the Flutter repo,
|
||||
// See dev/tools/bin/generate_gradle_lockfiles.dart.
|
||||
|
||||
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
|
||||
}
|
||||
settings.ext.flutterSdkPath = flutterSdkPath()
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
plugins {
|
||||
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
|
||||
}
|
||||
}
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
include ":app"
|
||||
|
||||
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
''';
|
||||
|
||||
Reference in New Issue
Block a user