Hello. I’m trying to build a plugin for my own usage, but I’m stuck with the repository structure.
I’m using buildSrc with a single kotlin-conventions.gradle.kts build convention. Using this convention, I’m building a plugin:
kotlin
plugins {
id("kotlin-conventions")
id("java-gradle-plugin")
}
dependencies {
// ...
}
gradlePlugin {
plugins {
create("io.kloak.cqrs.plugin") {
id = "io.kloak.cqrs.plugin"
implementationClass = "io.kloak.cqrs.plugin.KloakCqrsPlugin"
}
}
}
Now I’m trying to apply this plugin to another module, but I’m stuck. How can I do it?
a) If I use includeBuild, I can’t use kotlin-conventions. I think Gradle follows the plugin → buildSrc build path, but I need the other way around.
b) I could publish my plugin to Maven Local on each build and use it from ~/.m2, but I don’t like this approach
c) I don’t want to include this plugin to buildSrc because it is not build logic, it just part of library I’m trying to make, but It could work
Are there other alternatives?
You can find code here: GitHub - novikmisha/kloak
Plugin im trying to apply is located here: kloak/kloak-cqrs/kloak-cqrs-plugin at master · novikmisha/kloak · GitHub
And I want to apply plugin to this module:
kloak/kloak-cqrs/example at master · novikmisha/kloak · GitHub