I wrote a gradle plugin that I only want to use in my own project. Here's a simplified file structure:
/root project
|
+ build.gradle
+ settings.gradle
+ build/
+ some module/
|
+ build.gradle
+ src/
+ build/
+ plugin/
|
+ build.gradle
+ src/
+ build/
I add the plugin to the module by referencing the jar file
// From '/some module/build.gradle'
buildscript {
dependencies {
classpath files('./plugin/build/libs/payload-plugin-0.0.1-SNAPSHOT.jar')
}
}
apply plugin: 'my-custom-plugin'
It works fine at first, but there's a problem. If you clean the project and try to build it again, it fails, because the './plugin/build/libs/payload-plugin-0.0.1-SNAPSHOT.jar'
no longer exists, and it will not try rebuilding the plugin module, as this counts as a configuration error.
I tried building the plugin only using gradlew :somemodule:plugin:build
but it checks the buildscript of `:somemodule' first, so it does not work.
Also tried classpath project(':somemodule:plugin')
instead of jar reference, but it says that plugin is not found.