diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 54a659d0..6ad9598d 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -16,7 +16,11 @@ group = "com.apollographql.cache.build" dependencies { compileOnly(gradleApi()) - compileOnly(libs.kotlin.plugin) + implementation(libs.kotlin.plugin) + implementation(libs.librarian) + implementation(libs.atomicfu.plugin) + implementation(libs.sqldelight.plugin) + implementation(libs.android.plugin) } java { diff --git a/build.gradle.kts b/build.gradle.kts index 289bb8e1..81d9b2c7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,14 +1,7 @@ -import com.gradleup.librarian.gradle.librarianRoot +import com.gradleup.librarian.gradle.Librarian plugins { - id("build.logic") apply false - - alias(libs.plugins.kotlin.multiplatform).apply(false) - alias(libs.plugins.kotlin.jvm).apply(false) - alias(libs.plugins.android).apply(false) - alias(libs.plugins.librarian).apply(false) - alias(libs.plugins.atomicfu).apply(false) - alias(libs.plugins.sqldelight).apply(false) + id("build.logic").apply(false) } -librarianRoot() +Librarian.root(project) diff --git a/gradle.properties b/gradle.properties index d8b32194..9f6f8d30 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,5 @@ org.gradle.jvmargs=-Xmx8g android.useAndroidX=true + +kotlin.stdlib.default.dependency=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ab580114..c63c76df 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,24 +1,26 @@ [versions] -kotlin-plugin = "2.0.21" +kotlin-plugin = "2.1.0" android-plugin = "8.7.0" -apollo = "4.1.0" +apollo = "4.1.1" okio = "3.9.0" atomicfu = "0.23.1" # Must be the same version as the one used by apollo-testing-support or native compilation will fail sqldelight = "2.0.1" androidx-sqlite = "2.3.1" -librarian = "0.0.6" +librarian = "0.0.8-SNAPSHOT-cd822254de75426f8f047a50bae467da872cc912" [libraries] apollo-api = { group = "com.apollographql.apollo", name = "apollo-api", version.ref = "apollo" } apollo-mpp-utils = { group = "com.apollographql.apollo", name = "apollo-mpp-utils", version.ref = "apollo" } apollo-testing-support = { group = "com.apollographql.apollo", name = "apollo-testing-support", version.ref = "apollo" } apollo-runtime = { group = "com.apollographql.apollo", name = "apollo-runtime", version.ref = "apollo" } -apollo-mockserver = "com.apollographql.mockserver:apollo-mockserver:0.0.1" +apollo-mockserver = "com.apollographql.mockserver:apollo-mockserver:0.1.0" apollo-ast = { group = "com.apollographql.apollo", name = "apollo-ast", version.ref = "apollo" } apollo-compiler = { group = "com.apollographql.apollo", name = "apollo-compiler", version.ref = "apollo" } apollo-cache = { group = "com.apollographql.apollo", name = "apollo-normalized-cache", version.ref = "apollo" } apollo-cache-sqlite = { group = "com.apollographql.apollo", name = "apollo-normalized-cache-sqlite", version.ref = "apollo" } +apollo-plugin = { group = "com.apollographql.apollo", name = "apollo-gradle-plugin", version.ref = "apollo" } atomicfu-library = { group = "org.jetbrains.kotlinx", name = "atomicfu", version.ref = "atomicfu" } +atomicfu-plugin = { group = "org.jetbrains.kotlinx", name = "atomicfu-gradle-plugin", version.ref = "atomicfu" } kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test" } # the Kotlin plugin resolves the version kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit" } # the Kotlin plugin resolves the version okio = { group = "com.squareup.okio", name = "okio", version.ref = "okio" } @@ -35,12 +37,11 @@ androidx-sqlite-framework = { group = "androidx.sqlite", name = "sqlite-framewor androidx-startup-runtime = "androidx.startup:startup-runtime:1.1.1" kotlin-poet = { group = "com.squareup", name = "kotlinpoet", version = "1.18.1" } kotlin-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin-plugin" } +librarian = { module = "com.gradleup.librarian:librarian-gradle-plugin", version.ref = "librarian"} +android-plugin = { module = "com.android.tools.build:gradle", version.ref = "android-plugin"} +sqldelight-plugin = { module = "app.cash.sqldelight:gradle-plugin", version.ref = "sqldelight"} + [plugins] -kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-plugin" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-plugin" } -android = { id = "com.android.library", version.ref = "android-plugin" } -librarian = { id = "com.gradleup.librarian", version.ref = "librarian" } -atomicfu = { id = "org.jetbrains.kotlin.plugin.atomicfu", version.ref = "kotlin-plugin" } -sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } apollo = { id = "com.apollographql.apollo", version.ref = "apollo" } diff --git a/gradle/repositories.gradle.kts b/gradle/repositories.gradle.kts index 3e713e46..8d13fb18 100644 --- a/gradle/repositories.gradle.kts +++ b/gradle/repositories.gradle.kts @@ -6,5 +6,6 @@ listOf(pluginManagement.repositories, dependencyResolutionManagement.repositorie mavenCentral() google() gradlePluginPortal() + maven("https://storage.googleapis.com/gradleup/m2") } } diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 93ff67de..92448e94 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -286,6 +286,13 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +kotlin-web-helpers@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-2.0.0.tgz#b112096b273c1e733e0b86560998235c09a19286" + integrity sha512-xkVGl60Ygn/zuLkDPx+oHj7jeLR7hCvoNF99nhwXMn8a3ApB4lLiC9pk4ol4NHPjyoCbvQctBqvzUcp8pkqyWw== + dependencies: + format-util "^1.0.5" + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -308,10 +315,10 @@ minimatch@^5.0.1, minimatch@^5.1.6: dependencies: brace-expansion "^2.0.1" -mocha@10.7.0: - version "10.7.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.0.tgz#9e5cbed8fa9b37537a25bd1f7fb4f6fc45458b9a" - integrity sha512-v8/rBWr2VO5YkspYINnvu81inSz2y3ODJrhO175/Exzor1RcEZZkizgE2A+w/CAXXoESS8Kys5E62dOHGHzULA== +mocha@10.7.3: + version "10.7.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" + integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== dependencies: ansi-colors "^4.1.3" browser-stdout "^1.3.1" @@ -346,6 +353,13 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" +node-fetch@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" diff --git a/librarian.properties b/librarian.root.properties similarity index 77% rename from librarian.properties rename to librarian.root.properties index 39ec9197..fa735c85 100644 --- a/librarian.properties +++ b/librarian.root.properties @@ -12,4 +12,3 @@ pom.description=Apollo Kotlin Incubating Normalized Cache pom.vcsUrl=https://github.com/apollographql/apollo-kotlin-normalized-cache-incubating pom.developer=Apollo Kotlin Incubating Normalized Cache contributors pom.license=MIT License -pom.licenseUrl=https://raw.githubusercontent.com/apollographql/apollo-kotlin-normalized-cache-incubating/main/LICENSE diff --git a/normalized-cache-apollo-compiler-plugin/build.gradle.kts b/normalized-cache-apollo-compiler-plugin/build.gradle.kts index 49bf4312..209f0f29 100644 --- a/normalized-cache-apollo-compiler-plugin/build.gradle.kts +++ b/normalized-cache-apollo-compiler-plugin/build.gradle.kts @@ -1,10 +1,10 @@ -import com.gradleup.librarian.gradle.librarianModule +import com.gradleup.librarian.gradle.Librarian plugins { - alias(libs.plugins.kotlin.jvm) + id("org.jetbrains.kotlin.jvm") } -librarianModule(true) +Librarian.module(project) dependencies { implementation(libs.apollo.compiler) diff --git a/normalized-cache-apollo-compiler-plugin/librarian.properties b/normalized-cache-apollo-compiler-plugin/librarian.module.properties similarity index 100% rename from normalized-cache-apollo-compiler-plugin/librarian.properties rename to normalized-cache-apollo-compiler-plugin/librarian.module.properties diff --git a/normalized-cache-incubating/build.gradle.kts b/normalized-cache-incubating/build.gradle.kts index 98b98e48..8327047c 100644 --- a/normalized-cache-incubating/build.gradle.kts +++ b/normalized-cache-incubating/build.gradle.kts @@ -1,11 +1,11 @@ -import com.gradleup.librarian.gradle.librarianModule +import com.gradleup.librarian.gradle.Librarian plugins { - alias(libs.plugins.kotlin.multiplatform) - alias(libs.plugins.atomicfu) + id("org.jetbrains.kotlin.multiplatform") + id("org.jetbrains.kotlin.plugin.atomicfu") } -librarianModule(true) +Librarian.module(project) kotlin { configureKmp( diff --git a/normalized-cache-incubating/librarian.properties b/normalized-cache-incubating/librarian.module.properties similarity index 100% rename from normalized-cache-incubating/librarian.properties rename to normalized-cache-incubating/librarian.module.properties diff --git a/normalized-cache-sqlite-incubating/build.gradle.kts b/normalized-cache-sqlite-incubating/build.gradle.kts index 96921424..762a70e9 100644 --- a/normalized-cache-sqlite-incubating/build.gradle.kts +++ b/normalized-cache-sqlite-incubating/build.gradle.kts @@ -1,12 +1,12 @@ -import com.gradleup.librarian.gradle.librarianModule +import com.gradleup.librarian.gradle.Librarian plugins { - alias(libs.plugins.kotlin.multiplatform) - alias(libs.plugins.android) - alias(libs.plugins.sqldelight) + id("org.jetbrains.kotlin.multiplatform") + id("com.android.library") + id("app.cash.sqldelight") } -librarianModule(true) +Librarian.module(project) kotlin { configureKmp( diff --git a/normalized-cache-sqlite-incubating/librarian.properties b/normalized-cache-sqlite-incubating/librarian.module.properties similarity index 100% rename from normalized-cache-sqlite-incubating/librarian.properties rename to normalized-cache-sqlite-incubating/librarian.module.properties diff --git a/tests/build.gradle.kts b/tests/build.gradle.kts index 1fc20c40..47aae8a2 100644 --- a/tests/build.gradle.kts +++ b/tests/build.gradle.kts @@ -1,6 +1,5 @@ plugins { - id("build.logic") apply false - + id("build.logic").apply(false) alias(libs.plugins.kotlin.multiplatform).apply(false) alias(libs.plugins.apollo).apply(false) } diff --git a/tests/garbage-collection/src/commonMain/graphql/extra.graphqls b/tests/garbage-collection/src/commonMain/graphql/extra.graphqls index 76f2c3c2..c3e0a473 100644 --- a/tests/garbage-collection/src/commonMain/graphql/extra.graphqls +++ b/tests/garbage-collection/src/commonMain/graphql/extra.graphqls @@ -9,15 +9,6 @@ extend schema import: ["@cacheControl", "@cacheControlField"] ) -# Workaround for https://github.com/apollographql/apollo-kotlin/pull/6284 -# Remove when the fix is released -directive @link( - url: String!, - as: String, - import: [Import], - for: Purpose) -repeatable on SCHEMA - extend type Query @fieldPolicy(forField: "user" keyArgs: "id") @fieldPolicy(forField: "users" keyArgs: "ids") diff --git a/tests/kotlin-js-store/yarn.lock b/tests/kotlin-js-store/yarn.lock index f131b1d0..93768e2f 100644 --- a/tests/kotlin-js-store/yarn.lock +++ b/tests/kotlin-js-store/yarn.lock @@ -286,6 +286,13 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +kotlin-web-helpers@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-2.0.0.tgz#b112096b273c1e733e0b86560998235c09a19286" + integrity sha512-xkVGl60Ygn/zuLkDPx+oHj7jeLR7hCvoNF99nhwXMn8a3ApB4lLiC9pk4ol4NHPjyoCbvQctBqvzUcp8pkqyWw== + dependencies: + format-util "^1.0.5" + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -308,10 +315,10 @@ minimatch@^5.0.1, minimatch@^5.1.6: dependencies: brace-expansion "^2.0.1" -mocha@10.7.0: - version "10.7.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.0.tgz#9e5cbed8fa9b37537a25bd1f7fb4f6fc45458b9a" - integrity sha512-v8/rBWr2VO5YkspYINnvu81inSz2y3ODJrhO175/Exzor1RcEZZkizgE2A+w/CAXXoESS8Kys5E62dOHGHzULA== +mocha@10.7.3: + version "10.7.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" + integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== dependencies: ansi-colors "^4.1.3" browser-stdout "^1.3.1" @@ -346,6 +353,13 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" +node-fetch@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"