Skip to content

Instantly share code, notes, and snippets.

@tonisives
Last active May 19, 2020 05:48
Show Gist options
  • Save tonisives/1eddae336fcdbdd58723fe3e39d7d494 to your computer and use it in GitHub Desktop.
Save tonisives/1eddae336fcdbdd58723fe3e39d7d494 to your computer and use it in GitHub Desktop.
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