Permalink
Browse files

Gradle 4 and Android plugin 3, fix #1009

  • Loading branch information...
devemux86 committed Oct 27, 2017
1 parent cb2e9c4 commit db6b0573c4e9cbf99b0518dad0dca150da2c5bc2
View
@@ -7,8 +7,8 @@ android:
- tools
- platform-tools
- tools
- build-tools-26.0.2
- android-26
- build-tools-27.0.0
- android-27
env:
global:
- GRADLE_OPTS="-Xmx2048m"
View
@@ -1,10 +1,11 @@
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}
@@ -16,7 +17,7 @@ allprojects {
group = 'org.mapsforge'
version = 'master-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.androidBuildVersionTools = "26.0.2"
ext.androidBuildVersionTools = "27.0.0"
ext.jUnitVersion = "4.12"
if (JavaVersion.current().isJava8Compatible()) {
@@ -29,27 +30,27 @@ allprojects {
}
// no injection of functions, so via inheritance
def androidCompileSdk() { return 26 }
static def androidCompileSdk() { return 27 }
// Minimum API Level by Support Library
def androidMinSdk() { return 14 }
static def androidMinSdk() { return 14 }
// this is the last SDK with the old permissions system, so this should not change in the future
def androidTargetSdkOldPermissions() { return 22 }
static def androidTargetSdkOldPermissions() { return 22 }
// moving forward we will target the latest SDK (that will all have the new permissions system)
def androidTargetSdkRuntimePermissions() { return androidCompileSdk() }
static def androidTargetSdkRuntimePermissions() { return androidCompileSdk() }
def versionCode() { return 61 }
static def versionCode() { return 1 }
def versionName() { return version }
// Configuration injection for all subprojects
subprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}
tasks.withType(JavaCompile) {
@@ -73,11 +74,11 @@ configure(filterProjects(project.javalibraryprojects)) {
}
configure(filterProjects(project.javaprojects)) {
apply plugin: 'java'
apply plugin: 'java-library'
//apply plugin: 'checkstyle'
dependencies {
testCompile "junit:junit:$jUnitVersion"
testImplementation "junit:junit:$jUnitVersion"
}
/*checkstyle {
@@ -123,14 +124,12 @@ configure(filterProjects(project.androidlibraryprojects)) {
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals("debug")) {
print "Skipping debug jar"
return; // Skip debug builds.
}
if (name == "debug")
return
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
artifacts.add('archives', task);
artifacts.add('archives', task)
}
if (project.hasProperty("SONATYPE_USERNAME")) {
View
@@ -19,6 +19,7 @@
- POI: fix multiple POI categories [#940](https://github.com/mapsforge/mapsforge/issues/940)
- Feature parameters [#994](https://github.com/mapsforge/mapsforge/issues/994)
- Writers: Osmosis 0.46 with protobuf 3 [#1002](https://github.com/mapsforge/mapsforge/issues/1002)
- Gradle 4 / Android plugin 3 support [#1009](https://github.com/mapsforge/mapsforge/issues/1009)
- Internal render themes various improvements [#857](https://github.com/mapsforge/mapsforge/issues/857)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/mapsforge/issues?q=is%3Aclosed+milestone%3A0.9.0)
View
@@ -10,17 +10,17 @@ Current version is [![Maven Central](https://img.shields.io/maven-central/v/org.
#### Core
```groovy
compile 'org.mapsforge:mapsforge-core:[CURRENT-VERSION]'
compile 'org.mapsforge:mapsforge-map:[CURRENT-VERSION]'
compile 'org.mapsforge:mapsforge-map-reader:[CURRENT-VERSION]'
compile 'org.mapsforge:mapsforge-themes:[CURRENT-VERSION]'
compile 'net.sf.kxml:kxml2:2.3.0'
implementation 'org.mapsforge:mapsforge-core:[CURRENT-VERSION]'
implementation 'org.mapsforge:mapsforge-map:[CURRENT-VERSION]'
implementation 'org.mapsforge:mapsforge-map-reader:[CURRENT-VERSION]'
implementation 'org.mapsforge:mapsforge-themes:[CURRENT-VERSION]'
implementation 'net.sf.kxml:kxml2:2.3.0'
```
#### Android
```groovy
compile 'org.mapsforge:mapsforge-map-android:[CURRENT-VERSION]'
compile 'com.caverock:androidsvg:1.2.2-beta-1'
implementation 'org.mapsforge:mapsforge-map-android:[CURRENT-VERSION]'
implementation 'com.caverock:androidsvg:1.2.2-beta-1'
```
Optionally:
@@ -32,31 +32,31 @@ compile('org.mapsforge:mapsforge-map-android-extras:[CURRENT-VERSION]') {
#### Desktop
```groovy
compile 'org.mapsforge:mapsforge-map-awt:[CURRENT-VERSION]'
compile 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
implementation 'org.mapsforge:mapsforge-map-awt:[CURRENT-VERSION]'
implementation 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
```
### POI
#### Core
```groovy
compile 'org.mapsforge:mapsforge-core:[CURRENT-VERSION]'
compile 'org.mapsforge:mapsforge-poi:[CURRENT-VERSION]'
implementation 'org.mapsforge:mapsforge-core:[CURRENT-VERSION]'
implementation 'org.mapsforge:mapsforge-poi:[CURRENT-VERSION]'
```
#### Android
```groovy
compile 'org.mapsforge:mapsforge-poi-android:[CURRENT-VERSION]'
compile 'org.mapsforge:spatialite-android:[CURRENT-VERSION]'
compile 'org.mapsforge:spatialite-android:[CURRENT-VERSION]:natives-armeabi'
compile 'org.mapsforge:spatialite-android:[CURRENT-VERSION]:natives-armeabi-v7a'
compile 'org.mapsforge:spatialite-android:[CURRENT-VERSION]:natives-x86'
implementation 'org.mapsforge:mapsforge-poi-android:[CURRENT-VERSION]'
implementation 'org.mapsforge:spatialite-android:[CURRENT-VERSION]'
implementation 'org.mapsforge:spatialite-android:[CURRENT-VERSION]:natives-armeabi'
implementation 'org.mapsforge:spatialite-android:[CURRENT-VERSION]:natives-armeabi-v7a'
implementation 'org.mapsforge:spatialite-android:[CURRENT-VERSION]:natives-x86'
```
#### Desktop
```groovy
compile 'org.mapsforge:mapsforge-poi-awt:[CURRENT-VERSION]'
compile 'org.xerial:sqlite-jdbc:3.20.0'
implementation 'org.mapsforge:mapsforge-poi-awt:[CURRENT-VERSION]'
implementation 'org.xerial:sqlite-jdbc:3.20.0'
```
## Snapshots
@@ -72,7 +72,7 @@ repositories {
And declare the dependencies like:
```groovy
compile 'org.mapsforge:mapsforge-core:master-SNAPSHOT'
implementation 'org.mapsforge:mapsforge-core:master-SNAPSHOT'
...
```
@@ -1,6 +1,6 @@
#Fri Mar 03 10:37:04 EET 2017
#Thu Oct 26 11:57:58 EEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
@@ -1,4 +1,4 @@
dependencies {
compile project(":mapsforge-map-android")
provided 'com.android.support:support-v4:26.1.0'
api project(":mapsforge-map-android")
compileOnly 'com.android.support:support-v4:27.0.0'
}
@@ -1,18 +1,4 @@
dependencies {
compile project(":mapsforge-map-reader")
compile 'com.caverock:androidsvg:1.2.2-beta-1'
}
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals("debug")) {
print "Skipping debug jar"
return; // Skip debug builds.
}
def task = project.tasks.create "fatJar${name.capitalize()}", Jar
task.classifier = 'jar-with-dependencies'
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
artifacts.add('archives', task);
api project(":mapsforge-map-reader")
implementation 'com.caverock:androidsvg:1.2.2-beta-1'
}
@@ -1,16 +1,6 @@
dependencies {
compile project(":mapsforge-map-reader")
compile 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
testCompile project(":mapsforge-themes")
}
task fatJar(type: Jar, dependsOn: classes) {
classifier = 'jar-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.SF'
with jar
}
artifacts {
archives fatJar
api project(":mapsforge-map-reader")
implementation 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
testImplementation project(":mapsforge-themes")
testImplementation 'net.sf.kxml:kxml2:2.3.0'
}
@@ -1,3 +1,3 @@
dependencies {
compile project(":mapsforge-map")
api project(":mapsforge-map")
}
@@ -1,8 +1,8 @@
dependencies {
compile project(":mapsforge-core")
compile 'com.google.guava:guava:23.0'
compile 'com.vividsolutions:jts-core:1.14.0'
compile 'net.sf.trove4j:trove4j:3.0.3'
implementation project(":mapsforge-core")
implementation 'com.google.guava:guava:23.0'
implementation 'com.vividsolutions:jts-core:1.14.0'
implementation 'net.sf.trove4j:trove4j:3.0.3'
compileOnly 'org.openstreetmap.osmosis:osmosis-core:0.46'
}
@@ -19,7 +19,11 @@ jar {
task fatJar(type: Jar, dependsOn: classes) {
classifier = 'jar-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from {
(configurations.compileClasspath - configurations.compileOnly).collect {
it.isDirectory() ? it : zipTree(it)
}
}
with jar
}
View
@@ -1,7 +1,7 @@
dependencies {
compile project(":mapsforge-core")
compile 'net.sf.kxml:kxml2:2.3.0'
testCompile 'commons-io:commons-io:2.5'
testCompile 'org.mortbay.jetty:jetty:6.1.26'
testCompile 'org.slf4j:slf4j-log4j12:1.7.25'
api project(":mapsforge-core")
implementation 'net.sf.kxml:kxml2:2.3.0'
testImplementation 'commons-io:commons-io:2.5'
testImplementation 'org.mortbay.jetty:jetty:6.1.26'
testImplementation 'org.slf4j:slf4j-log4j12:1.7.25'
}
@@ -1,4 +1,4 @@
dependencies {
compile project(":mapsforge-poi")
compile project(":spatialite-android")
api project(":mapsforge-poi")
api project(":spatialite-android")
}
@@ -1,4 +1,4 @@
dependencies {
compile project(":mapsforge-poi")
compile 'org.xerial:sqlite-jdbc:3.20.0'
api project(":mapsforge-poi")
implementation 'org.xerial:sqlite-jdbc:3.20.0'
}
@@ -1,8 +1,8 @@
dependencies {
compile project(":mapsforge-poi")
compile 'com.google.guava:guava:23.0'
compile 'com.vividsolutions:jts-core:1.14.0'
compile 'org.xerial:sqlite-jdbc:3.20.0'
implementation project(":mapsforge-poi")
implementation 'com.google.guava:guava:23.0'
implementation 'com.vividsolutions:jts-core:1.14.0'
implementation 'org.xerial:sqlite-jdbc:3.20.0'
compileOnly 'org.openstreetmap.osmosis:osmosis-core:0.46'
}
@@ -16,7 +16,11 @@ jar {
task fatJar(type: Jar, dependsOn: classes) {
classifier = 'jar-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from {
(configurations.compileClasspath - configurations.compileOnly).collect {
it.isDirectory() ? it : zipTree(it)
}
}
with jar
}
@@ -1,3 +1,3 @@
dependencies {
compile project(":mapsforge-core")
api project(":mapsforge-core")
}
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'
dependencies {
compile project(":mapsforge-map-android-extras")
compile project(":mapsforge-themes")
compile project(":mapsforge-poi-android")
compile 'com.android.support:support-v4:26.1.0'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.3'
implementation project(":mapsforge-map-android-extras")
implementation project(":mapsforge-themes")
implementation project(":mapsforge-poi-android")
implementation 'com.android.support:support-v4:27.0.0'
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.3'
}
android {
@@ -1,18 +1,14 @@
dependencies {
compile project(":mapsforge-map-awt")
compile project(":mapsforge-themes")
implementation project(":mapsforge-map-awt")
implementation project(":mapsforge-themes")
}
task fatJar(type: Jar, dependsOn: classes) {
classifier = 'jar-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.SF'
manifest {
attributes 'Main-Class': 'org.mapsforge.samples.awt.Samples'
}
with jar
}
artifacts {
archives fatJar
}
@@ -1,3 +1,3 @@
dependencies {
compile project(":mapsforge-map")
api project(":mapsforge-map")
}
@@ -1,13 +1,11 @@
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals("debug")) {
print "Skipping debug jar"
return; // Skip debug builds.
}
if (name == "debug")
return
file('natives').eachDir() { dir ->
def task = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
task.classifier = "natives-${dir.name}"
task.from(dir.path)
artifacts.add('archives', task);
artifacts.add('archives', task)
}
}

0 comments on commit db6b057

Please sign in to comment.