Skip to content

Commit

Permalink
initial additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Langston Smith authored and langsmith committed Jul 2, 2019
1 parent 9d6f2dd commit 35c87c7
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 159 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ test:
release:
./gradlew :library:assembleRelease

publish:
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :library:uploadArchives
publish-stable:
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :library:bintrayUpload

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

publish-snapshot-to-artifactory:
# This publishes to ~/.m2/repository/com/mapbox/mapboxsdk
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :library:artifactoryPublish
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ buildscript {
repositories {
google()
jcenter()
// For publishing files to Bintray
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
}
dependencies {
classpath pluginDependencies.gradle

classpath pluginDependencies.bintrayPlugin
classpath pluginDependencies.androidPublishPlugin
classpath pluginDependencies.artifactory
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -18,18 +22,18 @@ allprojects {
repositories {
google()
jcenter()
maven { url 'https://mapbox.bintray.com/mapbox' }
}
}

subprojects { subproject ->
apply plugin: 'idea'

if (subproject.name == "library") {
apply from: "../gradle/mvn-push-android.gradle"
apply from: "../gradle/checkstyle.gradle"
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
}
24 changes: 14 additions & 10 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,27 @@ jobs:
steps:
- checkout
- run:
name: Generate Maven credentials
name: Generate Bintray 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 libraries
command: make release
- deploy:
name: Publish to Maven Central
name: Publish to Bintray
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
make publish ;
if [[ $CIRCLE_BRANCH == master ]] || [[ $CIRCLE_BRANCH == release-v* ]] || [[ $CIRCLE_TAG == v* ]]; then
version=$(cat library/gradle.properties | grep "VERSION_NAME")
if [[ $version != *"SNAPSHOT"* ]]; then
make publish-stable
else
make publish-snapshot-to-artifactory
fi
fi
- store_artifacts:
path: app/build/reports
Expand Down
20 changes: 20 additions & 0 deletions gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ext {
mapboxArtifactGroupId = 'com.mapbox.mapboxsdk'
mapboxArtifactId = 'mapbox-android-gestures'
mapboxArtifactTitle = 'Mapbox Android Gestures Library'
mapboxArtifactDescription = 'Mapbox Android Gestures Library'
mapboxDeveloperName = 'Mapbox'
mapboxDeveloperId = 'mapbox'
mapboxArtifactUrl = 'https://github.com/mapbox/mapbox-gestures-android'
mapboxArtifactVcsUrl = 'https://github.com/mapbox/mapbox-gestures-android.git'
mapboxArtifactScmUrl = 'scm:git@github.com/mapbox/mapbox-gestures-android.git'
mapboxArtifactLicenseName = 'BSD'
mapboxArtifactLicenseUrl = 'https://opensource.org/licenses/BSD-2-Clause'
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')
}
14 changes: 10 additions & 4 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ ext {
]

pluginVersion = [
checkstyle: '8.4',
gradle : '3.3.0'
checkstyle : '8.4',
gradle : '3.3.0',
bintray : '1.8.4',
androidPublish : '3.6.2',
artifactory : '4.9.3',
]

dependenciesList = [
Expand Down Expand Up @@ -47,7 +50,10 @@ ext {
]

pluginDependencies = [
gradle : "com.android.tools.build:gradle:${pluginVersion.gradle}",
checkstyle: "com.puppycrawl.tools:checkstyle:${pluginVersion.checkstyle}"
gradle : "com.android.tools.build:gradle:${pluginVersion.gradle}",
checkstyle : "com.puppycrawl.tools:checkstyle:${pluginVersion.checkstyle}",
bintrayPlugin : "com.jfrog.bintray.gradle:gradle-bintray-plugin:${pluginVersion.bintray}",
androidPublishPlugin : "digital.wup:android-maven-publish:${pluginVersion.androidPublish}",
artifactory : "org.jfrog.buildinfo:build-info-extractor-gradle:${pluginVersion.artifactory}"
]
}
91 changes: 91 additions & 0 deletions gradle/gradle-bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
apply plugin: 'digital.wup.android-maven-publish'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.jfrog.artifactory'
apply from: file('../gradle/artifact-settings.gradle')

publishing {
publications {
MapboxGesturesPublication(MavenPublication) {
from components.android
groupId project.ext.mapboxArtifactGroupId
artifactId project.ext.mapboxArtifactId
version project.ext.versionName

afterEvaluate {
artifact("$buildDir/outputs/aar/${project.name}-release.aar")
artifact(androidSourcesJar)
artifact(androidJavadocsJar)
}

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 = ['MapboxGesturesPublication']
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('MapboxGesturesPublication')
}
}
}


tasks.withType(Javadoc) {
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('docencoding', 'UTF-8')
options.addStringOption('charset', 'UTF-8')
}
19 changes: 19 additions & 0 deletions gradle/javadoc.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apply from: "${rootDir}/gradle/dependencies.gradle"

android.libraryVariants.all { variant ->
def name = variant.name
task "javadoc$name"(type: Javadoc) {
description = "Generates javadoc for build $name"
failOnError = false
destinationDir = new File(destinationDir, variant.baseName)
source = variant.sourceSets.collect { it.java.sourceFiles }.inject { m, i -> m + i }
classpath = files(android.bootClasspath)
options.windowTitle("$POM_NAME $VERSION_NAME Reference")
options.docTitle("$POM_NAME $VERSION_NAME")
options.header("$POM_NAME $VERSION_NAME Reference")
options.bottom("© 2015–2019 Mapbox. All rights reserved.")
options.links("http://docs.oracle.com/javase/7/docs/api/")
options.linksOffline("http://d.android.com/reference/", "$System.env.ANDROID_HOME/docs/reference")
exclude '**/R.java', '**/BuildConfig.java', '**/*.kt'
}
}
138 changes: 0 additions & 138 deletions gradle/mvn-push-android.gradle

This file was deleted.

Loading

0 comments on commit 35c87c7

Please sign in to comment.