diff --git a/.github/actions/build-core/action.yml b/.github/actions/build-core/action.yml index e9b3ef7ff..c1862d726 100644 --- a/.github/actions/build-core/action.yml +++ b/.github/actions/build-core/action.yml @@ -20,7 +20,7 @@ runs: if: steps.corecache.outputs.cache-hit != 'true' uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f with: - go-version-file: 'mobilecore-src/go.mod' + go-version: '1.20.6' - name: Build mobile core if: steps.corecache.outputs.cache-hit != 'true' run: | diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index ae46dcc8c..13cffa95f 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -9,7 +9,7 @@ runs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: Show java version shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e525fc509..5f282e241 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Spotless run: ./gradlew spotlessCheck - name: Test - run: ./gradlew testDebug testAccDebug holder:lintAccDebug verifier:lintAccDebug + run: ./gradlew testAccDebugUnitTest verifier:testAccDebugUnitTest - name: Emulator Test if: "!contains(github.event.pull_request.labels.*.name, 'skip-screenshot-tests')" uses: reactivecircus/android-emulator-runner@v2 diff --git a/build.gradle b/build.gradle index 33a126d97..7eaf13940 100644 --- a/build.gradle +++ b/build.gradle @@ -52,10 +52,10 @@ allprojects { project.plugins.withId("com.android.base") { android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 23 - targetSdkVersion 33 + targetSdkVersion 34 } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/gradle.properties b/gradle.properties index f4e31989b..dd48dfbae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,4 +28,7 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=false # Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official \ No newline at end of file +kotlin.code.style=official +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d0718a52e..260353c8f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,38 +1,38 @@ [versions] -agp = "7.4.2" +agp = "8.1.1" androidx-appcompat = "1.6.1" androidx-arch-core = "2.2.0" -androidx-camera = "1.3.0-alpha04" -androidx-core = "1.9.0" -androidx-fragment = "1.5.5" -androidx-lifecycle = "2.5.1" -androidx-navigation = "2.5.3" +androidx-camera = "1.3.0" +androidx-core = "1.12.0" +androidx-fragment = "1.6.2" +androidx-lifecycle = "2.6.2" +androidx-navigation = "2.7.5" androidx-orchestrator = "1.4.2" -androidx-preference = "1.2.0" -androidx-room = "2.5.0" +androidx-preference = "1.2.1" +androidx-room = "2.6.0" androidx-test = "1.5.0" androidx-work = "2.8.1" bouncycastle = "1.72" certificatetransparency = "1.1.1" -coroutines = "1.6.4" +coroutines = "1.7.3" groupie = "2.9.0" -koin = "3.2.2" +koin = "3.5.0" # @pin update Kotlin manually -kotlin = "1.8.10" +kotlin = "1.9.20" mockk = "1.13.4" moshi = "1.14.0" retrofit = "2.9.0" uiautomator = "2.2.0" [libraries] -androidx-browser = "androidx.browser:browser:1.5.0" +androidx-browser = "androidx.browser:browser:1.6.0" androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" } androidx-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "androidx-arch-core" } androidx-preference = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" } androidx-security-crypto = "androidx.security:security-crypto:1.0.0" androidx-test-core = { module = "androidx.test:core-ktx", version.ref = "androidx-test" } androidx-test-junit = "androidx.test.ext:junit-ktx:1.1.5" -androidx-test-monitor = "androidx.test:monitor:1.6.0" +androidx-test-monitor = "androidx.test:monitor:1.6.1" androidx-test-orchestrator = { module = "androidx.test:orchestrator", version.ref = "androidx-orchestrator" } androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" } androidx-test-runner = "androidx.test:runner:1.5.2" @@ -47,8 +47,8 @@ certificatetransparency-android = { module = "com.appmattus.certificatetranspare constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4" coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } -crashlytics = "com.google.firebase:firebase-crashlytics-ktx:18.3.5" -desugar = "com.android.tools:desugar_jdk_libs:2.0.2" +crashlytics = "com.google.firebase:firebase-crashlytics-ktx:18.5.1" +desugar = "com.android.tools:desugar_jdk_libs:2.0.4" espresso-core = "androidx.test.espresso:espresso-core:3.5.1" fragment = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" } fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "androidx-fragment" } @@ -60,8 +60,8 @@ koin-test-junit4 = { module = "io.insert-koin:koin-test-junit4", version.ref = " lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx-lifecycle" } lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } lottie = "com.airbnb.android:lottie:6.0.0" -material = "com.google.android.material:material:1.8.0" -mlkit-barcode = "com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0" +material = "com.google.android.material:material:1.10.0" +mlkit-barcode = "com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.0" mockk = { module = "io.mockk:mockk", version.ref = "mockk" } mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" } moshi-adapters = { module = "com.squareup.moshi:moshi-adapters", version.ref = "moshi" } @@ -78,7 +78,7 @@ okhttp-tls = { module = "com.squareup.okhttp3:okhttp-tls" } openid-appauth = "net.openid:appauth:0.11.1" retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } retrofit-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" } -robolectric = "org.robolectric:robolectric:4.9.2" +robolectric = "org.robolectric:robolectric:4.10.3" room = { module = "androidx.room:room-ktx", version.ref = "androidx-room" } room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" } room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" } @@ -90,7 +90,7 @@ uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = viewpager2 = "androidx.viewpager2:viewpager2:1.0.0" work-runtime = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx-work" } work-testing = { module = "androidx.work:work-testing", version.ref = "androidx-work" } -zxing-core = "com.google.zxing:core:3.5.1" +zxing-core = "com.google.zxing:core:3.5.2" [bundles] groupie = [ @@ -106,9 +106,9 @@ googleServices = "com.google.gms.google-services:4.3.15" kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } # @pin dependent on Kotlin version -ksp = "com.google.devtools.ksp:1.8.10-1.0.9" +ksp = "com.google.devtools.ksp:1.9.20-1.0.14" navigation-safeargs-kotlin = { id = "androidx.navigation.safeargs.kotlin", version.ref = "androidx-navigation" } -shot = "shot:5.14.1" +shot = "shot:6.0.0" spotless = "com.diffplug.spotless:5.10.1" versionCatalogUpdate = "nl.littlerobots.version-catalog-update:0.7.0" versions = "com.github.ben-manes.versions:0.46.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661ee..da1db5f04 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/holder/src/test/java/nl/rijksoverheid/ctr/LiveDataTestUtil.kt b/holder/src/test/java/nl/rijksoverheid/ctr/LiveDataTestUtil.kt index fa5290563..e1b1a84db 100644 --- a/holder/src/test/java/nl/rijksoverheid/ctr/LiveDataTestUtil.kt +++ b/holder/src/test/java/nl/rijksoverheid/ctr/LiveDataTestUtil.kt @@ -16,7 +16,7 @@ fun LiveData.getOrAwaitValue( var data: T? = null val latch = CountDownLatch(1) val observer = object : Observer { - override fun onChanged(o: T?) { + override fun onChanged(o: T) { data = o latch.countDown() this@getOrAwaitValue.removeObserver(this) diff --git a/rdo b/rdo index f73c66852..6781807dd 160000 --- a/rdo +++ b/rdo @@ -1 +1 @@ -Subproject commit f73c66852f008bea0fe886ea231fc516c0173073 +Subproject commit 6781807dd905e40cd5c4607a1b02a16078d83f4e diff --git a/shared/src/main/java/nl/rijksoverheid/ctr/shared/livedata/Event.kt b/shared/src/main/java/nl/rijksoverheid/ctr/shared/livedata/Event.kt index f99e09a95..c293a4476 100644 --- a/shared/src/main/java/nl/rijksoverheid/ctr/shared/livedata/Event.kt +++ b/shared/src/main/java/nl/rijksoverheid/ctr/shared/livedata/Event.kt @@ -50,9 +50,10 @@ data class Event(private val content: T) { * [onEventUnhandledContent] is *only* called if the [Event]'s contents has not been handled. */ class EventObserver(private val onEventUnhandledContent: (T) -> Unit) : Observer> { - override fun onChanged(event: Event?) { - event?.getContentIfNotHandled()?.let { value -> - onEventUnhandledContent(value) + + override fun onChanged(value: Event) { + value.getContentIfNotHandled()?.let { + onEventUnhandledContent(it) } } } diff --git a/spotless.gradle b/spotless.gradle index 2102d9101..e768722b4 100644 --- a/spotless.gradle +++ b/spotless.gradle @@ -2,7 +2,13 @@ apply plugin: "com.diffplug.spotless" spotless { kotlin { - target '**/*.kt' + target 'api/*.kt' + target 'appconfig/*.kt' + target 'design/*.kt' + target 'holder/*.kt' + target 'introduction/*.kt' + target 'qrscanner/*.kt' + target 'shared/*.kt' ktlint() trimTrailingWhitespace() indentWithSpaces()