https://kotlinlang.org logo
Title
j

Jan Skrasek

05/03/2022, 8:03 AM
I have a build-convention plugin in kts where I depend on Apollo
implementation("com.apollographql.apollo3:apollo-gradle-plugin:3.2.2")
but I fail to use any type from Apollo plugin (ApolloExtension, etc.), no autocompletion, class is not "visible". Any idea why? I use convention plugin and configure other tools (like Detekt) and it works like a charm.
b

bod

05/03/2022, 8:13 AM
I must admit I haven't tried it before. Apart from completion from the IDE, is it working when building?
e

ephemient

05/03/2022, 8:42 AM
even if you depend on a plugin, it's not going to affect the Gradle model unless it's also applied. e.g. you need both
dependencies { implementation(apollo) }
in your plugin's build.gradle and
plugins { apollo }
in your convention plugin
j

Jan Skrasek

05/03/2022, 9:46 AM
Thank you both. Yeah, I believe it will be rather my gradle setup issue, yet I'm applying it and it is working for my other plugins...
implementation("com.apollographql.apollo3:apollo-gradle-plugin:${libs.versions.apolloVersion.get()}")
Is in my plugin's build.gradle.kts.
b

bod

05/03/2022, 10:00 AM
what about with the full class name
com.apollographql.apollo3.gradle.api.ApolloExtension
?
j

Jan Skrasek

05/03/2022, 11:50 AM
Shame on me, it seems that the fqn works, even I believed that I've tried that. Thx!
b

bod

05/03/2022, 11:51 AM
oh that's cool 👍 I guess it was AS/IJ not finding the import 🙂