You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/retrofit-graphql-build-dependencies/references/build-map.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Use this map to choose the right build file before editing.
11
11
| Shared dependency strategy |`buildSrc/.../strategy/DependencyStrategy.kt`| Default Kotlin, Retrofit, OkHttp, coroutines, and test libraries per module type |
| Publishing options |`buildSrc/.../components/AndroidOptions.kt` (Android), per-module `build.gradle.kts` (JVM)| AGP component-backed publications via `singleVariant("release")` + `withSourcesJar()`. JVM modules (`:annotations`, `:codegen-core`) inline publishing. Publication name `"maven"` for all modules. |
14
+
| Publishing options |`buildSrc/.../components/AndroidOptions.kt` (Android), per-module `build.gradle.kts` (JVM), `gradle-plugin/build.gradle.kts`, `gradle-plugin/buildSrc/.../JvmConfiguration.kt`, `.jitpack.yml`| Root Android publications use AGP components. The standalone `gradle-plugin` composite build publishes both the plugin implementation + marker artifacts and republishes included `:codegen-core` with explicit coordinates from `gradle/version.properties`. `.jitpack.yml` must run both root and standalone plugin `publishToMavenLocal` commands. |
15
15
| Dependency versions and aliases |`gradle/libs.versions.toml`| Add or update aliases here first |
16
16
| Library build |`library/build.gradle.kts`| Applies the shared plugin; no module-specific overrides needed for standard changes |
17
17
| Sample app build |`app/build.gradle.kts`| Applies the shared plugin; Room compiler options, build config fields from `.config/`|
@@ -28,4 +28,5 @@ Use this map to choose the right build file before editing.
28
28
- Cross-module convention: `buildSrc`.
29
29
- One module only: that module's `build.gradle.kts`.
30
30
- Documentation generation or publish behavior: Dokka config in `buildSrc/...AndroidOptions.kt` plus the workflow file.
31
+
- Standalone plugin publishing or plugin marker issues: `gradle-plugin/build.gradle.kts`, `gradle-plugin/settings.gradle.kts`, `gradle-plugin/buildSrc/.../JvmConfiguration.kt`, and `.jitpack.yml`.
31
32
- Memory or JVM tuning: `gradle.properties` (repo-wide) or `~/.gradle/gradle.properties` (user-local, preferred for personal overrides).
|`:codegen-core`| Kotlin JVM | Code generation engine: parses `.graphql` files with graphql-java, generates Kotlin with KotlinPoet. Uses `SchemaIndex` for typed schema metadata, `GraphQLTypeMapper` for kind-aware mapping, `GraphQLDefaultValueRenderer` for default literals, and `GraphQLTypeUsageValidator` for recursive scalar validation. |
64
-
|`:gradle-plugin`| Gradle Plugin | Plugin `id("co.anitrend.retrofit.graphql.codegen")`. Registers `GenerateGraphQLSourcesTask`, wires output into source sets. Lives in composite build under `pluginManagement`|
64
+
|`:gradle-plugin`| Gradle Plugin | Plugin `id("co.anitrend.retrofit.graphql.codegen")`. Registers `GenerateGraphQLSourcesTask`, wires output into source sets, owns standalone functional tests, and publishes its own marker/implementation artifacts from the composite build.|
|`:library`| Android |**Deprecated** aggregator. Re-exports all modules via `api()`. Contains type aliases from old `io.github.wax911.library` package |
@@ -83,7 +83,7 @@ The project is organized into composable modules under the `co.anitrend.retrofit
83
83
-**Toolchain**: Java/Kotlin 21 (pinned in `.java-version`). Local dev uses `jenv`; CI uses `actions/setup-java`.
-**Formatting**: Ktlint via Spotless. License header at `spotless/copyright.kt`.
86
-
-**Publishing**: JitPack. JitPack badge/coordinates at top of README.
86
+
-**Publishing**: JitPack. Root modules publish from the main build; the standalone `:gradle-plugin` composite build must also publish separately. `.jitpack.yml` runs both `./gradlew build publishToMavenLocal` and `./gradlew -p gradle-plugin publishToMavenLocal` so plugin marker + implementation artifacts and the included `:codegen-core` dependency are materialized for JitPack.
87
87
-**CI**: Only `:library` is built/tested in CI environments. It serves as the aggregate facade and transitively builds all sub-modules via `api()` deps. `:app` is excluded in CI (see `settings.gradle.kts`).
88
88
-**Dokka**: Generated via `buildSrc``AndroidOptions.kt`. Published at `https://anitrend.github.io/retrofit-graphql/`. Currently generates from `:library` only; multi-module Dokka is a planned follow-up.
> **Note:**`GraphConverter.create(context, registry)` is the recommended factory for codegen consumers. It wires the generated registry while keeping asset-based discovery as a fallback.
156
+
> **Note:**`GraphConverter.create(registry)` and `GraphConverter.create(gson, registry)` are the new codegen-first factories. Use `GraphConverter.create(context, registry)` when you still want asset-based fallback during a mixed migration.
157
+
> **Note:** In registry-only mode, unresolved operations do not throw during conversion. The request is still built and the serialized GraphQL `query` remains `null`.
132
158
133
159
### Multipart Uploads
134
160
@@ -263,6 +289,8 @@ New (with optional registry for codegen):
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,52 @@ dependencies {
103
103
104
104
For code generation support, apply the Gradle plugin and add a `retrofitGraphQL { }` config block. The plugin generates operation constants, a document registry, enum classes, variable classes, and typed request helpers. See [MIGRATION.md](MIGRATION.md) for the full migration guide and the [wiki Code Generation page](https://github.com/AniTrend/retrofit-graphql/wiki/Codegen) for the DSL reference.
105
105
106
+
### Gradle Plugin Consumption
107
+
108
+
The codegen plugin can now be consumed through the Gradle `plugins {}` DSL.
109
+
110
+
```kotlin
111
+
pluginManagement {
112
+
repositories {
113
+
mavenLocal() // optional for local verification / development
114
+
maven(url = uri("https://jitpack.io"))
115
+
gradlePluginPortal()
116
+
mavenCentral()
117
+
google()
118
+
}
119
+
}
120
+
121
+
plugins {
122
+
id("co.anitrend.retrofit.graphql.codegen") version "{latest_version}"
123
+
}
124
+
```
125
+
126
+
> **JitPack note:** this repository now ships a root `.jitpack.yml` that runs both the main build publication and the standalone `gradle-plugin` publication path. Local verification in this repository resolves the plugin from `mavenLocal()` using the published plugin marker artifact; remote JitPack resolution should follow the same published metadata flow.
127
+
128
+
### Converter Factories for Codegen Registries
129
+
130
+
Codegen-only consumers no longer need an Android `Context` just to use the generated registry:
131
+
132
+
```kotlin
133
+
val converter =GraphConverter.create(registry =GeneratedGraphQLRegistry)
134
+
135
+
val customGsonConverter =GraphConverter.create(
136
+
gson =GsonBuilder().serializeNulls().create(),
137
+
registry =GeneratedGraphQLRegistry,
138
+
)
139
+
```
140
+
141
+
If you want generated documents first **and** asset-based fallback for mixed migrations, keep using the context-backed overload:
142
+
143
+
```kotlin
144
+
val converter =GraphConverter.create(
145
+
context = context,
146
+
registry =GeneratedGraphQLRegistry,
147
+
)
148
+
```
149
+
150
+
In registry-only mode, if an operation is missing from the registry, the request body is still built and the serialized GraphQL `query` remains `null`.
151
+
106
152
-__Optional R8 / ProGuard Rules__
107
153
108
154
If you are using R8 the shrinking and obfuscation rules are included automatically.
Copy file name to clipboardExpand all lines: android-assets/src/main/kotlin/co/anitrend/retrofit/graphql/annotation/processor/contract/AbstractGraphProcessor.kt
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,8 @@ abstract class AbstractGraphProcessor {
48
48
* @param annotations A collection of method annotation from an ongoing request
49
49
*
50
50
* @return GraphQL query in the form of [String] or null if the request method was not
51
-
* annotated with [GraphQuery] or if the no such file could be found
51
+
* annotated with [GraphQuery], if no such file could be found, or when a no-op processor is
52
+
* intentionally used for registry-only runtime lookup.
0 commit comments