From bea2c80a6968069aeac15354b0d82397073aed7f Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Mon, 10 Jul 2023 21:24:50 +0200 Subject: [PATCH] JDK17+ is now required to build the project --- .github/workflows/pr.yml | 2 +- CONTRIBUTING.md | 5 ++--- tests/pagination/build.gradle.kts | 1 + .../kotlin/OffsetBasedWithPagePaginationTest.kt | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 40dafae54a1..a33eedb6e40 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0 with: distribution: 'temurin' - java-version: 11 # Keep this one on an older JDK version to make sure we can still build with Java11 + java-version: 17 - uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3 with: gradle-home-cache-cleanup: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db8e39de4de..ab4f74b197d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,9 +11,8 @@ invite [here](https://slack.kotl.in/)) You will need: -* Java11+. The build uses [Gradle toolchains](https://docs.gradle.org/current/userguide/toolchains.html) to ensure - reproducibility of the generated bytecode, but you still need a JVM to run Gradle itself. We try to stick with the - latest versions of Java (19 currently) but you should be able to use versions down to 11. +* Java17+. The build uses [Gradle toolchains](https://docs.gradle.org/current/userguide/toolchains.html) to ensure + reproducibility of the generated bytecode, but you still need a JVM to run Gradle itself. * A recent version of IntelliJ IDEA community. Android Studio might work too, but we find out the experience for multiplatform code to be better with IntelliJ IDEA. * MacOS and the Xcode developer tools for iOS/MacOS targets. diff --git a/tests/pagination/build.gradle.kts b/tests/pagination/build.gradle.kts index 0538cd21e00..4363cdf4961 100644 --- a/tests/pagination/build.gradle.kts +++ b/tests/pagination/build.gradle.kts @@ -20,6 +20,7 @@ kotlin { findByName("commonTest")?.apply { dependencies { + implementation(golatac.lib("atomicfu")) implementation(golatac.lib("apollo.testingsupport")) implementation(golatac.lib("apollo.normalizedcache.incubating")) implementation(golatac.lib("apollo.normalizedcache.sqlite.incubating")) diff --git a/tests/pagination/src/commonTest/kotlin/OffsetBasedWithPagePaginationTest.kt b/tests/pagination/src/commonTest/kotlin/OffsetBasedWithPagePaginationTest.kt index 23093517fc7..597fc825b7b 100644 --- a/tests/pagination/src/commonTest/kotlin/OffsetBasedWithPagePaginationTest.kt +++ b/tests/pagination/src/commonTest/kotlin/OffsetBasedWithPagePaginationTest.kt @@ -13,7 +13,7 @@ import com.apollographql.apollo3.cache.normalized.api.TypePolicyCacheKeyGenerato import com.apollographql.apollo3.cache.normalized.api.internal.OptimisticCache import com.apollographql.apollo3.cache.normalized.sql.SqlNormalizedCacheFactory import com.apollographql.apollo3.testing.internal.runTest -import app.cash.sqldelight.internal.AtomicBoolean +import kotlinx.atomicfu.atomic import pagination.type.buildUser import pagination.type.buildUserPage import kotlin.math.max @@ -233,12 +233,12 @@ class OffsetBasedWithPagePaginationTest { } internal suspend fun assertChainedCachesAreEqual(apolloStore: ApolloStore) { - val hasNextCache = AtomicBoolean(false) + val hasNextCache = atomic(false) apolloStore.accessCache { cache -> // First cache is always OptimisticCache - hasNextCache.set(cache.nextCache!!.nextCache != null) + hasNextCache.value = cache.nextCache!!.nextCache != null } - if (!hasNextCache.get()) return + if (!hasNextCache.value) return val dump = apolloStore.dump().filterKeys { it != OptimisticCache::class } val caches = dump.values.toList() val cache1: Map = caches[0]