diff --git a/docs/source/advanced/compiler-plugins.mdx b/docs/source/advanced/compiler-plugins.mdx index 6b20ea801e9..51d61764e70 100644 --- a/docs/source/advanced/compiler-plugins.mdx +++ b/docs/source/advanced/compiler-plugins.mdx @@ -62,9 +62,11 @@ Make your plugin discoverable by [ServiceLoader](https://docs.oracle.com/javase/ mypackage.MyPlugin ``` - + + The name of the resource file is important. It must be `com.apollographql.apollo3.compiler.ApolloCompilerPlugin` and be in the `META-INF/services` folder. This is how `ServiceLoader` looks up plugins at runtime. + # Adding a plugin to the Apollo compiler classpath Use the `Service.plugin()` Gradle method to add the plugin to the Apollo compiler classpath: @@ -121,4 +123,4 @@ Because codegen is run in a separate classloader when using compiler plugins, it For other plugin APIs like layout, IR, JavaPoet and KotlinPoet transforms, check out the [ApolloCompilerPlugin API docs](https://www.apollographql.com/docs/kotlin/kdoc/apollo-compiler/com.apollographql.apollo3.compiler/-apollocompilerplugin/index.html) -For more examples, check out the [integration-tests](https://github.com/apollographql/apollo-kotlin/tree/main/tests/compiler-plugins). \ No newline at end of file +For more examples, check out the [integration-tests](https://github.com/apollographql/apollo-kotlin/tree/main/tests/compiler-plugins).