feat(build): migrate to declarative Gradle plugin DSL and bump Dart SDK constraint to >=3.0.0 <4.0.0

This commit is contained in:
2026-09-14 09:28:36 +02:00
parent 2917f93323
commit b6baaf67e8
4 changed files with 36 additions and 39 deletions
+27 -8
View File
@@ -1,11 +1,30 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
def localPropertiesFile = file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withInputStream { properties.load(it) }
}
def flutterSdkPath = properties.getProperty("flutter.sdk") ?: System.getenv('FLUTTER_ROOT') ?: System.getenv('FLUTTER_HOME')
assert flutterSdkPath != null, "flutter.sdk not set in local.properties or FLUTTER_ROOT environment variable"
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) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
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"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.5.2" apply false
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
id "com.google.gms.google-services" version "4.4.1" apply false
}
include ":app"