Hi all! Maybe this is impossible, but I wanted to ask:
Is it possible to share code between
buildSrc/build.gradle.kts
file and the rest of buildSrc files?
I have some configuration that I use in some of my plugins that I also would like to reuse in the build.gradle file. However, this file is used to build the buildSrc, so I cannot reference to any of my buildSrc helper classes.
I don’t know if I’m missing something or this just is not achievable. Any help?
t
tapchicoma
04/09/2020, 3:47 PM
no, it is not possible
👍 1
tapchicoma
04/09/2020, 3:49 PM
probably you could create standalone gradle plugin that you could use both in
buildSrc/build.gradle.kts
and in files inside
buildSrc/src
folder
r
rolgalan
04/09/2020, 4:59 PM
But where this plugin should be declared?
I have created plugins inside the buildSrc, but of course they cannot be used here for the same reason…
t
trevjones
04/09/2020, 5:05 PM
feature request: buildSrc for buildSrc
😅 3
t
tapchicoma
04/09/2020, 7:03 PM
@rolgalan I mean you need to write your plugin in a separate repository, then publish it and then consume both in
buildSrc/build.gradle.kts
and your sources inside this module
👍 2
r
rolgalan
04/09/2020, 7:22 PM
Ok, I imagine that.. thanks for the info. I wasn't 100% sure 👍