Skip to content

Instantly share code, notes, and snippets.

@aashreys
Created May 18, 2016 16:19
Show Gist options
  • Select an option

  • Save aashreys/1b7456f0021613af85e9921049d69836 to your computer and use it in GitHub Desktop.

Select an option

Save aashreys/1b7456f0021613af85e9921049d69836 to your computer and use it in GitHub Desktop.
build.gradle script additions to allow uploading debug and release builds to different maven repos.
configurations {
debugArchives
releaseArchives
}
artifacts {
def path = "${project.rootDir}/library/build/outputs/aar/"
debugArchives file: file(path + "${project.getName()}-debug.aar")
releaseArchives file: file(path + "${project.getName()}-release.aar")
}
uploadDebugArchives {
repositories {
mavenDeployer {
repository(url: "${artifactoryDevRepo}") {
authentication(userName: "${artifactoryDevUploaderUser}", password: "${artifactoryDevUploaderKey}")
}
pom.groupId = groupIdString
pom.artifactId = artifactIdString
pom.version = versionNameString
pom.packaging = 'aar'
}
}
}
uploadReleaseArchives {
repositories {
mavenDeployer {
repository(url: "${artifactoryProdRepo}") {
authentication(userName: "${artifactoryProdUploaderUser}", password: "${artifactoryProdUploaderKey}")
}
pom.groupId = groupIdString
pom.artifactId = artifactIdString
pom.version = versionNameString
pom.packaging = 'aar'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment