Created
October 28, 2016 06:20
-
-
Save rogerhu/0bcbd1573f594abca4a7f156af247d48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired from https://gist.github.com/adrianbk/c4982e5ebacc6b6ed902 | |
apply plugin: 'maven-publish' | |
def isReleaseBuild() { | |
return VERSION_NAME.contains("SNAPSHOT") == false | |
} | |
def getOutputDir() { | |
if (isReleaseBuild()) { | |
return "${project.buildDir}/releases" | |
} else { | |
return "${project.buildDir}/snapshots" | |
} | |
} | |
def getDestUrl() { | |
if (isReleaseBuild()) { | |
return "s3://my-bucket/releases" | |
} else { | |
return "s3://my-bucket/snapshots" | |
} | |
} | |
publishing { | |
publications { | |
myPublication (MavenPublication) { | |
groupId GROUP | |
artifactId POM_ARTIFACT_ID | |
version VERSION_NAME | |
} | |
} | |
repositories { | |
maven { | |
url getDestUrl() | |
credentials(AwsCredentials) { | |
accessKey = "key" | |
secretKey = "password" | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment