Best way to re-use a function across Gradle submodules
I defined a Kotlin function in one of my submodules to load some environment variables from a file. I now want to use this function in other submodules as well, but define it only once. I can achieve this using a buildSrc dir. But to me it seems overkill to have an entire buildSrc/ just for one function. Is this the recommended way to achieve what I want or is there a better way?
Where can I define a repository function so that I can use it in my entire gradle build, including buildSrc?
I have a functions that’s an alternative to mavenCentral
, which creates an ArtifactRepository: