-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update config to enable Bintray uploads (#51)
Shared POM config between Bintray and Sonatype
- Loading branch information
Showing
2 changed files
with
111 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[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) } | ||
|
@@ -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 | ||
} | ||
} | ||
|
||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters