Slackbot
06/21/2023, 8:26 PMDarragh Bailey
06/21/2023, 9:11 PMgradle.ext global and referencing it via the same property name.
e.g.:
def configureRepositories = { configObject, token ->
configObject.repositories {
maven {
name repoName.replace('-', '')
url "https://${domain}-${domainOwner}.d.codeartifact.${region}.<http://amazonaws.com/maven/${repoName}/|amazonaws.com/maven/${repoName}/>"
credentials {
username 'aws'
password token
}
}
}
}
def configRepos = configureRepositories.rcurry(artifactAuthToken)
configRepos(settings.pluginManagement)
configRepos(settings.dependencyResolutionManagement)
gradle.ext.configRepos = configRepos
Then at the end of build.gradle:
gradle.ext.configRepos(publishing)
Possibly there are better ways, but this means just need to drop the one file in to most projects and it's a small addition to the root build.gradle and should then work