Last active
May 19, 2020 05:48
-
-
Save tonisives/1eddae336fcdbdd58723fe3e39d7d494 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
if (project.hasProperty("hmArtifactoryUrl") && project.hasProperty('releaseType') && project.releaseType > 0) { | |
// doesn't look like can include buildscript. | |
// https://discuss.gradle.org/t/how-do-i-include-buildscript-block-from-external-gradle-script/7016/2 | |
apply plugin: "maven" | |
apply plugin: "com.jfrog.artifactory" | |
apply plugin: 'com.jfrog.bintray' | |
apply plugin: 'digital.wup.android-maven-publish' | |
def artifact = new Properties() | |
artifact.load(new FileInputStream("$projectDir/deploy.settings")) | |
task sourcesJar(type: Jar) { | |
archiveClassifier.set('sources') | |
from android.sourceSets.main.java.srcDirs | |
} | |
publishing { | |
publications { | |
aar(MavenPublication) { | |
from components.android | |
groupId artifact.groupId | |
// for bintray: https://github.com/bintray/gradle-bintray-plugin | |
} | |
} | |
} | |
// artifactory | |
artifactory { | |
contextUrl = hmArtifactoryUrl | |
publish { | |
repository { | |
repoKey = project.hasProperty("repo") ? project.property("repo") : artifact.repo | |
username = hmArtifactoryPublishUser | |
password = hmArtifactoryPublishPassword | |
maven = true | |
} | |
defaults { | |
publishArtifacts = true | |
publications('aar') | |
publishIvy = false | |
publishPom = true | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment