I've created a standalone plugin along with a simple demo app, that I need for development. Both are added to the same project as an app
-module and a plugin
-module, so that I can easily develop and test features I write in the plugin. I'm assuming that if I add the sources from the plugin to buildSrc/build.gradle.kts
, I'll be able to reference the plugin sources from the app (I need that to build and apply the plugin). The demo project in its entirety can be found here: https://github.com/oizo/gradle-plugin-sample.
Currently, it seems that when I apply the plugin in app/build.gradle.kts
it's available (autocomplete is working) but when I try to build with ./gradlew build
it fails with this message:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/MyUser/github/gradle-plugin-sample/app/build.gradle.kts' line: 10
* What went wrong:
Script compilation error:
Line 10: apply<io.hvam.android.plugin.StringPlugin>()
^ Unresolved reference: io
Clearly, I'm missing something.
I've tried the solution proposed in this post-https://stackoverflow.com/a/42263532/1181023, which seems to be a similar problem, but when I run ./gradlew build --include-build plugin/
it also fails to build, with the following:
FAILURE: Build failed with an exception.
* What went wrong:
Included build in /Users/MyUser/github/gradle-plugin-sample/plugin has a root project whose name 'plugin' is the same as a project of the main build.