Skip to content

Commit 8d83282

Browse files
authored
Switch the gradle plugin to gratatouille (#6524)
* switch the plugin to gratatouille * remove unused file
1 parent fa7b946 commit 8d83282

File tree

131 files changed

+1804
-3179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+1804
-3179
lines changed

build-logic/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dependencies {
5353
runtimeOnly(libs.sqldelight.plugin)
5454
runtimeOnly(libs.gradle.publish.plugin)
5555
runtimeOnly(libs.benmanes.versions)
56-
runtimeOnly(libs.gr8)
56+
runtimeOnly(libs.gratatouille)
5757
runtimeOnly(libs.kotlinx.binarycompatibilityvalidator)
5858
}
5959

build-logic/src/main/kotlin/CompilerOptions.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ fun Project.configureJavaAndKotlinCompilers(jvmTarget: Int?, kotlinCompilerOptio
9696
allWarningsAsErrors(true)
9797
}
9898

99-
fun setTestToolchain(project: Project, test: Test, javaVersion: Int) {
100-
val javaToolchains = project.extensions.getByName("javaToolchains") as JavaToolchainService
101-
test.javaLauncher.set(javaToolchains.launcherFor {
102-
languageVersion.set(JavaLanguageVersion.of(javaVersion))
103-
})
104-
105-
}
106-
10799
fun Project.allWarningsAsErrors(allWarningsAsErrors: Boolean) {
108100
kotlinExtensionOrNull?.forEachCompilerOptions {
109101
this.allWarningsAsErrors.set(allWarningsAsErrors)

build-logic/src/main/kotlin/Publishing.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,6 @@ private fun Project.configurePublishingInternal() {
238238
}
239239
}
240240

241-
plugins.hasPlugin("com.gradle.plugin-publish") -> {
242-
/**
243-
* com.gradle.plugin-publish creates all publications
244-
*/
245-
}
246-
247241
plugins.hasPlugin("java-gradle-plugin") -> {
248242
/**
249243
* java-gradle-plugin creates 2 publications (one marker and one regular) but without source/javadoc.

build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ tasks.register("ciPublishRelease") {
5959

6060
tasks.register("ciTestsGradle") {
6161
description = "Execute the Gradle tests (slow)"
62-
dependsOn(":apollo-gradle-plugin:allTests")
63-
dependsOn(":apollo-gradle-plugin-external:validatePlugins")
62+
dependsOn(":apollo-gradle-plugin:test")
6463
}
6564

6665
tasks.register("ciTestsNoGradle") {

docs/source/advanced/persisted-queries.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ apollo {
5757

5858
The operation manifest is generated during code generation. This happens automatically every time you build your project, or you can trigger it manually by executing the `generateApolloSources` Gradle task.
5959

60-
The operation manifest is generated in `build/generated/manifest/apollo/$serviceName/persistedQueryManifest.json`, where `$serviceName` is `"api"` here. The resulting operation manifest looks something like this:
60+
The operation manifest is generated in `build/generated/manifest/apollo/$serviceName/persistedQueryManifest.json`, where `$serviceName` is `"api"` here. The resulting operation manifest is similar to the following example:
6161

6262
```json title="persistedQueryManifest.json"
6363
{

docs/source/advanced/plugin-configuration.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ apollo {
2222

2323
For more advanced usages, below are all Apollo Gradle Plugin options in a single code block. You can also take a look at the [Gradle Plugin recipes](../advanced/plugin-recipes).
2424

25-
Please refer to the [ApolloExtension](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin-external/com.apollographql.apollo.gradle.api/-apollo-extension/index.html) and [Service](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin-external/com.apollographql.apollo.gradle.api/-service/index.html) API reference for details about a specific API.
25+
Refer to the [ApolloExtension](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin/com.apollographql.apollo.gradle.api/-apollo-extension/index.html) and [Service](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin/com.apollographql.apollo.gradle.api/-service/index.html) API reference for details about each API.
2626

2727
```kotlin
2828
apollo {
@@ -70,10 +70,8 @@ apollo {
7070
mapScalarToJavaObject("MyObject")
7171

7272

73-
// The format to output for the operation manifest. One of "operationOutput", "persistedQueryManifest"
73+
// The format to output for the operation manifest. One of "none" (default) or "persistedQueryManifest"
7474
operationManifestFormat.set("persistedQueryManifest")
75-
// The file where to write the operation manifest
76-
operationManifest.set(file("build/generated/persistedQueryManifest.json"))
7775

7876
// Whether to generate Kotlin or Java models
7977
generateKotlinModels.set(true)
@@ -123,11 +121,7 @@ apollo {
123121
classesForEnumsMatching.set(listOf(".*"))
124122
// Whether fields with different shape are disallowed to be merged in disjoint types.
125123
fieldsOnDisjointTypesMustMerge.set(false)
126-
127-
128-
// The directory where the generated models are written.
129-
outputDir.set(file("build/generated/apollo"))
130-
124+
131125
// Whether to generate Apollo metadata. Apollo metadata is used for multi-module support.
132126
generateApolloMetadata.set(true)
133127
// list of [Regex] patterns matching for types and fields that should be generated whether they are used by queries/fragments in this module or not.

docs/source/caching/declarative-ids.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extend interface Node @typePolicy(keyFields: "id")
7979

8080
## Adding `__typename` to your operations
8181

82-
In addition to the key fields, the declarative cache requires the `__typename` of each object by default. These typenames are not included by default as they make query larger for non-cache users. To avoid cache misses, add `__typename` to every selection using [addTypename](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin-external/com.apollographql.apollo.gradle.api/-service/add-typename.html):
82+
In addition to the key fields, the declarative cache requires the `__typename` of each object by default. These typenames are not included by default because they make the queries larger for users not using the cache. To avoid cache misses, add `__typename` to every selection using [addTypename](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin/com.apollographql.apollo.gradle.api/-service/add-typename.html):
8383

8484
```kotlin
8585
apollo {

docs/source/caching/programmatic-ids.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You can also use the current object's typename to use _different_ cache ID gener
5555

5656
Note that for cache ID generation to work, your GraphQL operations must return whatever fields your custom code relies on (such as `id` above). If a query does not return a required field, the cache ID will be inconsistent, resulting in data duplication.
5757
Also, for interfaces and unions, `context.field.type.rawType().name` yields the typename as it is declared in the schema, as opposed to the runtime value of the type received in the response. Instead, querying for the `__typename` is safer.
58-
To make sure `__typename` is included in all operations set the [addTypename](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin-external/com.apollographql.apollo.gradle.api/-service/add-typename.html) gradle config:
58+
To make sure `__typename` is included in all operations set the [addTypename](https://www.apollographql.com/docs/kotlin/kdoc/apollo-gradle-plugin/com.apollographql.apollo.gradle.api/-service/add-typename.html) gradle config:
5959

6060
```
6161
apollo {

docs/source/essentials/modules.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,13 @@ See ["Apollo Compiler plugins"](https://www.apollographql.com/docs/kotlin/advanc
4848

4949
`apollo-gradle-plugin` contains the Apollo Gradle plugin.
5050

51-
This module shadows and relocates its runtime dependencies to avoid classpath issues. This can make debugging harder in some cases.
52-
53-
See `apollo-gradle-plugin-external` for a version of `apollo-gradle-plugin` that does not shadow its dependencies.
54-
5551
See ["Gradle Plugin Configuration"](https://www.apollographql.com/docs/kotlin/advanced/plugin-configuration/) for how to use the Gradle plugin.
5652

57-
### apollo-gradle-plugin-external
58-
59-
`apollo-gradle-plugin-external` contains the Apollo Gradle plugin.
53+
### apollo-gradle-plugin-tasks
6054

61-
This module does not shadow its runtime dependencies, making it more prone to Gradle classpath issues.
55+
`apollo-gradle-plugin-tasks` contains the task implementations for the Apollo Gradle plugin.
6256

63-
See `apollo-gradle-plugin` for a version of `apollo-gradle-plugin-external` that shadow its dependencies.
64-
65-
See ["Gradle Plugin Configuration"](https://www.apollographql.com/docs/kotlin/advanced/plugin-configuration/) for how to use the Gradle plugin.
57+
This module is loaded in a separate classloader to allow compiler plugins and avoid polluting the main build script classpath. This module is an implementation detail of `apollo-gradle-plugin` and should not be depended on directly.
6658

6759
### apollo-http-cache
6860

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ org.jetbrains.dokka.experimental.tryK2.nowarn=true
3030

3131
# https://kotlinlang.slack.com/archives/C0B8L3U69/p1740063113894839
3232
kotlin.js.yarn=false
33+
34+
# https://github.com/gradle/gradle/issues/31278
35+
kotlin.internal.collectFUSMetrics=false

0 commit comments

Comments
 (0)