apply plugin: "com.jfrog.bintray" apply plugin: 'maven-publish' apply plugin: 'maven' def siteUrl = 'https://github.com/smartdevicelink/sdl_android' // Homepage URL of the library def gitUrl = 'https://github.com/smartdevicelink/sdl_android.git' // Git repository URL group = "com.smartdevicelink" // Maven Group ID for the artifact def libDescription = 'SmartDeviceLink mobile library' task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } javadoc.failOnError = false task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } artifacts { archives sourcesJar archives javadocJar } bintray { Properties props = new Properties() props.load(new FileInputStream("$projectDir/bintray.properties")) // Authorization user = props.getProperty("bintray.user") key = props.getProperty("bintray.key") version = "$project.version" publications = ['mavenPublication'] pkg { repo = props.getProperty("bintray.repo") name = props.getProperty("bintray.artifact") websiteUrl = siteUrl vcsUrl = gitUrl userOrg = props.getProperty("bintray.userorg") licenses = ["BSD 3-Clause"] publish = props.getProperty("bintray.publish") // Will upload to jCenter version { name = "$project.version" // Change to release version desc = libDescription released = new Date() // Will be the current date & time vcsTag = props.getProperty("bintray.vcs") // Should match git tag } } } def pomConfig = { Properties props = new Properties() props.load(new FileInputStream("$projectDir/bintray.properties")) licenses { license { name 'BSD 3-Clause' url 'https://opensource.org/licenses/BSD-3-Clause' distribution "repo" } } scm { url siteUrl } } publishing { publications { mavenPublication(MavenPublication) { Properties props = new Properties() props.load(new FileInputStream("$projectDir/bintray.properties")) from components.java artifact sourcesJar { classifier "sources" } artifact javadocJar { classifier "javadoc" } groupId props.getProperty("bintray.userorg") artifactId props.getProperty("bintray.artifact") version "$project.version" pom.withXml { def root = asNode() root.appendNode('description', libDescription) root.appendNode('name', props.getProperty("bintray.artifact")) root.appendNode('url', siteUrl) root.children().last() + pomConfig } } } }