Skip to content

Commit 91228eb

Browse files
Langston Smithlangsmith
authored andcommitted
initial additions
1 parent f8f56e4 commit 91228eb

16 files changed

Lines changed: 273 additions & 162 deletions

File tree

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
MBGL_ANDROID_PLUGINS += traffic;plugin-traffic
2-
MBGL_ANDROID_PLUGINS += locationlayer;plugin-locationlayer
32
MBGL_ANDROID_PLUGINS += building;plugin-building
43
MBGL_ANDROID_PLUGINS += offline;plugin-offline
54
MBGL_ANDROID_PLUGINS += places;plugin-places
5+
MBGL_ANDROID_PLUGINS += annotation;plugin-annotation
66
MBGL_ANDROID_PLUGINS += localization;plugin-localization
7+
MBGL_ANDROID_PLUGINS += markerview;plugin-markerview
8+
MBGL_ANDROID_PLUGINS += scalebar;plugin-scalebar
79

810
checkstyle:
911
./gradlew checkstyle
@@ -20,11 +22,14 @@ javadoc:
2022
./gradlew javadocrelease
2123

2224
publish:
23-
export IS_LOCAL_DEVELOPMENT=false; ./gradlew uploadArchives
25+
export IS_LOCAL_DEVELOPMENT=false; ./gradlew bintrayUpload
26+
27+
publish-snapshot:
28+
export IS_LOCAL_DEVELOPMENT=false; ./gradlew artifactoryPublish
2429

2530
publish-local:
2631
# This publishes to ~/.m2/repository/com/mapbox/mapboxsdk
27-
export IS_LOCAL_DEVELOPMENT=true; ./gradlew uploadArchives
32+
export IS_LOCAL_DEVELOPMENT=true; ./gradlew bintrayUpload
2833

2934
generate-sanity-test:
3035
npm install && node scripts/generate-activity-test.js
@@ -50,11 +55,14 @@ javadoc-$1:
5055
./gradlew :$2:javadocrelease
5156

5257
publish-$1:
53-
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :$2:uploadArchives
58+
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :$2: bintrayUpload
59+
60+
publish-snapshot-$1:
61+
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :$2: artifactoryPublish
5462

5563
publish-local-$1:
5664
# This publishes to ~/.m2/repository/com/mapbox/mapboxsdk
57-
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :$2:uploadArchives
65+
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :$2: bintrayUpload
5866

5967
endef
6068

build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,27 @@ buildscript {
44
repositories {
55
google()
66
jcenter()
7-
maven { url "https://maven.google.com" }
7+
maven { url "https://maven.google.com" }
8+
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
89
}
910

1011
dependencies {
1112
classpath pluginDependencies.gradle
1213
classpath pluginDependencies.kotlin
14+
15+
// These plugins are for publishing to Bintray
16+
classpath pluginDependencies.bintray
17+
classpath pluginDependencies.androidPublishPlugin
18+
classpath pluginDependencies.artifactory
1319
}
1420
}
1521

1622
allprojects {
1723
repositories {
1824
google()
1925
jcenter()
20-
// SNAPSHOT repository
21-
// maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
26+
// For publishing to Bintray
27+
maven { url 'https://mapbox.bintray.com/mapbox' }
2228
}
2329
}
2430

@@ -29,4 +35,4 @@ subprojects {
2935

3036
task clean(type: Delete) {
3137
delete rootProject.buildDir
32-
}
38+
}

circle.yml

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,74 @@ jobs:
9292
name: Init submodules
9393
command: git submodule update --init --recursive
9494
- run:
95-
name: Generate Maven credentials
95+
name: Generate Bintray credentials
9696
shell: /bin/bash -euo pipefail
9797
command: |
98-
if [ -n "${PUBLISH_NEXUS_USERNAME}" ]; then
99-
aws s3 cp s3://mapbox/android/signing-credentials/secring.gpg secring.gpg
100-
echo "NEXUS_USERNAME=$PUBLISH_NEXUS_USERNAME
101-
NEXUS_PASSWORD=$PUBLISH_NEXUS_PASSWORD
102-
signing.keyId=$SIGNING_KEYID
103-
signing.password=$SIGNING_PASSWORD
104-
signing.secretKeyRingFile=../secring.gpg" >> gradle.properties
98+
if [ -n "${BINTRAY_USER}" ]; then
99+
echo "BINTRAY_USER=$BINTRAY_USER
100+
BINTRAY_API_KEY=$BINTRAY_API_KEY
101+
GPG_PASSPHRASE=$GPG_PASSPHRASE"
105102
fi
106103
- run:
107104
name: Build Plugins SDK
108105
command: make build-release
109106
- deploy:
110-
name: Publish Plugins SDK To Maven Central
107+
name: Publish Plugins SDK to Bintray
111108
command: |
112-
if [ -n "${PUBLISH_NEXUS_USERNAME}" ]; then
113-
if [ "${CIRCLE_BRANCH}" == "master" ]; then
114-
make publish
109+
if [[ $CIRCLE_BRANCH == master ]] || [[ $CIRCLE_BRANCH == release-* ]] || [[ $CIRCLE_TAG == v*- ]]; then
110+
if [[ $version != *"SNAPSHOT"* ]]; then
111+
if [ "${CIRCLE_TAG}" == "v*-annotation" ]; then
112+
make publish-annotation
113+
fi
114+
if [ "${CIRCLE_TAG}" == "v*-localization" ]; then
115+
make publish-localization
116+
fi
117+
if [ "${CIRCLE_TAG}" == "v*-building" ]; then
118+
make publish-building
119+
fi
120+
if [ "${CIRCLE_TAG}" == "v*-markerview" ]; then
121+
make publish-markerview
122+
fi
123+
if [ "${CIRCLE_TAG}" == "v*-offline" ]; then
124+
make publish-offline
125+
fi
126+
if [ "${CIRCLE_TAG}" == "v*-places" ]; then
127+
make publish-places
128+
fi
129+
if [ "${CIRCLE_TAG}" == "v*-scalebar" ]; then
130+
make publish-scalebar
131+
fi
132+
if [ "${CIRCLE_TAG}" == "v*-traffic" ]; then
133+
make publish-traffic
134+
fi
135+
else
136+
if [ "${CIRCLE_TAG}" == "v*-annotation" ]; then
137+
make publish-snapshot-annotation
138+
fi
139+
if [ "${CIRCLE_TAG}" == "v*-localization" ]; then
140+
make publish-snapshot-localization
141+
fi
142+
if [ "${CIRCLE_TAG}" == "v*-building" ]; then
143+
make publish-snapshot-building
144+
fi
145+
if [ "${CIRCLE_TAG}" == "v*-markerview" ]; then
146+
make publish-snapshot-markerview
147+
fi
148+
if [ "${CIRCLE_TAG}" == "v*-offline" ]; then
149+
make publish-snapshot-offline
150+
fi
151+
if [ "${CIRCLE_TAG}" == "v*-places" ]; then
152+
make publish-snapshot-places
153+
fi
154+
if [ "${CIRCLE_TAG}" == "v*-scalebar" ]; then
155+
make publish-snapshot-scalebar
156+
fi
157+
if [ "${CIRCLE_TAG}" == "v*-traffic" ]; then
158+
make publish-snapshot-traffic
159+
fi
115160
fi
116161
fi
162+
117163
- store_artifacts:
118164
path: app/build/reports
119165
destination: reports

gradle/artifact-settings.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ext {
2+
mapboxArtifactGroupId = 'com.mapbox.mapboxsdk'
3+
mapboxArtifactId = project.hasProperty('POM_ARTIFACT_ID') ? project.property('POM_ARTIFACT_ID') : System.getenv('POM_ARTIFACT_ID')
4+
mapboxArtifactTitle = project.hasProperty('POM_NAME') ? project.property('POM_NAME') : System.getenv('POM_NAME')
5+
mapboxArtifactDescription = project.hasProperty('POM_DESCRIPTION') ? project.property('POM_DESCRIPTION') : System.getenv('POM_DESCRIPTION')
6+
mapboxDeveloperName = 'Mapbox'
7+
mapboxDeveloperId = 'mapbox'
8+
mapboxArtifactUrl = 'https://github.com/mapbox/mapbox-plugins-android'
9+
mapboxArtifactVcsUrl = 'https://github.com/mapbox/mapbox-plugins-android.git'
10+
mapboxArtifactScmUrl = 'scm:git@github.com:mapbox/mapbox-plugins-android.git'
11+
mapboxArtifactLicenseName = 'BSD 2-Clause'
12+
mapboxArtifactLicenseUrl = 'https://opensource.org/licenses/BSD-2-Clause'
13+
versionName = project.hasProperty('VERSION_NAME') ? project.property('VERSION_NAME') : System.getenv('VERSION_NAME')
14+
15+
mapboxBintrayUserOrg = 'mapbox'
16+
mapboxBintrayRepoName = 'mapbox'
17+
mapboxBintrayUser = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')
18+
mapboxBintrayApiKey = project.hasProperty('BINTRAY_API_KEY') ? project.property('BINTRAY_API_KEY') : System.getenv('BINTRAY_API_KEY')
19+
mapboxGpgPassphrase = project.hasProperty('GPG_PASSPHRASE') ? project.property('GPG_PASSPHRASE') : System.getenv('GPG_PASSPHRASE')
20+
}

gradle/dependencies.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
checkstyle: '8.10.1',
3333
gradle : '3.4.0',
3434
kotlin : '1.3.20',
35-
dokka : '0.9.17'
35+
dokka : '0.9.17',
36+
dependencyGraph: '0.4.0',
37+
bintray : '1.8.4',
38+
androidPublish : '3.6.2',
39+
artifactory: '4.9.3'
3640
]
3741

3842
dependenciesList = [
@@ -92,6 +96,9 @@
9296
gradle : "com.android.tools.build:gradle:${pluginVersion.gradle}",
9397
checkstyle: "com.puppycrawl.tools:checkstyle:${pluginVersion.checkstyle}",
9498
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${pluginVersion.kotlin}",
95-
dokka : "org.jetbrains.dokka:dokka-android-gradle-plugin:${pluginVersion.dokka}"
99+
dokka : "org.jetbrains.dokka:dokka-android-gradle-plugin:${pluginVersion.dokka}",
100+
bintray : "com.jfrog.bintray.gradle:gradle-bintray-plugin:${pluginVersion.bintray}",
101+
androidPublishPlugin : "digital.wup:android-maven-publish:${pluginVersion.androidPublish}",
102+
artifactory: "org.jfrog.buildinfo:build-info-extractor-gradle:${pluginVersion.artifactory}"
96103
]
97104
}

gradle/gradle-bintray.gradle

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
apply plugin: 'digital.wup.android-maven-publish'
2+
apply plugin: 'maven-publish'
3+
apply plugin: 'com.jfrog.bintray'
4+
apply plugin: 'com.jfrog.artifactory'
5+
apply from: file('../gradle/artifact-settings.gradle')
6+
7+
publishing {
8+
publications {
9+
MapboxPluginPublication(MavenPublication) {
10+
from components.android
11+
groupId project.ext.mapboxArtifactGroupId
12+
artifactId project.ext.mapboxArtifactId
13+
version project.ext.versionName
14+
15+
afterEvaluate {
16+
artifact("$buildDir/outputs/aar/${project.name}-release.aar")
17+
artifact(androidSourcesJar)
18+
artifact(androidJavadocsJar)
19+
}
20+
21+
pom.withXml {
22+
final mainNode = asNode()
23+
mainNode.appendNode('name', project.ext.mapboxArtifactTitle)
24+
mainNode.appendNode('description', project.ext.mapboxArtifactTitle)
25+
mainNode.appendNode('url', project.ext.mapboxArtifactUrl)
26+
27+
final licenseNode = mainNode.appendNode('licenses').appendNode('license')
28+
licenseNode.appendNode('name', project.ext.mapboxArtifactLicenseName)
29+
licenseNode.appendNode('url', project.ext.mapboxArtifactLicenseUrl)
30+
licenseNode.appendNode('distribution', "repo")
31+
32+
final developerNode = mainNode.appendNode('developers').appendNode('developer')
33+
developerNode.appendNode('id', project.ext.mapboxDeveloperId)
34+
developerNode.appendNode('name', project.ext.mapboxDeveloperName)
35+
36+
final scmNode = mainNode.appendNode("scm")
37+
scmNode.appendNode("connection", project.ext.mapboxArtifactScmUrl)
38+
scmNode.appendNode("developerConnection", project.ext.mapboxArtifactScmUrl)
39+
scmNode.appendNode("url", project.ext.mapboxArtifactUrl)
40+
}
41+
42+
}
43+
}
44+
}
45+
46+
bintray {
47+
user = mapboxBintrayUser
48+
key = mapboxBintrayApiKey
49+
publications = ['MapboxPluginPublication']
50+
pkg {
51+
repo = project.ext.mapboxBintrayRepoName
52+
name = project.ext.mapboxArtifactId
53+
userOrg = project.ext.mapboxBintrayUserOrg
54+
licenses = [project.ext.mapboxArtifactLicenseName]
55+
vcsUrl = project.ext.mapboxArtifactVcsUrl
56+
publish = false
57+
version {
58+
name = project.ext.versionName
59+
desc = project.ext.mapboxArtifactDescription
60+
released = new Date()
61+
gpg {
62+
sign = true
63+
passphrase = mapboxGpgPassphrase
64+
}
65+
mavenCentralSync {
66+
sync = false
67+
}
68+
}
69+
}
70+
}
71+
72+
artifactory {
73+
contextUrl = 'http://oss.jfrog.org'
74+
publish {
75+
repository {
76+
repoKey = 'oss-snapshot-local'
77+
username = mapboxBintrayUser
78+
password = mapboxBintrayApiKey
79+
}
80+
defaults {
81+
publications('MapboxPluginPublication')
82+
}
83+
}
84+
}
85+
86+
task androidSourcesJar(type: Jar) {
87+
classifier "sources"
88+
from android.sourceSets.main.java.srcDirs
89+
}
90+
91+
task androidJavadocs(type: Javadoc) {
92+
source = android.sourceSets.main.java.srcDirs
93+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
94+
android.libraryVariants.all { variant ->
95+
if (variant.name == 'release') {
96+
owner.classpath += variant.javaCompile.classpath
97+
}
98+
}
99+
100+
}
101+
102+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
103+
classifier = 'javadoc'
104+
from androidJavadocs.destinationDir
105+
}
106+
107+
tasks.withType(Javadoc) {
108+
options.addStringOption('encoding', 'UTF-8')
109+
options.addStringOption('docencoding', 'UTF-8')
110+
options.addStringOption('charset', 'UTF-8')
111+
}
112+
113+
artifacts {
114+
archives androidSourcesJar
115+
archives androidJavadocsJar
116+
}
117+
118+
afterEvaluate { project ->
119+
android.libraryVariants.all { variant ->
120+
tasks.androidJavadocs.doFirst {
121+
classpath += files(variant.javaCompile.classpath.files)
122+
}
123+
}
124+
}

0 commit comments

Comments
 (0)