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

Commit

Permalink
[android] initial additions for bintray plugin setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Langston Smith authored and langsmith committed Feb 28, 2019
1 parent ceec74f commit bd9d501
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,11 @@ run-android-upload-archives: platform/android/gradle/configuration.gradle
run-android-upload-archives-local: platform/android/gradle/configuration.gradle
cd platform/android && export IS_LOCAL_DEVELOPMENT=true && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all :MapboxGLAndroidSDK:uploadArchives

# Uploads the compiled Android SDK to Bintray
.PHONY: run-android-upload-to-bintray
run-android-upload-to-bintray: platform/android/gradle/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all :MapboxGLAndroidSDK:bintrayUpload

# Dump system graphics information for the test app
.PHONY: android-gfxinfo
android-gfxinfo:
Expand Down
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,10 @@ jobs:
name: Record size
command: platform/android/scripts/metrics.sh
- deploy:
name: Publish to Maven
name: Publish to Bintray
command: |
if [[ $CIRCLE_BRANCH == master ]] || [[ $CIRCLE_BRANCH == release-* ]] || [[ $CIRCLE_TAG == android-v* ]]; then
make run-android-upload-archives
make run-android-upload-to-bintray
fi
# ------------------------------------------------------------------------------
android-debug-arm-v7-buck:
Expand Down
2 changes: 1 addition & 1 deletion platform/android/DISTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Distributing Mapbox GL Native for Android

Depending on your use case, you may want to support all or just a subset of [Android ABIs](http://developer.android.com/ndk/guides/abis.html). This document covers building an `.aar` file from the Mapbox Android SDK and building `.so` files for specific ABIs. In normal circumstances an application developer will use [APK splits](https://developer.android.com/studio/build/configure-apk-splits.html) to optimize this at application level.
Depending on your use case, you may want to support all or just a subset of [Android ABIs](http://developer.android.com/ndk/guides/abis.html). This document covers building an `.aar` file from the Mapbox Maps SDK for Android and building `.so` files for specific ABIs. In normal circumstances an application developer will use [APK splits](https://developer.android.com/studio/build/configure-apk-splits.html) to optimize this at application level.

##### Build types

Expand Down
5 changes: 4 additions & 1 deletion platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apply plugin: 'com.android.library'
apply plugin: "com.jaredsburrows.license"
apply plugin: 'kotlin-android'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

dependencies {
lintChecks project(":MapboxGLAndroidSDKLint")
Expand Down Expand Up @@ -169,4 +171,5 @@ apply from: "${rootDir}/gradle/gradle-publish.gradle"
apply from: "${rootDir}/gradle/gradle-checkstyle.gradle"
apply from: "${rootDir}/gradle/gradle-dependencies-graph.gradle"
apply from: "${rootDir}/gradle/gradle-update-vendor-modules.gradle"
apply from: "${rootDir}/gradle/android-nitpick.gradle"
apply from: "${rootDir}/gradle/android-nitpick.gradle"
apply from: "${rootDir}/gradle/gradle-bintray.gradle"
5 changes: 4 additions & 1 deletion platform/android/MapboxGLAndroidSDK/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
GROUP=com.mapbox.mapboxsdk
VERSION_NAME=7.3.0-SNAPSHOT

POM_DESCRIPTION=Mapbox GL Android SDK
POM_DESCRIPTION=Mapbox Maps SDK for Android
POM_URL=https://github.com/mapbox/mapbox-gl-native
POM_SCM_URL=https://github.com/mapbox/mapbox-gl-native
POM_SCM_CONNECTION=scm:git@github.com:mapbox/mapbox-gl-native.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:mapbox/mapbox-gl-native.git
POM_VCS_URL=https://github.com/mapbox/mapbox-gl-native.git
POM_LICENCE_NAME=The 2-Clause BSD License
POM_LICENCE_URL=https://opensource.org/licenses/BSD-2-Clause
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=mapbox
POM_DEVELOPER_NAME=Mapbox
POM_DEVELOPER_GROUP_ID=com.mapbox.mapboxsdk
POM_NAME=Mapbox Maps SDK for Android
POM_ARTIFACT_ID=mapbox-android-sdk
POM_PACKAGING=aar
TRACKER_URL=https://github.com/mapbox/mapbox-gl-native/issues

# Only build native dependencies for the current ABI
# See https://code.google.com/p/android/issues/detail?id=221098#c20
Expand Down
3 changes: 3 additions & 0 deletions platform/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath dependenciesList.licensesPlugin
classpath dependenciesList.kotlinPlugin
classpath dependenciesList.bintrayPlugin
}
}

Expand All @@ -17,6 +18,8 @@ allprojects {
mavenCentral()
google()
jcenter()
// For publishing Maps SDK files to Bintray
maven { url 'https://mapbox.bintray.com/mapbox' }
// Snapshot repository
//maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
Expand Down
22 changes: 22 additions & 0 deletions platform/android/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ext {
okhttp : '3.12.0',
kotlin : '1.3.11',
licenses : '0.8.42',
bintray : '1.7.3',
lint : '26.1.4',
gms : '16.0.0',
reLinker : '1.3.1'
Expand Down Expand Up @@ -66,10 +67,31 @@ ext {
kotlinLib : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}",
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
licensesPlugin : "com.jaredsburrows:gradle-license-plugin:${versions.licenses}",
bintrayPlugin : "com.jfrog.bintray.gradle:gradle-bintray-plugin:${versions.bintray}",

lint : "com.android.tools.lint:lint:${versions.lint}",
lintApi : "com.android.tools.lint:lint-api:${versions.lint}",
lintChecks : "com.android.tools.lint:lint-checks:${versions.lint}",
lintTests : "com.android.tools.lint:lint-tests:${versions.lint}"
]

mapboxArtifactDeveloperName = 'Mapbox'
mapboxArtifactGroup = 'com.mapbox.mapboxsdk'
mapboxArtifactUrl = 'https://github.com/mapbox/mapbox-gl-native'
mapboxArtifactVcsUrl = 'https://github.com/mapbox/mapbox-gl-native.git'
mapboxArtifactTrackerUrl = 'https://github.com/mapbox/mapbox-gl-native/issues'
mapboxArtifactGitUrl = 'https://github.com/mapbox/mapbox-gl-native'
mapboxLicenseName = 'The 2-Clause BSD License'
mapboxLicenseUrl = 'https://opensource.org/licenses/BSD-2-Clause'

// Set by individual Gradle files

versionCode = project.hasProperty('versionCode') ? project.property('versionCode') : 0
versionName = project.hasProperty('versionName') ? project.property('versionName') : '0.0.0'

mapboxBintrayUserOrg = 'mapbox'
mapboxBintrayRepoName = 'mapbox'
mapboxBintrayPackageName = 'mapbox-android-sdk'
mapboxArtifactTitle = 'Mapbox Maps SDK for Android'
mapboxBintrayDescription = 'Mapbox Maps SDK for Android'
}
51 changes: 51 additions & 0 deletions platform/android/gradle/gradle-bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apply plugin: 'com.jfrog.bintray'

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
publications = ['MapboxMapsSdkPublication']
dryRun = false // Whether to run this as dry-run, without deploying
publish = false // Whether version should be auto published after an upload
override = false // Whether to override version artifacts already published
pkg {
userOrg = rootProject.ext.mapboxBintrayUserOrg
repo = rootProject.ext.mapboxBintrayRepoName
name = rootProject.ext.mapboxBintrayPackageName
desc = rootProject.ext.mapboxBintrayDescription

websiteUrl = rootProject.ext.mapboxArtifactUrl
issueTrackerUrl = rootProject.ext.mapboxArtifactTrackerUrl
vcsUrl = rootProject.ext.mapboxArtifactVcsUrl

licenses = [rootProject.ext.mapboxLicenseName]

version {
name = rootProject.ext.versionName
desc = rootProject.ext.mapboxBintrayDescription
released = new Date()
mavenCentralSync {
sync = false
}
}
}
}

publishing {
publications {
MapboxMapsSdkPublication(MavenPublication) {
pom.withXml {
def dependenciesNode = asNode().getAt('dependencies')[0] ?: asNode().appendNode('dependencies')
// Iterate over the compile 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)
}
}
}
}
}
}

0 comments on commit bd9d501

Please sign in to comment.