From 4dd0ae70d62d1dcb2c81a9a47ee51379b22f41d8 Mon Sep 17 00:00:00 2001 From: LucaR7 <42545336+Kaizen-7@users.noreply.github.com> Date: Fri, 31 Dec 2021 17:39:08 +0100 Subject: [PATCH 1/4] chore: update dependencies --- app/build.gradle | 12 ++++----- buildSrc/src/main/java/AppConfig.kt | 4 +-- buildSrc/src/main/java/Dependencies.kt | 36 +++++++++++++++++--------- buildSrc/src/main/java/Versions.kt | 27 +++++++++++-------- 4 files changed, 47 insertions(+), 32 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 41238611..8363e318 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -100,7 +100,7 @@ android { buildTypes { debug { minifyEnabled false - debuggable false + debuggable true } release { @@ -156,13 +156,11 @@ dependencies { implementation Deps.androidx_room_runtime implementation Deps.androidx_worker_ktx implementation Deps.kotlinx_coroutines + implementation Deps.zxing implementation Deps.guava_conflict_resolver implementation Deps.hilt - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' kapt Deps.hilt_compiler implementation Deps.hilt_viewmodel implementation Deps.hilt_work @@ -174,7 +172,7 @@ dependencies { implementation Deps.gson_converter testImplementation Deps.test_junit - testImplementation "io.mockk:mockk:1.11.0" - testImplementation 'androidx.arch.core:core-testing:2.1.0' - testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0' + testImplementation Deps.test_mockk + testImplementation Deps.androidx_core_testing + testImplementation Deps.test_coroutines } diff --git a/buildSrc/src/main/java/AppConfig.kt b/buildSrc/src/main/java/AppConfig.kt index ae2ebada..1a071083 100644 --- a/buildSrc/src/main/java/AppConfig.kt +++ b/buildSrc/src/main/java/AppConfig.kt @@ -24,8 +24,8 @@ import org.gradle.api.JavaVersion object Config { const val minSdk = 24 - const val compileSdk = 30 - const val targetSdk = 30 + const val compileSdk = 31 + const val targetSdk = 31 val javaVersion = JavaVersion.VERSION_1_8 const val versionCode = 13 diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index c0c7e364..fda2c60c 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -22,13 +22,30 @@ object Deps { + //Decoder Deps + const val bouncy_castle = "org.bouncycastle:bcpkix-jdk15to18:${Versions.bouncy_castle}" + const val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}" + const val kotlin_reflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin_reflect}" + const val java_cose = "com.augustcellars.cose:cose-java:${Versions.java_cose}" + const val json_validation = "com.github.java-json-tools:json-schema-validator:${Versions.json_validation}" + const val json_validation_rhino = "io.apisense:rhino-android:${Versions.json_validation_rhino}" + const val jackson_cbor = "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${Versions.jackson_cbor}" + const val test_junit_jupiter_api = "org.junit.jupiter:junit-jupiter-api:${Versions.junit_jupiter}" + const val test_junit_jupiter_params = "org.junit.jupiter:junit-jupiter-params:${Versions.junit_jupiter}" + const val test_runtime_only = "org.junit.jupiter:junit-jupiter-engine:${Versions.junit_jupiter}" + const val test_hamcrest = "org.hamcrest:hamcrest:${Versions.hamcrest}" + + //Others const val tools_gradle_android = "com.android.tools.build:gradle:${Versions.gradle}" const val tools_kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" const val desugar_jdk_libs = "com.android.tools:desugar_jdk_libs:${Versions.desugar_jdk_libs}" + const val test_junit = "junit:junit:${Versions.junit}" + const val test_mockk = "io.mockk:mockk:${Versions.mockk}" + - const val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}" const val kotlinx_coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlinx_coroutines}" const val androidx_core = "androidx.core:core-ktx:${Versions.androidx_core}" + const val androidx_startup = "androidx.startup:startup-runtime:${Versions.androidx_startup}" const val androidx_appcompat = "androidx.appcompat:appcompat:${Versions.androidx_appcompat}" const val androidx_material = "com.google.android.material:material:${Versions.androidx_material}" const val androidx_constraint = "androidx.constraintlayout:constraintlayout:${Versions.androidx_constraint}" @@ -38,11 +55,17 @@ object Deps { const val androidx_hilt_compiler = "androidx.hilt:hilt-compiler:${Versions.androidx_hilt_compiler}" const val androidx_room_runtime = "androidx.room:room-runtime:${Versions.androidx_room}" const val androidx_room_compiler = "androidx.room:room-compiler:${Versions.androidx_room}" + const val androidx_core_testing = "androidx.arch.core:core-testing:${Versions.androidx_core_testing}" + const val test_coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.test_coroutines}" const val androidx_worker_ktx = "androidx.work:work-runtime-ktx:${Versions.androidx_worker_ktx}" const val retrofit2 = "com.squareup.retrofit2:retrofit:${Versions.retrofit}" + + const val okhttp = "com.squareup.okhttp3:okhttp:${Versions.okhttp}" const val log_interceptor = "com.squareup.okhttp3:logging-interceptor:${Versions.logging_interceptor}" const val gson_converter = "com.squareup.retrofit2:converter-gson:${Versions.gson_converter}" + const val dokka_plugin = "org.jetbrains.dokka:kotlin-as-java-plugin:${Versions.dokka}" + const val hilt_plugin = "com.google.dagger:hilt-android-gradle-plugin:${Versions.hilt_version}" const val hilt = "com.google.dagger:hilt-android:${Versions.hilt_version}" const val hilt_compiler = "com.google.dagger:hilt-android-compiler:${Versions.hilt_version}" @@ -51,16 +74,5 @@ object Deps { const val zxing = "com.journeyapps:zxing-android-embedded:${Versions.zxing}" const val guava_conflict_resolver = "com.google.guava:listenablefuture:${Versions.guave_conflict_resolver_version}" - const val kotlin_reflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin_reflect}" - const val java_cose = "com.augustcellars.cose:cose-java:${Versions.java_cose}" - const val json_validation = "com.github.java-json-tools:json-schema-validator:${Versions.json_validation}" - const val json_validation_rhino = "io.apisense:rhino-android:${Versions.json_validation_rhino}" - const val jackson_cbor = "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${Versions.jackson_cbor}" - const val bouncy_castle = "org.bouncycastle:bcpkix-jdk15to18:${Versions.bouncy_castle}" - const val test_junit = "junit:junit:${Versions.junit}" - const val test_junit_jupiter_api = "org.junit.jupiter:junit-jupiter-api:${Versions.junit_jupiter}" - const val test_junit_jupiter_params = "org.junit.jupiter:junit-jupiter-params:${Versions.junit_jupiter}" - const val test_runtime_only = "org.junit.jupiter:junit-jupiter-engine:${Versions.junit_jupiter}" - const val test_hamcrest = "org.hamcrest:hamcrest:${Versions.hamcrest}" } \ No newline at end of file diff --git a/buildSrc/src/main/java/Versions.kt b/buildSrc/src/main/java/Versions.kt index e0e55138..d16d0c5f 100644 --- a/buildSrc/src/main/java/Versions.kt +++ b/buildSrc/src/main/java/Versions.kt @@ -22,27 +22,36 @@ object Versions { + // Base const val gradle = "4.1.3" const val kotlin = "1.4.32" const val desugar_jdk_libs = "1.1.5" + const val mockk = "1.11.0" - const val androidx_core = "1.4.0-alpha01" - const val androidx_appcompat = "1.2.0" + const val androidx_core = "1.7.0" + const val androidx_startup = "1.1.0" + const val androidx_appcompat = "1.4.0" const val androidx_navigation = "2.3.5" const val androidx_material = "1.3.0" - const val androidx_constraint = "2.0.4" + const val androidx_constraint = "2.1.2" + const val logging_interceptor = "4.9.3" + const val okhttp = "4.9.3" const val kotlinx_coroutines = "1.3.9" + const val retrofit = "2.9.0" + const val androidx_room = "2.4.0" + const val androidx_core_testing = "2.1.0" + const val test_coroutines = "1.5.0" + const val gson_converter = "2.9.0" + + const val dokka = "1.5.0" + private const val work_hilt = "1.0.0-beta01" const val androidx_hilt_viewmodel = "1.0.0-alpha02" const val androidx_hilt_work = work_hilt const val androidx_hilt_compiler = work_hilt - const val androidx_room = "2.3.0" const val androidx_worker_ktx = "2.5.0" const val hilt_version = "2.33-beta" - const val retrofit = "2.9.0" - const val logging_interceptor = "4.0.1" - const val gson_converter = "2.6.0" // QR const val zxing = "4.2.0" @@ -53,12 +62,8 @@ object Versions { const val jackson_cbor = "2.12.3" const val java_cose = "1.1.0" const val bouncy_castle = "1.68" - - // Validation const val json_validation = "2.2.14" const val json_validation_rhino = "1.0" - - // Tests const val junit = "4.13.1" const val junit_jupiter = "5.7.1" const val hamcrest = "2.2" From 25e1687b6c1502eb811b83b4c557d6fa2e9eba19 Mon Sep 17 00:00:00 2001 From: LucaR7 <42545336+Kaizen-7@users.noreply.github.com> Date: Tue, 11 Jan 2022 15:29:40 +0100 Subject: [PATCH 2/4] fix: edit mockk dependency --- buildSrc/src/main/java/Dependencies.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index fda2c60c..5a80299b 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -40,7 +40,7 @@ object Deps { const val tools_kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" const val desugar_jdk_libs = "com.android.tools:desugar_jdk_libs:${Versions.desugar_jdk_libs}" const val test_junit = "junit:junit:${Versions.junit}" - const val test_mockk = "io.mockk:mockk:${Versions.mockk}" + const val test_mockk = "io.mockk:mockk-android:${Versions.mockk}" const val kotlinx_coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlinx_coroutines}" From d0c3a63affa09c38413c713ea9449d16dc235914 Mon Sep 17 00:00:00 2001 From: LucaR7 <42545336+Kaizen-7@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:28:24 +0100 Subject: [PATCH 3/4] fix: removed unused dependency --- app/build.gradle | 3 +-- buildSrc/src/main/java/Dependencies.kt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8363e318..e94d280d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -172,7 +172,6 @@ dependencies { implementation Deps.gson_converter testImplementation Deps.test_junit - testImplementation Deps.test_mockk - testImplementation Deps.androidx_core_testing testImplementation Deps.test_coroutines } + diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 5a80299b..fda2c60c 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -40,7 +40,7 @@ object Deps { const val tools_kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" const val desugar_jdk_libs = "com.android.tools:desugar_jdk_libs:${Versions.desugar_jdk_libs}" const val test_junit = "junit:junit:${Versions.junit}" - const val test_mockk = "io.mockk:mockk-android:${Versions.mockk}" + const val test_mockk = "io.mockk:mockk:${Versions.mockk}" const val kotlinx_coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlinx_coroutines}" From 14513b879cb705bf85c2add5d82a10692ccd9ba5 Mon Sep 17 00:00:00 2001 From: RAW MAIN Date: Wed, 12 Jan 2022 11:20:19 +0100 Subject: [PATCH 4/4] fix: CI build and runtime for Android 12 compileSdk / targetSdk upgrade from API level 30 (Android 11/R) to 31 (Android 12/R) requires additional fixes in order to avoid CI failures on build & LoadKeysWorker crash while running the app on Android 12+ devices. --------------------- - JDK CI java-version upgrade from 1.8 to 11 - androidx.work:work-runtime-ktx dependency version upgrade from 2.5.0 to 2.7.1 + top-level project dependency override (in order to keep alignment between app & other projects) - Using androidx.startup to initialize WorkManager (required since work-runtime-ktx:2.6.0) --- .github/workflows/ci-release.yml | 2 +- .github/workflows/ci.yml | 2 +- app/src/main/AndroidManifest.xml | 12 +++++++++--- build.gradle | 5 +++++ buildSrc/src/main/java/Versions.kt | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 542e914c..57cff705 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -25,7 +25,7 @@ jobs: path: dgca-verifier-app-android - uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 11 distribution: adopt - uses: android-actions/setup-android@v2 - uses: actions/cache@v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e78e1fb..325dd6d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: path: dgca-verifier-app-android - uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 11 distribution: adopt - uses: android-actions/setup-android@v2 - uses: actions/cache@v2 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8187b8d7..8f908814 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,6 +39,7 @@ @@ -61,10 +62,15 @@ android:screenOrientation="portrait" /> + tools:node="merge"> + + diff --git a/build.gradle b/build.gradle index b791be4d..7642ce7a 100644 --- a/build.gradle +++ b/build.gradle @@ -28,6 +28,11 @@ allprojects { google() jcenter() } + project.configurations.all { + resolutionStrategy { + force Deps.androidx_worker_ktx + } + } } task clean(type: Delete) { diff --git a/buildSrc/src/main/java/Versions.kt b/buildSrc/src/main/java/Versions.kt index d16d0c5f..5fd3b1c5 100644 --- a/buildSrc/src/main/java/Versions.kt +++ b/buildSrc/src/main/java/Versions.kt @@ -50,7 +50,7 @@ object Versions { const val androidx_hilt_viewmodel = "1.0.0-alpha02" const val androidx_hilt_work = work_hilt const val androidx_hilt_compiler = work_hilt - const val androidx_worker_ktx = "2.5.0" + const val androidx_worker_ktx = "2.7.1" const val hilt_version = "2.33-beta" // QR