Skip to content

Update config to enable Bintray uploads #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 107 additions & 27 deletions ParseLiveQuery/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ apply plugin: 'com.github.kt3k.coveralls'
group = 'com.parse'
version = '1.0.3-SNAPSHOT'

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()
Expand Down Expand Up @@ -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:[email protected]:parse-community/ParseLiveQuery-Android.git'
developerConnection 'scm:[email protected]: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) }
Expand All @@ -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:[email protected]:ParsePlatform/ParseLiveQuery-Android.git'
developerConnection 'scm:[email protected]: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
}
}

Expand Down Expand Up @@ -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 <dependency> 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
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ buildscript {
}
}

plugins {
id "com.jfrog.bintray" version "1.7.3"
}

allprojects {
repositories {
jcenter()
Expand Down