-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem] 如何使用 settings.gradle.kts 接入? #2137
Comments
可以把这些代码写到一个单独的build-flutter.gradle 文件里,然后引用它试试, apply(from = "build-flutter.gradle") |
这个方式的确可以解决 |
额,出了点小问题,他说
然后这是自动生成的 include_flutter.groovy,我把它粘贴到 build-flutter.gradle 中了 def scriptFile = getClass().protectionDomain.codeSource.location.toURI()
def flutterProjectRoot = new File(scriptFile).parentFile.parentFile
gradle.include ":flutter"
gradle.project(":flutter").projectDir = new File(flutterProjectRoot, ".android/Flutter")
def localPropertiesFile = new File(flutterProjectRoot, ".android/local.properties")
def properties = new Properties()
assert localPropertiesFile.exists(), "❗️The Flutter module doesn't have a `$localPropertiesFile` file." +
"\nYou must run `flutter pub get` in `$flutterProjectRoot`."
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
gradle.apply from: "$flutterSdkPath/packages/flutter_tools/gradle/module_plugin_loader.gradle"
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在文档那里,接入部分
这是 settings.gradle 的代码,但是我用的是 settings.gradle.kts ,我试着
可是我发现 kts 无法 evaluate groovy 文件,这可怎么办呐
The text was updated successfully, but these errors were encountered: