Skip to content

Instantly share code, notes, and snippets.

@prof18
Last active September 28, 2019 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prof18/b8783f870354d3e131cea887a2d6a6b4 to your computer and use it in GitHub Desktop.
Save prof18/b8783f870354d3e131cea887a2d6a6b4 to your computer and use it in GitHub Desktop.
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
group 'com.your.awesome.lib'
version '1.0.0'
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/awesomelibrary-release.aar") {
builtBy tasks.getByName("assembleRelease")
}
groupId
artifactId 'awesomelibrary'
version this.version
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
// Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included in the pom.
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
def properties = new Properties()
properties.load(new FileInputStream("local.properties"))
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
publications = ['Production']
configurations = ['archives']
override = true
pkg {
repo = 'maven'
name = 'AwesomeLib'
description = "It's an awesome lib"
publicDownloadNumbers = true
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/prof18/AwesomeLib'
version {
name = this.version
desc = "Version ${this.version}"
released = new Date()
vcsTag = this.version
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment