Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] tweaks to gradle-bintray file create signed files
Browse files Browse the repository at this point in the history
  • Loading branch information
langsmith committed Mar 6, 2019
1 parent e3a791e commit af8f2c6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
8 changes: 1 addition & 7 deletions platform/android/gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ ext {
mapboxLicenseName = 'BSD'
mapboxLicenseUrl = 'https://opensource.org/licenses/BSD-2-Clause'
mapboxArtifactInceptionYear = '2014'

// versionCode = project.hasProperty('versionCode') ? project.property('versionCode') : 0
versionCode = rootProject.hasProperty('versionCode') ? project.property('versionCode') : System.getenv('VERSION_CODE')

// versionName = project.hasProperty('versionName') ? project.property('versionName') : '0.0.0'
versionName = rootProject.hasProperty('versionName') ? project.property('versionName') : System.getenv('VERSION_NAME')
versionName = project.hasProperty('versionName') ? project.property('versionName') : System.getenv('VERSION_NAME')

mapboxBintrayUserOrg = 'mapbox'
mapboxBintrayRepoName = 'mapbox'
mapboxBintrayPackageName = 'mapbox-android-sdk'

// mapboxBintrayArtifactId is the same as mapboxArtifactGroup because of a weird bug
// https://github.com/bintray/gradle-bintray-plugin/issues/88
Expand Down
39 changes: 29 additions & 10 deletions platform/android/gradle/gradle-bintray.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply from: file('../gradle/artifact-settings.gradle')

Expand All @@ -25,7 +24,7 @@ install {
packaging 'aar'
groupId project.ext.mapboxArtifactGroupId
artifactId project.ext.mapboxArtifactId
version VERSION_NAME
version project.ext.versionName
println 'version = ' + version

scm {
Expand Down Expand Up @@ -54,20 +53,40 @@ publishing {
publications {
MapboxMapsSdkPublication(MavenPublication) {

artifact("$buildDir/outputs/aar/mapbox-android-sdk-release.aar")

// TODO: Uncomment these and use exisiting Gradle tasks in `gradle-publish.gradle` ?
// TODO: https://github.com/search?q=%22artifact%28sourcesJar%29+++++++++++++artifact%28javadocJar%29%22&type=Code
/*artifact(sourcesJar)
artifact(javadocJar)
*/
// For some reason, uncommented the following 3 declarations throws an error:
/*
groupId 'com.mapbox.mapboxsdk'
artifactId = 'mapbox-android-sdk'
version project.ext.versionName
*/

pom.withXml {
// 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)
def dependenciesNode = asNode().getAt('dependencies')[0] ?: asNode().appendNode('dependencies')

// Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included.
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}

bintray {

user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')

key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
Expand All @@ -87,13 +106,13 @@ bintray {
licenses = [project.ext.mapboxLicenseName]
vcsUrl = project.ext.mapboxArtifactVcsUrl
version {
name = VERSION_NAME
name = project.ext.versionName
desc = 'Mapbox Maps SDK for Android'
released = new Date()
println 'version released = ' + released

gpg {
sign = false
sign = true
passphrase = project.hasProperty('gpgPassphrase') ? project.property('gpgPassphrase') : System.getenv('GPG_PASSPHRASE')
}
mavenCentralSync {
Expand Down

0 comments on commit af8f2c6

Please sign in to comment.