Last active
June 21, 2017 03:14
-
-
Save robints/6efd6d50d2c6f0cd36ecdc2ffa93bc8a to your computer and use it in GitHub Desktop.
This file contains hidden or 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: 'com.android.library' | |
| apply plugin: 'com.jfrog.artifactory' | |
| apply plugin: 'maven-publish' | |
| def packageName = "${groupId}" | |
| def libraryVersion = "${version}" | |
| def libraryName = "${artifactId}" | |
| def artifactorySnapshotContextUrl = "${artifactorySnapshotContextUrl}" | |
| def artifactoyReleaseContenxtUrl = "${artifactoyReleaseContenxtUrl}" | |
| def artifactoryRepoKey = "${artifactoryRepoKey}" | |
| def artifactoryUsername = "${artifactoryUsername}" | |
| def artifactoryPassword = "${artifactoryPassword}" | |
| publishing { | |
| publications { | |
| aar(MavenPublication) { | |
| groupId packageName | |
| version libraryVersion | |
| artifactId libraryName | |
| // Tell maven to prepare the generated "*.aar" file for publishing | |
| artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") | |
| } | |
| } | |
| } | |
| artifactory { | |
| if(project.version.endsWith('-SNAPSHOT')) { | |
| contextUrl = artifactorySnapshotContextUrl | |
| }else { | |
| contextUrl = artifactoyReleaseContenxtUrl | |
| } | |
| publish { | |
| repository { | |
| // The Artifactory repository key to publish to | |
| repoKey = artifactoryRepoKey | |
| username = artifactoryUsername | |
| password = artifactoryPassword | |
| } | |
| defaults { | |
| // Tell the Artifactory Plugin which artifacts should be published to Artifactory. | |
| publications('aar') | |
| publishArtifacts = true | |
| // Properties to be attached to the published artifacts. | |
| properties = ['qa.level': 'basic', 'dev.team': 'core'] | |
| // Publish generated POM files to Artifactory (true by default) | |
| publishPom = true | |
| } | |
| } | |
| } | |
| artifactoryPublish.dependsOn assembleRelease |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment