Jan Skrasek
12/08/2022, 9:25 AMbod
12/08/2022, 9:41 AMservice
block?bod
12/08/2022, 9:44 AMJan Skrasek
12/08/2022, 9:56 AMJan Skrasek
12/08/2022, 9:57 AMproject.extensions.configure<com.apollographql.apollo3.gradle.api.ApolloExtension> {
val packagePath = "com.example" + path.replace(":", ".") + ".network"
packageName.set(packagePath)
codegenModels.set("responseBased")
generateOptionalOperationVariables.set(false)
generateAsInternal.set(true)
}
dependencies {
withVersionCatalog { libs ->
add("implementation", libs.apollo.runtime)
}
}
Jan Skrasek
12/08/2022, 9:58 AMapollo {
generateTestBuilders.set(true)
}
But adding services (with the same name) creates the problembod
12/08/2022, 10:00 AMservice
block actually creates a service, so calling it multiple times won't workbod
12/08/2022, 10:02 AMJan Skrasek
12/08/2022, 10:03 AMbod
12/08/2022, 10:10 AMJan Skrasek
12/08/2022, 10:13 AMbod
12/08/2022, 10:18 AMMabye we could delay the apollo's configure call.that's what I meant 👍 so something like: • gradle.kts is loaded • its convention plugin registers own extension • its convention plugin is applied • convention plugins apply apollo plugin •
mbonnin
12/08/2022, 10:29 AMservice {}
block.
If it's in your convention plugin, then your convention plugin now "owns" the Apollo plugin and you'll have to pass any configuration you want to set in individual build scripts to your convention plugin.
I understand how that's misleading because the DSL syntax could make you think that it's "declarative" while in reality everything is "imperative". We've looked at this from all directions and haven't really found a better solution. It's either that or weird scheduling/interop issueJan Skrasek
12/08/2022, 10:30 AMJan Skrasek
12/08/2022, 10:30 AMmbonnin
12/08/2022, 10:31 AM