Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
directly imported OSM branch of Mapbox Android SDK
- Loading branch information
Nicholas Hallahan
committed
Jan 13, 2015
1 parent
1c6a23e
commit bf929e9
Showing
154 changed files
with
21,782 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.gradle | ||
build/ | ||
*.iml | ||
|
||
src/main/.classpath | ||
src/main/.externalToolBuilders/ | ||
src/main/.project | ||
src/main/build.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.0.0' | ||
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.1' | ||
} | ||
} | ||
|
||
apply plugin: 'android-sdk-manager' | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'checkstyle' | ||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
allprojects { | ||
group project.GROUP | ||
version project.VERSION_NAME | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
// tasks.withType(Compile) { | ||
// options.encoding = 'UTF-8' | ||
// } | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'com.vividsolutions:jts:1.13' | ||
compile 'com.android.support:support-v4:21.0.2' | ||
compile 'com.squareup.okhttp:okhttp:2.0.0' | ||
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0' | ||
compile 'com.nineoldandroids:library:2.4.0' | ||
compile 'com.jakewharton:disklrucache:2.0.2' | ||
compile ('com.cocoahero.android:geojson:1.0.0@aar'){ | ||
transitive=true | ||
} | ||
} | ||
|
||
android { | ||
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) | ||
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION | ||
|
||
defaultConfig { | ||
minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK) | ||
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) | ||
} | ||
|
||
sourceSets { | ||
|
||
main { | ||
manifest.srcFile 'src/main/AndroidManifest.xml' | ||
|
||
java.srcDirs = ['src/main/java'] | ||
|
||
res.srcDirs = ['src/main/res'] | ||
|
||
assets { | ||
srcDir 'assets' | ||
} | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
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 = files(variant.javaCompile.source) | ||
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar" | ||
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar) | ||
options.links("http://docs.oracle.com/javase/7/docs/api/") | ||
options.links("http://d.android.com/reference/") | ||
exclude '**/R.html', '**/R.*.html' | ||
} | ||
} | ||
|
||
checkstyle { | ||
configFile project.file('../checks.xml') | ||
showViolations true | ||
} | ||
|
||
android.libraryVariants.all { variant -> | ||
def name = variant.buildType.name | ||
def checkstyle = project.tasks.create "checkstyle${name.capitalize()}", Checkstyle | ||
checkstyle.dependsOn variant.javaCompile | ||
checkstyle.source variant.javaCompile.source | ||
checkstyle.classpath = project.fileTree(variant.javaCompile.destinationDir) | ||
checkstyle.exclude('**/BuildConfig.java') | ||
checkstyle.exclude('**/R.java') | ||
checkstyle.exclude('**/uk/co/senab/bitmapcache/*') | ||
project.tasks.getByName("check").dependsOn checkstyle | ||
} | ||
|
||
// From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/jar.gradle | ||
android.libraryVariants.all { variant -> | ||
def jarTask = project.tasks.create(name: "jar${variant.name.capitalize()}", type: Jar) { | ||
from variant.javaCompile.destinationDir | ||
exclude "**/R.class" | ||
exclude "**/BuildConfig.class" | ||
} | ||
jarTask.dependsOn variant.javaCompile | ||
artifacts.add('archives', jarTask); | ||
} | ||
|
||
// From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/gradle-mvn-push.gradle | ||
def isReleaseBuild() { | ||
return VERSION_NAME.contains("SNAPSHOT") == false | ||
} | ||
|
||
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 getRepositoryUsername() { | ||
return hasProperty('USERNAME') ? USERNAME : | ||
(hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "") | ||
} | ||
|
||
def getRepositoryPassword() { | ||
return hasProperty('PASSWORD') ? PASSWORD : | ||
(hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "") | ||
} | ||
|
||
|
||
task apklib(type: Zip) { | ||
appendix = extension = 'apklib' | ||
|
||
from 'AndroidManifest.xml' | ||
into('res') { | ||
from 'res' | ||
} | ||
into('src') { | ||
from 'src' | ||
} | ||
} | ||
|
||
artifacts { | ||
archives apklib | ||
} | ||
|
||
afterEvaluate { project -> | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
pom.groupId = GROUP | ||
pom.artifactId = POM_ARTIFACT_ID | ||
pom.version = VERSION_NAME | ||
|
||
repository(url: getReleaseRepositoryUrl()) { | ||
authentication(userName: getRepositoryUsername(), | ||
password: getRepositoryPassword()) | ||
} | ||
snapshotRepository(url: getSnapshotRepositoryUrl()) { | ||
authentication(userName: getRepositoryUsername(), | ||
password: getRepositoryPassword()) | ||
} | ||
|
||
/* | ||
// Leaving out as artifact was incorrectly named when found | ||
addFilter('aar') { artifact, file -> | ||
artifact.name == archivesBaseName | ||
} | ||
addFilter('apklib') { artifact, file -> | ||
artifact.name == archivesBaseName + '-apklib' | ||
} | ||
*/ | ||
|
||
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 | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id POM_DEVELOPER_ID | ||
name POM_DEVELOPER_NAME | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
|
||
task androidJavadocs(type: Javadoc) { | ||
failOnError false | ||
source = android.sourceSets.main.java.sourceFiles | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
} | ||
|
||
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { | ||
classifier = 'javadoc' | ||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.sourceFiles | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
archives androidJavadocsJar | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
../gradlew -b build.gradle clean build uploadArchives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
GROUP=com.mapbox.mapboxsdk | ||
VERSION_NAME=0.6.0-SNAPSHOT | ||
|
||
POM_DESCRIPTION=Mapbox SDK | ||
POM_URL=https://github.com/mapbox/mapbox-android-sdk | ||
POM_SCM_URL=https://github.com/mapbox/mapbox-android-sdk | ||
POM_SCM_CONNECTION=scm:git:git@github.com:mapbox/mapbox-android-sdk.git | ||
POM_SCM_DEV_CONNECTION=scm:git:git@github.com:mapbox/mapbox-android-sdk.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 | ||
|
||
ANDROID_MIN_SDK=9 | ||
ANDROID_BUILD_TARGET_SDK_VERSION=21 | ||
ANDROID_BUILD_TOOLS_VERSION=21.0.2 | ||
ANDROID_BUILD_SDK_VERSION=21 | ||
|
||
POM_NAME=Mapbox SDK | ||
POM_ARTIFACT_ID=mapbox-android-sdk | ||
POM_PACKAGING=aar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.mapbox.mapboxsdk"> | ||
<application android:allowBackup="true"/> | ||
<uses-sdk android:minSdkVersion="9"/> | ||
</manifest> |
Oops, something went wrong.