diff --git a/ParseLiveQuery/build.gradle b/ParseLiveQuery/build.gradle index 965d585..6efd9b8 100644 --- a/ParseLiveQuery/build.gradle +++ b/ParseLiveQuery/build.gradle @@ -6,6 +6,13 @@ apply plugin: 'com.github.kt3k.coveralls' group = 'com.parse' version = '1.0.3' +ext { + projDescription = 'A library that gives you access to the powerful Parse cloud platform from your Android app.' + artifact = 'parse-livequery-android' + projName = 'Parse-LiveQuery-Android' + gitLink = 'https://github.com/parse-community/ParseLiveQuery-Android' +} + buildscript { repositories { jcenter() @@ -107,6 +114,29 @@ def isSnapshot = version.endsWith('-SNAPSHOT') def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME') def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD') +def pomConfig = { + scm { + connection 'scm:git@github.com:parse-community/ParseLiveQuery-Android.git' + developerConnection 'scm:git@github.com:parse-community/ParseLiveQuery-Android.git' + url gitLink + } + + licenses { + license { + name 'BSD License' + url 'https://github.com/parse-community/ParseLiveQuery-Android/blob/master/LICENSE' + distribution 'repo' + } + } + + developers { + developer { + id 'parse' + name 'Parse' + } + } +} + uploadArchives { repositories.mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } @@ -119,34 +149,15 @@ uploadArchives { authentication(userName: ossrhUsername, password: ossrhPassword) } - pom.project { - name 'Parse-LiveQuery-Android' - artifactId = 'parse-livequery-android' - packaging 'aar' - description 'A library that gives you access to the powerful Parse cloud platform from your Android app.' - url 'https://github.com/ParsePlatform/ParseLiveQuery-Android' - - scm { - connection 'scm:git@github.com:ParsePlatform/ParseLiveQuery-Android.git' - developerConnection 'scm:git@github.com:ParsePlatform/ParseLiveQuery-Android.git' - url 'https://github.com/ParsePlatform/ParseLiveQuery-Android' - } - - licenses { - license { - name 'BSD License' - url 'https://github.com/ParsePlatform/ParseLiveQuery-Android/blob/master/LICENSE' - distribution 'repo' - } - } - - developers { - developer { - id 'parse' - name 'Parse' - } - } + def basePom = { + name projName + artifactId artifact + packaging 'aar' + description projDescription + url gitLink } + + pom.project basePom << pomConfig } } @@ -207,3 +218,72 @@ task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") { coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacocoTestReport.xml" //endregion + +// Requires apply plugin: 'com.jfrog.bintray' + +apply plugin: 'com.jfrog.bintray' + +bintray { + user = System.getenv('BINTRAY_USER') + key = System.getenv('BINTRAY_API_KEY') + + publications = ["MyPublication"] + + publish = true + pkg { + repo = 'maven' + name = 'parse-livequery-android' + userOrg = 'parse' + licenses = ['BSD License'] + vcsUrl = gitLink + version { + name = project.version + desc = projDescription + released = new Date() + vcsTag = project.version + + // Sonatype username/passwrod must be set for this operation to happen + mavenCentralSync { + sync = true + user = ossrhUsername + password = ossrhPassword + close = '1' // release automatically + } + } + } +} + +// Create the publication with the pom configuration: +apply plugin: 'maven-publish' + +publishing { + publications { + MyPublication(MavenPublication) { + groupId group + artifactId artifact + artifacts = [androidSourcesJar, bundleRelease] + version version + pom.withXml { + def root = asNode() + root.appendNode('description', projDescription) + root.appendNode('name', projName) + root.appendNode('url', gitLink) + root.children().last() + pomConfig + + // maven-publish workaround to include dependencies + def dependenciesNode = asNode().appendNode('dependencies') + + //Iterate over the compile dependencies (we don't want the test ones), adding a node for each + configurations.compile.allDependencies.each { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', it.group) + dependencyNode.appendNode('artifactId', it.name) + dependencyNode.appendNode('version', it.version) + } + + } + } + } +} + +// End of Bintray plugin diff --git a/build.gradle b/build.gradle index df5cfc4..3c1b22c 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,10 @@ buildscript { } } +plugins { + id "com.jfrog.bintray" version "1.7.3" +} + allprojects { repositories { jcenter()