From 82b9b02669987e6bcac8557577cc2d7c1ca07dc3 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Thu, 21 Sep 2023 23:09:11 +0100 Subject: [PATCH 1/4] Gradle 8 + AGP upgrade --- android/build.gradle | 22 ++++++++-- android/src/main/AndroidManifest.xml | 2 +- .../workmanager/BackgroundWorker.kt | 2 +- .../workmanager/DebugHelper.kt | 2 +- .../workmanager/Extractor.kt | 42 +++++++++---------- .../workmanager/SharedPreferenceHelper.kt | 2 +- .../workmanager/WorkmanagerCallHandler.kt | 8 ++-- .../workmanager/WorkmanagerPlugin.kt | 4 +- android/src/test/java/ExtractorTests.kt | 2 +- example/android/app/build.gradle | 21 ++++++++-- .../example/EmbeddingV1Activity.kt | 6 --- .../example/EmbeddingV1Application.kt | 18 -------- example/android/build.gradle | 6 +-- example/android/gradle.properties | 5 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/pubspec.yaml | 2 +- pubspec.yaml | 2 +- 17 files changed, 78 insertions(+), 70 deletions(-) rename android/src/main/kotlin/{be/tramckrijte => dev/fluttercommunity}/workmanager/BackgroundWorker.kt (99%) rename android/src/main/kotlin/{be/tramckrijte => dev/fluttercommunity}/workmanager/DebugHelper.kt (98%) rename android/src/main/kotlin/{be/tramckrijte => dev/fluttercommunity}/workmanager/Extractor.kt (85%) rename android/src/main/kotlin/{be/tramckrijte => dev/fluttercommunity}/workmanager/SharedPreferenceHelper.kt (95%) rename android/src/main/kotlin/{be/tramckrijte => dev/fluttercommunity}/workmanager/WorkmanagerCallHandler.kt (97%) rename android/src/main/kotlin/{be/tramckrijte => dev/fluttercommunity}/workmanager/WorkmanagerPlugin.kt (94%) delete mode 100644 example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Activity.kt delete mode 100644 example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Application.kt diff --git a/android/build.gradle b/android/build.gradle index 79a7810a..419c36a4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,4 @@ -group 'be.tramckrijte.workmanager' +group 'dev.fluttercommunity.workmanager' version '1.0-SNAPSHOT' buildscript { @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' + classpath 'com.android.tools.build:gradle:8.0.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -25,18 +25,34 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + // Conditional for compatibility with AGP <4.2. + if (project.android.hasProperty("namespace")) { + namespace 'dev.fluttercommunity.workmanager' + } + compileSdkVersion 33 sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - minSdkVersion 16 + minSdkVersion 19 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions.jvmTarget = "1.8" + } + } + } dependencies { diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 2cd4a0b9..92a5a432 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + diff --git a/android/src/main/kotlin/be/tramckrijte/workmanager/BackgroundWorker.kt b/android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt similarity index 99% rename from android/src/main/kotlin/be/tramckrijte/workmanager/BackgroundWorker.kt rename to android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt index 62791eef..ec8c868b 100644 --- a/android/src/main/kotlin/be/tramckrijte/workmanager/BackgroundWorker.kt +++ b/android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt @@ -1,4 +1,4 @@ -package be.tramckrijte.workmanager +package dev.fluttercommunity.workmanager import android.content.Context import android.os.Handler diff --git a/android/src/main/kotlin/be/tramckrijte/workmanager/DebugHelper.kt b/android/src/main/kotlin/dev/fluttercommunity/workmanager/DebugHelper.kt similarity index 98% rename from android/src/main/kotlin/be/tramckrijte/workmanager/DebugHelper.kt rename to android/src/main/kotlin/dev/fluttercommunity/workmanager/DebugHelper.kt index 33beb295..08a200b1 100644 --- a/android/src/main/kotlin/be/tramckrijte/workmanager/DebugHelper.kt +++ b/android/src/main/kotlin/dev/fluttercommunity/workmanager/DebugHelper.kt @@ -1,4 +1,4 @@ -package be.tramckrijte.workmanager +package dev.fluttercommunity.workmanager import android.app.NotificationChannel import android.app.NotificationManager diff --git a/android/src/main/kotlin/be/tramckrijte/workmanager/Extractor.kt b/android/src/main/kotlin/dev/fluttercommunity/workmanager/Extractor.kt similarity index 85% rename from android/src/main/kotlin/be/tramckrijte/workmanager/Extractor.kt rename to android/src/main/kotlin/dev/fluttercommunity/workmanager/Extractor.kt index 3d12562f..61f3dc90 100644 --- a/android/src/main/kotlin/be/tramckrijte/workmanager/Extractor.kt +++ b/android/src/main/kotlin/dev/fluttercommunity/workmanager/Extractor.kt @@ -1,4 +1,4 @@ -package be.tramckrijte.workmanager +package dev.fluttercommunity.workmanager import android.os.Build import androidx.annotation.VisibleForTesting @@ -10,26 +10,26 @@ import androidx.work.NetworkType import androidx.work.OneTimeWorkRequest import androidx.work.OutOfQuotaPolicy import androidx.work.PeriodicWorkRequest -import be.tramckrijte.workmanager.WorkManagerCall.CancelTask.ByTag.KEYS.UNREGISTER_TASK_TAG_KEY -import be.tramckrijte.workmanager.WorkManagerCall.CancelTask.ByUniqueName.KEYS.UNREGISTER_TASK_UNIQUE_NAME_KEY -import be.tramckrijte.workmanager.WorkManagerCall.Initialize.KEYS.INITIALIZE_TASK_CALL_HANDLE_KEY -import be.tramckrijte.workmanager.WorkManagerCall.Initialize.KEYS.INITIALIZE_TASK_IS_IN_DEBUG_MODE_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_BACK_OFF_POLICY_DELAY_MILLIS_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_BACK_OFF_POLICY_TYPE_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_BATTERY_NOT_LOW_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_CHARGING_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_DEVICE_IDLE_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_NETWORK_TYPE_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_STORAGE_NOT_LOW_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_EXISTING_WORK_POLICY_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_INITIAL_DELAY_SECONDS_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_IS_IN_DEBUG_MODE_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_NAME_VALUE_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_OUT_OF_QUOTA_POLICY_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_PAYLOAD_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_TAG_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_UNIQUE_NAME_KEY -import be.tramckrijte.workmanager.WorkManagerCall.RegisterTask.PeriodicTask.KEYS.PERIODIC_TASK_FREQUENCY_SECONDS_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.CancelTask.ByTag.KEYS.UNREGISTER_TASK_TAG_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.CancelTask.ByUniqueName.KEYS.UNREGISTER_TASK_UNIQUE_NAME_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.Initialize.KEYS.INITIALIZE_TASK_CALL_HANDLE_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.Initialize.KEYS.INITIALIZE_TASK_IS_IN_DEBUG_MODE_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_BACK_OFF_POLICY_DELAY_MILLIS_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_BACK_OFF_POLICY_TYPE_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_BATTERY_NOT_LOW_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_CHARGING_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_DEVICE_IDLE_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_NETWORK_TYPE_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_CONSTRAINTS_STORAGE_NOT_LOW_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_EXISTING_WORK_POLICY_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_INITIAL_DELAY_SECONDS_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_IS_IN_DEBUG_MODE_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_NAME_VALUE_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_OUT_OF_QUOTA_POLICY_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_PAYLOAD_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_TAG_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.KEYS.REGISTER_TASK_UNIQUE_NAME_KEY +import dev.fluttercommunity.workmanager.WorkManagerCall.RegisterTask.PeriodicTask.KEYS.PERIODIC_TASK_FREQUENCY_SECONDS_KEY import io.flutter.plugin.common.MethodCall import kotlin.math.max diff --git a/android/src/main/kotlin/be/tramckrijte/workmanager/SharedPreferenceHelper.kt b/android/src/main/kotlin/dev/fluttercommunity/workmanager/SharedPreferenceHelper.kt similarity index 95% rename from android/src/main/kotlin/be/tramckrijte/workmanager/SharedPreferenceHelper.kt rename to android/src/main/kotlin/dev/fluttercommunity/workmanager/SharedPreferenceHelper.kt index 11b46d37..0f13a08d 100644 --- a/android/src/main/kotlin/be/tramckrijte/workmanager/SharedPreferenceHelper.kt +++ b/android/src/main/kotlin/dev/fluttercommunity/workmanager/SharedPreferenceHelper.kt @@ -1,4 +1,4 @@ -package be.tramckrijte.workmanager +package dev.fluttercommunity.workmanager import android.content.Context diff --git a/android/src/main/kotlin/be/tramckrijte/workmanager/WorkmanagerCallHandler.kt b/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerCallHandler.kt similarity index 97% rename from android/src/main/kotlin/be/tramckrijte/workmanager/WorkmanagerCallHandler.kt rename to android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerCallHandler.kt index 36645ed7..d2f016c6 100644 --- a/android/src/main/kotlin/be/tramckrijte/workmanager/WorkmanagerCallHandler.kt +++ b/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerCallHandler.kt @@ -1,4 +1,4 @@ -package be.tramckrijte.workmanager +package dev.fluttercommunity.workmanager import android.content.Context import androidx.work.Constraints @@ -9,9 +9,9 @@ import androidx.work.OneTimeWorkRequest import androidx.work.OutOfQuotaPolicy import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager -import be.tramckrijte.workmanager.BackgroundWorker.Companion.DART_TASK_KEY -import be.tramckrijte.workmanager.BackgroundWorker.Companion.IS_IN_DEBUG_MODE_KEY -import be.tramckrijte.workmanager.BackgroundWorker.Companion.PAYLOAD_KEY +import dev.fluttercommunity.workmanager.BackgroundWorker.Companion.DART_TASK_KEY +import dev.fluttercommunity.workmanager.BackgroundWorker.Companion.IS_IN_DEBUG_MODE_KEY +import dev.fluttercommunity.workmanager.BackgroundWorker.Companion.PAYLOAD_KEY import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import java.util.concurrent.TimeUnit diff --git a/android/src/main/kotlin/be/tramckrijte/workmanager/WorkmanagerPlugin.kt b/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt similarity index 94% rename from android/src/main/kotlin/be/tramckrijte/workmanager/WorkmanagerPlugin.kt rename to android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt index 0e581e93..eacaf04c 100644 --- a/android/src/main/kotlin/be/tramckrijte/workmanager/WorkmanagerPlugin.kt +++ b/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt @@ -1,4 +1,4 @@ -package be.tramckrijte.workmanager +package dev.fluttercommunity.workmanager import android.content.Context import io.flutter.embedding.engine.plugins.FlutterPlugin @@ -47,7 +47,7 @@ class WorkmanagerPlugin : FlutterPlugin { @Deprecated(message = "Use the Android v2 embedding method.") @JvmStatic fun setPluginRegistrantCallback(pluginRegistryCallback: PluginRegistry.PluginRegistrantCallback) { - WorkmanagerPlugin.pluginRegistryCallback = pluginRegistryCallback + Companion.pluginRegistryCallback = pluginRegistryCallback } } } diff --git a/android/src/test/java/ExtractorTests.kt b/android/src/test/java/ExtractorTests.kt index d44183f8..77dddeb9 100644 --- a/android/src/test/java/ExtractorTests.kt +++ b/android/src/test/java/ExtractorTests.kt @@ -1,6 +1,6 @@ import androidx.work.NetworkType import androidx.work.OutOfQuotaPolicy -import be.tramckrijte.workmanager.Extractor +import dev.fluttercommunity.workmanager.Extractor import io.flutter.plugin.common.MethodCall import org.junit.Assert.assertEquals import org.junit.Test diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index d6832459..bf3f20e7 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -32,10 +32,14 @@ android { main.java.srcDirs += 'src/main/kotlin' } + // Conditional for compatibility with AGP <4.2. + if (project.android.hasProperty("namespace")) { + namespace 'dev.fluttercommunity.workmanager.example' + } defaultConfig { applicationId "dev.fluttercommunity.workmanager.example" - minSdkVersion 16 + minSdkVersion 19 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -50,7 +54,16 @@ android { } } - namespace 'dev.fluttercommunity.workmanager.example' + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions.jvmTarget = "1.8" + } + } lint { disable 'InvalidPackage' @@ -64,6 +77,6 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'androidx.test:runner:1.5.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Activity.kt b/example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Activity.kt deleted file mode 100644 index 27c797c4..00000000 --- a/example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Activity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package dev.fluttercommunity.workmanager.example - -import io.flutter.app.FlutterActivity - -@Deprecated(message = "Not used, but here to show you how you can use the plugin using the old v1 embedding method.") -class EmbeddingV1Activity : FlutterActivity() diff --git a/example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Application.kt b/example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Application.kt deleted file mode 100644 index b2b4558a..00000000 --- a/example/android/app/src/main/kotlin/dev/fluttercommunity/workmanager/example/EmbeddingV1Application.kt +++ /dev/null @@ -1,18 +0,0 @@ -package dev.fluttercommunity.workmanager.example - -import be.tramckrijte.workmanager.WorkmanagerPlugin -import io.flutter.app.FlutterApplication -import io.flutter.plugin.common.PluginRegistry - -@Deprecated(message = "Not used, but here to show you how you can use the plugin using the old v1 embedding method.") -class EmbeddingV1Application : FlutterApplication(), PluginRegistry.PluginRegistrantCallback { - override fun registerWith(registry: PluginRegistry) { - // The line below this would be uncommented - // GeneratedPluginRegistrant.registerWith(registry) - } - - override fun onCreate() { - super.onCreate() - WorkmanagerPlugin.setPluginRegistrantCallback(this) - } -} diff --git a/example/android/build.gradle b/example/android/build.gradle index f6b10342..ce62641e 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.1.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -30,6 +30,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 2d223a0f..571b8974 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,4 +1,7 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true -android.enableJetifier=false \ No newline at end of file +android.enableJetifier=false +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false \ No newline at end of file diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 757f139a..064431d8 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/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-7.5-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip \ No newline at end of file diff --git a/example/pubspec.yaml b/example/pubspec.yaml index a04ecbb1..4741dbbe 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -7,7 +7,7 @@ environment: dependencies: path_provider: ^2.0.11 - shared_preferences: ^2.0.15 + shared_preferences: ^2.2.1 flutter: sdk: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 12bd672f..a52a507a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,7 +26,7 @@ flutter: plugin: platforms: android: - package: be.tramckrijte.workmanager + package: dev.fluttercommunity.workmanager pluginClass: WorkmanagerPlugin ios: pluginClass: WorkmanagerPlugin From 7c8c16af2ef754e03d31dee9a6613bcfb18fb68a Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Thu, 21 Sep 2023 23:16:05 +0100 Subject: [PATCH 2/4] compileSdk --- android/build.gradle | 5 ++--- example/android/app/build.gradle | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 419c36a4..56af979f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,7 +2,7 @@ group 'dev.fluttercommunity.workmanager' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() @@ -30,12 +30,11 @@ android { namespace 'dev.fluttercommunity.workmanager' } - compileSdkVersion 33 - sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { + compileSdk 33 minSdkVersion 19 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index bf3f20e7..38835d18 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,8 +26,6 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 33 - sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -39,6 +37,7 @@ android { defaultConfig { applicationId "dev.fluttercommunity.workmanager.example" + compileSdk 33 minSdkVersion 19 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() From 81365ee50c690c66a89291a64c89b176a9842be5 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Thu, 21 Sep 2023 23:17:03 +0100 Subject: [PATCH 3/4] java17 in workflows --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 56e40567..37282312 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - uses: subosito/flutter-action@v2 with: channel: "stable" From c77013b0938a074d2d21557642bbd2d3ae133dd6 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Fri, 22 Sep 2023 06:25:24 +0100 Subject: [PATCH 4/4] few gh action updates --- .github/workflows/analysis.yml | 2 +- .github/workflows/examples.yml | 4 ++-- .github/workflows/format.yml | 8 ++++---- .github/workflows/test.yml | 14 +++++++------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 0f3e1794..3f6ac186 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -5,7 +5,7 @@ jobs: package-analysis: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: axel-op/dart-package-analyzer@v3 with: # Required: diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 37282312..d40d2266 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -10,7 +10,7 @@ jobs: example_android: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v1 with: java-version: 17 @@ -25,7 +25,7 @@ jobs: example_ios: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: "stable" diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index b33442b2..d03b8e21 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -10,7 +10,7 @@ jobs: format_dart: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -23,7 +23,7 @@ jobs: steps: - name: "checkout" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "ktlint" uses: "vroy/gha-kotlin-linter@v1" @@ -31,14 +31,14 @@ jobs: format_swift: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: GitHub Action for SwiftLint uses: norio-nomura/action-swiftlint@3.2.1 publishable: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: 'stable' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5106bb60..d3943c45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -22,7 +22,7 @@ jobs: native_ios_tests: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -34,10 +34,10 @@ jobs: native_android_tests: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - uses: subosito/flutter-action@v1 with: channel: 'stable' @@ -57,7 +57,7 @@ jobs: - uses: futureware-tech/simulator-action@v1 with: model: '${{ matrix.device }}' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -76,10 +76,10 @@ jobs: # api-level: [21, 29] target: [default] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - uses: subosito/flutter-action@v2 with: channel: 'stable'