apply plugin: 'com.jfrog.bintray' afterEvaluate { project -> task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } task javadoc(type: Javadoc) { failOnError false source = android.sourceSets.main.java.srcDirs options { charSet = 'UTF-8' links "http://docs.oracle.com/javase/7/docs/api/" linksOffline "http://d.android.com/reference", System.getenv("ANDROID_HOME") + "/docs/reference" } classpath += project.android.libraryVariants.toList().first().javaCompile.classpath classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } artifacts { archives javadocJar archives sourcesJar } } version = VERSION_NAME bintray { Properties properties = new Properties() def localPropertiesFile = project.rootProject.file('local.properties') def bintrayUser = "" def bintrayApiKey = "" def bintrayGPGPassword = "" if (!localPropertiesFile.exists()) { println "can't find ${localPropertiesFile.getAbsolutePath()} file to read bintray information." } else { properties.load(localPropertiesFile.newDataInputStream()) bintrayUser = properties.getProperty("bintray.user") bintrayApiKey = properties.getProperty("bintray.apikey") bintrayGPGPassword = properties.getProperty("bintray.gpg.password") } user = bintrayUser key = bintrayApiKey configurations = ['archives'] pkg { repo = "maven" name = ARTIFACT_NAME desc = ARTIFACT_DESCRIPTION websiteUrl = SITE_URL issueTrackerUrl = ISSUE_URL vcsUrl = SCM_URL licenses = ["Apache-2.0"] //TODO more sense store this array publish = true publicDownloadNumbers = true version { gpg { sign = true //Determines whether to GPG sign the files. The default is false passphrase = bintrayGPGPassword } } } }