Skip to content

Commit

Permalink
initial additions
Browse files Browse the repository at this point in the history
  • Loading branch information
langsmith authored and Langston Smith committed May 17, 2019
1 parent b6de95d commit e22fc0c
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 175 deletions.
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,24 @@ javadoc:
./gradlew :services:javadoc; mv services/build/docs/javadoc/ ./documentation/services/javadoc/ ; \

publish:
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-core:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-geojson:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-turf:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-core:bintrayUpload ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-geojson:bintrayUpload ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services:bintrayUpload ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-turf:bintrayUpload ; \

publish-snapshot:
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-core:artifactoryPublish ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-geojson:artifactoryPublish ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services:artifactoryPublish ; \
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-turf:artifactoryPublish ; \


publish-local:
# This publishes to ~/.m2/repository/com/mapbox/mapboxsdk
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-core:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-geojson:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-turf:uploadArchives ; \
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-core: bintrayUpload ; \
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-geojson: bintrayUpload ; \
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services: bintrayUpload ; \
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-turf: bintrayUpload ; \

graphs:
./gradlew :services-core:generateDependencyGraphMapboxLibraries
Expand Down
14 changes: 11 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ buildscript {

repositories {
maven { url 'https://plugins.gradle.org/m2' }
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
google()
mavenCentral()
jcenter()
Expand All @@ -17,6 +18,11 @@ buildscript {
classpath pluginDependencies.errorprone
classpath pluginDependencies.buildConfig
classpath pluginDependencies.jacoco

// These plugins are for publishing to Bintray
classpath pluginDependencies.bintray
classpath pluginDependencies.maven
classpath pluginDependencies.artifactory
}
}

Expand All @@ -31,9 +37,9 @@ allprojects {
google()
mavenCentral()
jcenter()
// For publishing to Bintray
maven { url 'https://mapbox.bintray.com/mapbox' }
}
group = GROUP
version = VERSION_NAME
}

subprojects {
Expand Down Expand Up @@ -97,7 +103,8 @@ subprojects { subproject ->
}

if (RELEASE_MODULES.contains(subproject.name)) {
subproject.apply from: "${rootDir}/gradle/mvn-push.gradle"
subproject.apply from: "${rootDir}/gradle/artifact-settings.gradle"
subproject.apply from: "${rootDir}/gradle/gradle-bintray.gradle"
subproject.apply from: "${rootDir}/gradle/dependencies-graph.gradle"
}
}
Expand All @@ -106,3 +113,4 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

apply plugin: "com.jfrog.artifactory"
12 changes: 5 additions & 7 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ jobs:
- checkout
- run:
name: Generate Maven credentials
shell: /bin/bash -euo pipefail
command: |
aws s3 cp s3://mapbox/android/signing-credentials/secring.gpg secring.gpg
echo "NEXUS_USERNAME=$PUBLISH_NEXUS_USERNAME
NEXUS_PASSWORD=$PUBLISH_NEXUS_PASSWORD
signing.keyId=$SIGNING_KEYID
signing.password=$SIGNING_PASSWORD
signing.secretKeyRingFile=../secring.gpg" >> gradle.properties
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- run:
name: Build Java libraries
command: make build-release
Expand Down
30 changes: 2 additions & 28 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
# Project-wide Gradle settings.
VERSION_NAME=4.9.0-SNAPSHOT
GROUP=com.mapbox.mapboxsdk

POM_URL=https://github.com/mapbox/mapbox-java
POM_SCM_URL=https://github.com/mapbox/mapbox-java
POM_SCM_CONNECTION=scm:[email protected]:mapbox/mapbox-java.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:mapbox/mapbox-java.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=mapbox
POM_DEVELOPER_NAME=Mapbox
VERSION_NAME=4.8.0-SNAPSHOT

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048M

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

# Publishing
#NEXUS_USERNAME=
#NEXUS_PASSWORD=
#signing.keyId=
#signing.password=
#signing.secretKeyRingFile=

org.gradle.jvmargs=-Xmx2048M
21 changes: 21 additions & 0 deletions gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ext {

mapboxArtifactGroupId = 'com.mapbox.mapboxsdk'
mapboxArtifactId = project.hasProperty('POM_ARTIFACT_ID') ? project.property('POM_ARTIFACT_ID') : System.getenv('POM_ARTIFACT_ID')
mapboxArtifactTitle = 'Mapbox Java SDK'
mapboxArtifactDescription = project.hasProperty('POM_DESCRIPTION') ? project.property('POM_DESCRIPTION') : System.getenv('POM_DESCRIPTION')
mapboxDeveloperName = 'Mapbox'
mapboxDeveloperId = 'mapbox'
mapboxArtifactUrl = 'https://github.com/mapbox/mapbox-java'
mapboxArtifactVcsUrl = 'https://github.com/mapbox/mapbox-java.git'
mapboxArtifactScmUrl = 'scm:[email protected]:mapbox/mapbox-java.git'
mapboxArtifactLicenseName = 'Apache-2.0'
mapboxArtifactLicenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
versionName = project.hasProperty('VERSION_NAME') ? project.property('VERSION_NAME') : System.getenv('VERSION_NAME')

mapboxBintrayUserOrg = 'mapbox'
mapboxBintrayRepoName = 'mapbox'
mapboxBintrayUser = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')
mapboxBintrayApiKey = project.hasProperty('BINTRAY_API_KEY') ? project.property('BINTRAY_API_KEY') : System.getenv('BINTRAY_API_KEY')
mapboxGpgPassphrase = project.hasProperty('GPG_PASSPHRASE') ? project.property('GPG_PASSPHRASE') : System.getenv('GPG_PASSPHRASE')
}
12 changes: 9 additions & 3 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ ext {
errorprone : '0.0.14',
spotbugs : '1.3',
buildConfig: '1.1.8',
dependencyGraph: '0.4.0'

dependencyGraph: '0.4.0',
bintray : '1.8.4',
maven : '3.6.2',
artifactory: '4.9.3',
]

dependenciesList = [
autoValue : "com.google.auto.value:auto-value:${version.autoValue}",
autoValueGson : "com.ryanharter.auto.value:auto-value-gson:${version.autoValueGson}",
Expand All @@ -45,6 +48,9 @@ ext {
errorprone : "net.ltgt.gradle:gradle-errorprone-plugin:${pluginVersion.errorprone}",
buildConfig: "gradle.plugin.de.fuerstenau:BuildConfigPlugin:${pluginVersion.buildConfig}",
dependencyGraph: "com.vanniktech:gradle-dependency-graph-generator-plugin:${pluginVersion.dependencyGraph}",
jacoco : "com.vanniktech:gradle-android-junit-jacoco-plugin:${pluginVersion.jacoco}"
jacoco : "com.vanniktech:gradle-android-junit-jacoco-plugin:${pluginVersion.jacoco}",
bintray : "com.jfrog.bintray.gradle:gradle-bintray-plugin:${pluginVersion.bintray}",
maven : "digital.wup:android-maven-publish:${pluginVersion.maven}",
artifactory: "org.jfrog.buildinfo:build-info-extractor-gradle:${pluginVersion.artifactory}",
]
}
92 changes: 92 additions & 0 deletions gradle/gradle-bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
apply plugin: 'digital.wup.android-maven-publish'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.jfrog.artifactory'
apply from: file('../gradle/artifact-settings.gradle')

publishing {
publications {
MapboxJavaSDKPublication(MavenPublication) {
from components.java
groupId project.ext.mapboxArtifactGroupId
artifactId
version project.ext.versionName

afterEvaluate {
artifact("$buildDir/outputs/aar/${project.ext.mapboxArtifactId}-release.aar")
artifact sourcesJar
artifact javadocJar
}

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)
}

}
}
}

bintray {
user = mapboxBintrayUser
key = mapboxBintrayApiKey
publications = ['MapboxJavaSDKPublication']
pkg {
repo = project.ext.mapboxBintrayRepoName
name = project.ext.mapboxArtifactId
userOrg = project.ext.mapboxBintrayUserOrg
licenses = [project.ext.mapboxArtifactLicenseName]
vcsUrl = project.ext.mapboxArtifactVcsUrl
publish = false
version {
name = project.ext.versionName
desc = project.ext.mapboxArtifactDescription
released = new Date()
gpg {
sign = true
passphrase = mapboxGpgPassphrase
}
mavenCentralSync {
sync = false
}
}
}
}

artifactory {
contextUrl = 'http://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-snapshot-local'
username = mapboxBintrayUser
password = mapboxBintrayApiKey
}
defaults {
publications('MapboxJavaSDKPublication')
}
}
}


tasks.withType(Javadoc) {
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('docencoding', 'UTF-8')
options.addStringOption('charset', 'UTF-8')
}
Loading

0 comments on commit e22fc0c

Please sign in to comment.