Hello, is there a way to use code from buildSrc in...
# gradle
i
Hello, is there a way to use code from buildSrc in main classes? specifically, i’m defining maven repositories to publish to, and i want to use that in my publish plugin, but also publish my publish plugin to the same repositories. So i need to have the repositories code available in the both the build of the plugin and the plugin itself
m
In general I'd say this is not possible unless you introduce a 3 build that's included from both
buildSrc
and your main build
(not even sure
buildSrc
can include other builds but you could turn
buildSrc
into a regular
build-logic
build)
a
perhaps the most practical way is just copy and paste the two files, and write an adhoc Gradle task in the root project to test the two files are the same (and link that task to the ‘check’ task)