Skip to content
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
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ javadoc:
# Output is ./mapbox/*/build/docs/javadoc/release
./gradlew javadocrelease

# Uploads the compiled Android SDK to Mapbox SDK Registry
publish:
export IS_LOCAL_DEVELOPMENT=false; ./gradlew uploadArchives

publish-local:
# This publishes to ~/.m2/repository/com/mapbox/mapboxsdk
export IS_LOCAL_DEVELOPMENT=true; ./gradlew uploadArchives
./gradlew mapboxSDKRegistryUpload

generate-sanity-test:
npm install && node scripts/generate-activity-test.js
Expand All @@ -54,11 +51,7 @@ javadoc-$1:
./gradlew :$2:javadocrelease

publish-$1:
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :$2:uploadArchives

publish-local-$1:
# This publishes to ~/.m2/repository/com/mapbox/mapboxsdk
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :$2:uploadArchives
./gradlew :$2:mapboxSDKRegistryUpload

endef

Expand Down
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ buildscript {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://plugins.gradle.org/m2/" }
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
username "mapbox"
password = project.hasProperty('SDK_REGISTRY_TOKEN') ? project.property('SDK_REGISTRY_TOKEN') : System.getenv('SDK_REGISTRY_TOKEN')
}
}
}

dependencies {
classpath pluginDependencies.mapboxSdkRegistryPlugin
classpath pluginDependencies.androidPublish
classpath pluginDependencies.gradle
classpath pluginDependencies.kotlin
classpath pluginDependencies.kotlinLint
Expand Down Expand Up @@ -42,4 +54,4 @@ subprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
working_directory: ~/code
docker:
- image: mbgl/android-ndk-r19:8e91a7ebab
- image: mbgl/android-ndk-r21:769c31f1d8
environment:
JVM_OPTS: -Xmx3200m
BUILDTYPE: Debug
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
# ------------------------------------------------------------------------------
release:
docker:
- image: mbgl/android-ndk-r19:8e91a7ebab
- image: mbgl/android-ndk-r21:769c31f1d8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should use ndk-r21e?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's align with maps sdk v9

working_directory: ~/code
environment:
BUILDTYPE: Release
Expand Down
15 changes: 15 additions & 0 deletions gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ext {
mapboxArtifactGroupId = 'com.mapbox.mapboxsdk'
mapboxArtifactId = project.property('POM_ARTIFACT_ID')
mapboxArtifactTitle = project.property('POM_NAME')
mapboxArtifactDescription = project.property('POM_DESCRIPTION')
mapboxDeveloperName = 'Mapbox'
mapboxDeveloperId = 'mapbox'
mapboxArtifactUrl = 'https://github.com/mapbox/mapbox-plugins-android'
mapboxArtifactVcsUrl = 'git@github.com:mapbox/mapbox-plugins-android.git'
mapboxArtifactScmUrl = 'scm:git@github.com:mapbox/mapbox-plugins-android.git'
mapboxArtifactLicenseName = 'BSD'
mapboxArtifactLicenseUrl = 'https://opensource.org/licenses/BSD-2-Clause'
versionName = project.property('VERSION_NAME')
mapboxRegistrySdkName = project.hasProperty('REGISTRY_SDK_NAME') ? project.property('REGISTRY_SDK_NAME') : System.getenv('REGISTRY_SDK_NAME')
}
8 changes: 6 additions & 2 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
gradle : '3.4.0',
kotlin : '1.3.50',
dokka : '0.9.17',
kotlinLint: '8.1.0'
kotlinLint: '8.1.0',
mapboxSdkRegistryPlugin: '0.4.0',
pluginMavenPublish: "3.6.2"
]

dependenciesList = [
Expand Down Expand Up @@ -98,6 +100,8 @@
checkstyle: "com.puppycrawl.tools:checkstyle:${pluginVersion.checkstyle}",
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${pluginVersion.kotlin}",
dokka : "org.jetbrains.dokka:dokka-android-gradle-plugin:${pluginVersion.dokka}",
kotlinLint: "org.jlleitschuh.gradle:ktlint-gradle:${pluginVersion.kotlinLint}"
kotlinLint: "org.jlleitschuh.gradle:ktlint-gradle:${pluginVersion.kotlinLint}",
mapboxSdkRegistryPlugin: "com.mapbox.gradle.plugins:sdk-registry:${pluginVersion.mapboxSdkRegistryPlugin}",
androidPublish: "digital.wup:android-maven-publish:${pluginVersion.pluginMavenPublish}"
]
}
166 changes: 61 additions & 105 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,123 +1,79 @@
apply plugin: 'maven'
apply plugin: 'signing'

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

static def isLocalBuild() {
if (System.getenv('IS_LOCAL_DEVELOPMENT') != null) {
return System.getenv('IS_LOCAL_DEVELOPMENT').toBoolean()
}
return true
}

def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getSnapshotRepositoryUrl() {
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
}

def obtainMavenLocalUrl() {
return getRepositories().mavenLocal().getUrl()
}

def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

if (isLocalBuild()) {
repository(url: obtainMavenLocalUrl())
} else {
repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
}

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
apply plugin: 'digital.wup.android-maven-publish'
apply plugin: 'maven-publish'
apply plugin: 'com.mapbox.sdkRegistry'
apply from: file('../gradle/artifact-settings.gradle')

version = project.ext.versionName
group = project.ext.mapboxArtifactGroupId

publishing {
publications {
ModularMapboxMapsSdkRegistryPublication(MavenPublication) {
from components.android
groupId this.group
artifactId project.ext.mapboxArtifactId
version this.version
afterEvaluate {
artifact(androidSourcesJar)
artifact(androidJavadocsJar)
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
pom.withXml {
final mainNode = asNode()
mainNode.appendNode('name', project.ext.mapboxArtifactTitle)
mainNode.appendNode('description', project.ext.mapboxArtifactTitle)
mainNode.appendNode('url', project.ext.mapboxArtifactUrl)

final licenseNode = mainNode.appendNode('licenses').appendNode('license')
licenseNode.appendNode('name', project.ext.mapboxArtifactLicenseName)
licenseNode.appendNode('url', project.ext.mapboxArtifactLicenseUrl)
licenseNode.appendNode('distribution', "repo")

final developerNode = mainNode.appendNode('developers').appendNode('developer')
developerNode.appendNode('id', project.ext.mapboxDeveloperId)
developerNode.appendNode('name', project.ext.mapboxDeveloperName)

final scmNode = mainNode.appendNode("scm")
scmNode.appendNode("connection", project.ext.mapboxArtifactScmUrl)
scmNode.appendNode("developerConnection", project.ext.mapboxArtifactScmUrl)
scmNode.appendNode("url", project.ext.mapboxArtifactUrl)
}
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
registry {
sdkName = project.ext.mapboxRegistrySdkName
override = project.ext.versionName.endsWith("-SNAPSHOT")
dryRun = false
publish = true
snapshot = project.ext.versionName.endsWith("-SNAPSHOT")
publishMessage = "cc @mapbox/maps-android"
publications = ["ModularMapboxMapsSdkRegistryPublication"]
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.sourceFiles
classpath = files(android.bootClasspath)
failOnError = false
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'dokka'
from androidJavadocs.destinationDir
}
}

task androidSourcesJar(type: Jar) {
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
}

// See: https://github.com/chrisbanes/gradle-mvn-push/issues/43#issuecomment-84140513
afterEvaluate { project ->
android.libraryVariants.all { variant ->
tasks.androidJavadocs.doFirst {
classpath += files(variant.javaCompile.classpath.files)
classpath += configurations.javadocDeps
android.libraryVariants.all { variant ->
tasks.androidJavadocs.doFirst {
classpath += files(variant.javaCompile.classpath.files)
classpath += configurations.javadocDeps
}
}
}
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Apr 29 20:21:20 CEST 2019
#Mon Mar 22 20:37:29 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
2 changes: 1 addition & 1 deletion ktx-mapbox-maps/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ dependencies {

apply from: "${rootDir}/gradle/javadoc.gradle"
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
2 changes: 1 addition & 1 deletion ktx-mapbox-maps/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ VERSION_NAME=0.1.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-sdk-ktx-v7
POM_NAME=Mapbox Maps SDK for Android KTX
POM_DESCRIPTION=A set of Kotlin extensions for the Mapbox Maps SDK for Android.
POM_PACKAGING=aar
REGISTRY_SDK_NAME=mapbox-android-ktx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the correct name? looks different than the other names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we have never released this before. Please correct me if I'm wrong. @tobrun

2 changes: 1 addition & 1 deletion plugin-annotation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ dependencies {
apply from: "${rootDir}/gradle/javadoc.gradle"
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
apply from: "${rootDir}/gradle/nitpick.gradle"
apply from: "${rootDir}/gradle/nitpick.gradle"
2 changes: 1 addition & 1 deletion plugin-annotation/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ VERSION_NAME=0.10.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-plugin-annotation-v9
POM_NAME=Mapbox Android Annotation Plugin
POM_DESCRIPTION=Mapbox Android Annotation Plugin
POM_PACKAGING=aar
REGISTRY_SDK_NAME=com-mapbox-mapboxsdk-mapbox-android-plugin-annotation-v9
2 changes: 1 addition & 1 deletion plugin-building/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ VERSION_NAME=0.8.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-plugin-building-v9
POM_NAME=Mapbox Android Building Plugin
POM_DESCRIPTION=Mapbox Android Building Plugin
POM_PACKAGING=aar
REGISTRY_SDK_NAME=com-mapbox-mapboxsdk-mapbox-android-plugin-building-v9
2 changes: 1 addition & 1 deletion plugin-localization/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ dependencies {

apply from: "${rootDir}/gradle/javadoc.gradle"
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
2 changes: 1 addition & 1 deletion plugin-localization/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ VERSION_NAME=0.13.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-plugin-localization-v9
POM_NAME=Mapbox Android Localization Plugin
POM_DESCRIPTION=Mapbox Android Localization Plugin
POM_PACKAGING=aar
REGISTRY_SDK_NAME=com-mapbox-mapboxsdk-mapbox-android-plugin-localization-v9

2 changes: 1 addition & 1 deletion plugin-markerview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ dependencies {

apply from: "${rootDir}/gradle/javadoc.gradle"
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
2 changes: 1 addition & 1 deletion plugin-markerview/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ VERSION_NAME=0.5.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-plugin-markerview-v9
POM_NAME=Mapbox Android MarkerView Plugin
POM_DESCRIPTION=Mapbox Android MarkerView Plugin
POM_PACKAGING=aar
REGISTRY_SDK_NAME=com-mapbox-mapboxsdk-mapbox-android-plugin-markerview-v9
2 changes: 1 addition & 1 deletion plugin-offline/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ dependencies {

apply from: "${rootDir}/gradle/javadoc.gradle"
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
5 changes: 3 additions & 2 deletions plugin-offline/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
VERSION_NAME=0.8.0-SNAPSHOT
VERSION_NAME=0.9.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-plugin-offline-v9
POM_NAME=Mapbox Android Offline Plugin
POM_DESCRIPTION=Mapbox Android Offline Plugin
POM_PACKAGING=aar
REGISTRY_SDK_NAME=com-mapbox-mapboxsdk-mapbox-android-plugin-offline-v9

2 changes: 1 addition & 1 deletion plugin-places/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ dependencies {

apply from: "${rootDir}/gradle/javadoc.gradle"
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
apply from: "${rootDir}/gradle/checkstyle.gradle"
Loading