From 0a970da4856c09bd56e28973f8d1b6e0ca71d376 Mon Sep 17 00:00:00 2001 From: jesswrd Date: Fri, 27 Jun 2025 13:27:49 -0400 Subject: [PATCH] gradle to DSL and upgraded to 36 --- .../android/app/build.gradle | 29 ++++++++++-------- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 3 +- android_splash_screen/android/build.gradle | 19 +++--------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android_splash_screen/android/settings.gradle | 30 ++++++++++++++----- 6 files changed, 46 insertions(+), 40 deletions(-) diff --git a/android_splash_screen/android/app/build.gradle b/android_splash_screen/android/app/build.gradle index 8c01625b409..bee480de751 100644 --- a/android_splash_screen/android/app/build.gradle +++ b/android_splash_screen/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,12 +22,9 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 31 + namespace 'com.example.splash_screen_sample' + compileSdkVersion 36 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -36,11 +34,19 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.splash_screen_sample" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 36 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + buildTypes { release { // TODO: Add your own signing config for the release build. @@ -55,7 +61,6 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "androidx.core:core-splashscreen:1.0.0-alpha02" implementation "androidx.core:core:1.5.0-alpha05" implementation "androidx.core:core-ktx:1.6.0" diff --git a/android_splash_screen/android/app/src/debug/AndroidManifest.xml b/android_splash_screen/android/app/src/debug/AndroidManifest.xml index 0dea87e8bea..f880684a6a9 100644 --- a/android_splash_screen/android/app/src/debug/AndroidManifest.xml +++ b/android_splash_screen/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android_splash_screen/android/app/src/main/AndroidManifest.xml b/android_splash_screen/android/app/src/main/AndroidManifest.xml index ad41ca2a471..14719f09668 100644 --- a/android_splash_screen/android/app/src/main/AndroidManifest.xml +++ b/android_splash_screen/android/app/src/main/AndroidManifest.xml @@ -14,8 +14,7 @@ ~ limitations under the License. --> - + diff --git a/android_splash_screen/android/build.gradle b/android_splash_screen/android/build.gradle index c45f25cc9d6..8f31e8cafb4 100644 --- a/android_splash_screen/android/build.gradle +++ b/android_splash_screen/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.5.31' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() @@ -21,9 +8,11 @@ allprojects { rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/android_splash_screen/android/gradle/wrapper/gradle-wrapper.properties b/android_splash_screen/android/gradle/wrapper/gradle-wrapper.properties index bc6a58afdda..9162f1008ac 100644 --- a/android_splash_screen/android/gradle/wrapper/gradle-wrapper.properties +++ b/android_splash_screen/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip diff --git a/android_splash_screen/android/settings.gradle b/android_splash_screen/android/settings.gradle index 44e62bcf06a..4544fb01510 100644 --- a/android_splash_screen/android/settings.gradle +++ b/android_splash_screen/android/settings.gradle @@ -1,11 +1,25 @@ -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 localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$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" // apply true + id "com.android.application" version "8.9.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" \ No newline at end of file