Skip to content

Commit

Permalink
initial additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Langston Smith committed May 30, 2019
1 parent e811054 commit 0d1a547
Show file tree
Hide file tree
Showing 15 changed files with 228 additions and 155 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ javadoc:
./gradlew javadocrelease

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

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

generate-sanity-test:
npm install && node scripts/generate-activity-test.js
Expand Down
14 changes: 11 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ buildscript {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
}

dependencies {
classpath pluginDependencies.gradle
classpath pluginDependencies.kotlin

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

allprojects {
repositories {
google()
jcenter()
// SNAPSHOT repository
// maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
// For publishing to Bintray
maven { url 'https://mapbox.bintray.com/mapbox' }
}
}

Expand All @@ -29,4 +35,6 @@ subprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}

apply plugin: "com.jfrog.artifactory"
17 changes: 7 additions & 10 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,21 @@ jobs:
name: Init submodules
command: git submodule update --init --recursive
- run:
name: Generate Maven credentials
name: Generate Bintray credentials
shell: /bin/bash -euo pipefail
command: |
if [ -n "${PUBLISH_NEXUS_USERNAME}" ]; then
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 Plugins SDK
command: make build-release
- deploy:
name: Publish Plugins SDK To Maven Central
name: Publish Plugins SDK to Bintray
command: |
if [ -n "${PUBLISH_NEXUS_USERNAME}" ]; then
if [ -n "${BINTRAY_USER}" ]; then
if [ "${CIRCLE_BRANCH}" == "master" ]; then
make publish
fi
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 = project.hasProperty('POM_ARTIFACT_ID') ? project.property('POM_ARTIFACT_ID') : System.getenv('POM_ARTIFACT_ID')
mapboxArtifactTitle = project.hasProperty('POM_NAME') ? project.property('POM_NAME') : System.getenv('POM_NAME')
mapboxArtifactDescription = project.hasProperty('POM_DESCRIPTION') ? project.property('POM_DESCRIPTION') : System.getenv('POM_DESCRIPTION')
mapboxDeveloperName = 'Mapbox'
mapboxDeveloperId = 'mapbox'
mapboxArtifactUrl = 'https://github.com/mapbox/mapbox-plugins-android'
mapboxArtifactVcsUrl = 'https://github.com/mapbox/mapbox-plugins-android.git'
mapboxArtifactScmUrl = 'scm:[email protected]:mapbox/mapbox-plugins-android.git'
mapboxArtifactLicenseName = 'BSD 2-Clause'
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')
}
11 changes: 9 additions & 2 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
checkstyle: '8.10.1',
gradle : '3.4.0',
kotlin : '1.3.20',
dokka : '0.9.17'
dokka : '0.9.17',
dependencyGraph: '0.4.0',
bintray : '1.8.4',
androidPublish : '3.6.2',
artifactory: '4.9.3'
]

dependenciesList = [
Expand Down Expand Up @@ -92,6 +96,9 @@
gradle : "com.android.tools.build:gradle:${pluginVersion.gradle}",
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}"
dokka : "org.jetbrains.dokka:dokka-android-gradle-plugin:${pluginVersion.dokka}",
bintray : "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}"
]
}
156 changes: 156 additions & 0 deletions gradle/gradle-bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
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 {
MapboxPluginPublication(MavenPublication) {
from components.android
groupId project.ext.mapboxArtifactGroupId
artifactId project.ext.mapboxArtifactId
version project.ext.versionName

afterEvaluate {
artifact("$buildDir/outputs/aar/${project.ext.mapboxArtifactId}-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 = ['MapboxPluginPublication']
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('MapboxPluginPublication')
}
}
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.sourceFiles
classpath = files(android.bootClasspath)
failOnError = false
}

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

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

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

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}

afterEvaluate { project ->
android.libraryVariants.all { variant ->
tasks.androidJavadocs.doFirst {
classpath += files(variant.javaCompile.classpath.files)
}
}
}
/*
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'dokka'
from androidJavadocs.destinationDir
}
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
}
}
}
*/
Loading

0 comments on commit 0d1a547

Please sign in to comment.