Created
February 15, 2020 09:51
-
-
Save indranil32/fb5b922988c52bb4f89e89b23afe922e 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
apply plugin: 'maven-publish' | |
.. | |
.. | |
def versionMajor = 1 | |
def versionMinor = 0 | |
def versionPatch = 0 | |
.. | |
.. | |
publishing { | |
repositories { | |
maven { | |
// internal CI builds | |
url uploadRepoSnapshotUrl | |
credentials { | |
username uploadRepoUsername | |
password uploadRepoPassword | |
} | |
} | |
} | |
publications { | |
create("apk-nexus-upload", MavenPublication) { | |
afterEvaluate { | |
android.applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
// only upload release builds | |
if (variant.name == "release") { | |
groupId uploadGroupId | |
artifactId uploadArtifactId | |
// "${versionMajor}.${versionMinor}.${versionPatch}-${versionBuild}" | |
version "${versionMajor}.${versionMinor}.${versionPatch}." + uploadBuildNumber | |
artifact(output.outputFile) | |
} | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment