I have a problem: I have a `build-logic` composit...
# community-support
t
I have a problem: I have a
build-logic
composite build that is included by
includeBuild
in
settings.gradle.kts
.
build-logic
contains
convention
modules with custom convention plugins and also contains
config
module that contains API for plugins. I use
config
in my ordinary projects and the problem is that
config
is not located in root project because it is in the composite build, so I used to implement it like that:
implementation(":build-logic:config")
and everything worked, but when I try to publish it resolves this as a dependency and Maven Central throws an error that dependency version is not supplied.
v
Why should you use
implementation
? That means you add a production dependency which then of course makes problems when trying to publish your project. If
config
contains API for configuring your convention plugin, you should not add a production dependency. Your plugin project should depend on
config
and then when applying the plugin,
config
will automatically be available. If I understood something wrong, you should maybe knit an MCVE that demonstrates your situation.
t
Can you take a look at this project ? https://github.com/Timbermir/clean-wizard/tree/2.0.0. You can just check build-logic module and I guess it should be much clearer to you.
v
Not really. It is not at all clear to me why you should need some code in your production code and in your convention plugins. But I also do not have the time to deeply analyze your project. But if this is the case. you probably should move
config
to an own build that is included by both, the root build and the
build-logic
build and that you also publish then.