Skip to content
Permalink
Browse files

Bug/#1098 - Bump support lib to 26 (#1204)

* Bump support lib version to match compileSdk

24.2.0 deprecates support for API 8 and lower
26.0.0 raises minSDK to 14

So basically to be able to upgrade and comply with the playstore
rules minSDK MUST be raised to 14!

osmdroid-android doesn't have any dependencies to the support lib,
so we can leave the main minSDK at 8 and only set it to 14 for the
packages that do require support libraries (MapViewer, simple-map,
wms). This way the core lib will remain compatible down to API 8.
BUT this also means that running tests on AVDs below 14 will not be
possible and thus compatibility for API<14 will no longer be tested!

* Bump LeakCanary version to remove compiler warnings

* Manifest cleanup

values are overridden anyway by values set in build.gradle

* Mark license texts as non-translatable

to prevent lint warnings

* Fix travis build without signing config

In https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle
we have a hack to prevent builds from failing due to missing signing
config. This is done by removing the signing task from the build if
no keystore/pass is provided.

At some point the signing task has been renamed from
"validateReleaseSigning" to "validateSigningRelease", thus obviously
breaking the build again.

This simply adds a copy of the relevant code from
android-support.gradle adapted to the new name.

This should be cleaned up in the future!

* Update Robolectric to fix build error
  • Loading branch information...
cbalster authored and spyhunter99 committed Nov 24, 2018
1 parent 6735083 commit a1156f5b8a1b887ebdb7a5d81ce026ad63c866c1
@@ -18,7 +18,6 @@ android:
#

- android-26
- android-23
#- addon-google_apis-google-23

# Additional components - currently not required
@@ -50,7 +49,7 @@ env:
# so running API25 and up emulators is not possible right now.

matrix:
- API=10 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
#- API=10 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
#- API=10 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # currently no google apis needed
#- API=14 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default # emulator consistently times out
#- API=15 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default # https://github.com/osmdroid/osmdroid/issues/1066
@@ -3,10 +3,36 @@ description = 'OpenMap in the Play Store, the example app for using osmdroid'
apply plugin: 'com.android.application'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"

// Attention! HACK!
// In https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle
// we have a hack to prevent builds from failing due to missing signing config. This is done by
// removing the signing task from the build if no keystore/pass is provided.
//
// At some point the signing task has been renamed from "validateReleaseSigning" to
// "validateSigningRelease", thus obviously breaking the build again.
//
// The following is just a copy of the relevant code from android-support.gradle adapted to the new
// name. This should be cleaned up in the future!
afterEvaluate { project ->
tasks.each { task ->
if (isAndroidApplication) {
if ((task.name.toLowerCase().startsWith("assemble") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("bundle") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("package") && task.name.toLowerCase().contains('release'))
|| (task.name.equals("validateSigningRelease"))) {

task.setEnabled(canSign)
}
}
}
}

android {
defaultConfig {
applicationId 'org.osmdroid'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

minSdkVersion Integer.parseInt(project.property('android-minSdkForSupportLib.version'))
}
testOptions {
unitTests.all {
@@ -45,9 +71,9 @@ dependencies {
compile 'ch.acra:acra:4.7.0'

//memory leak testing
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4'

//on device testing
androidTestCompile 'com.android.support.test:runner:0.4.+'
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.osmdroid"
android:versionCode="20"
android:versionName="5.3-SNAPSHOT">
package="org.osmdroid">

<uses-sdk tools:overrideLibrary="mil.army.missioncommand,armyc2.c2sd.singlepointrenderer,org.osmdroid.gpkg,mil.nga.geopackage,org.osmdroid.mapsforge,android.support.v13,com.github.angads25.filepicker,android.support.v7.gridlayout"
android:minSdkVersion="8"
android:targetSdkVersion="23"/>
<uses-sdk tools:overrideLibrary="mil.army.missioncommand,armyc2.c2sd.singlepointrenderer,org.osmdroid.gpkg,mil.nga.geopackage,org.osmdroid.mapsforge,android.support.v13,com.github.angads25.filepicker,android.support.v7.gridlayout" />

<supports-screens
android:anyDensity="true"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="license_osmdroid">
<string name="license_osmdroid" translatable="false">
https://github.com/osmdroid/osmdroid\n
Apache License\n
Version 2.0, January 2004\n
@@ -205,7 +205,7 @@ https://github.com/osmdroid/osmdroid\n
limitations under the License.\n
</string>

<string name="license_geopackage">\n
<string name="license_geopackage" translatable="false">\n
https://github.com/ngageoint/geopackage-android\n
The MIT License (MIT)\n
\n
@@ -230,7 +230,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n
SOFTWARE.\n
</string>

<string name="license_mapsforge">\n
<string name="license_mapsforge" translatable="false">\n
GNU LESSER GENERAL PUBLIC LICENSE\n
Version 3, 29 June 2007\n
\n
@@ -398,7 +398,7 @@ permanent authorization for you to choose that version for the\n
Library.\n
</string>

<string name="license_acra">
<string name="license_acra" translatable="false">
https://github.com/ACRA/acra\n
\n
Apache License\n
@@ -604,7 +604,7 @@ https://github.com/ACRA/acra\n
limitations under the License.\n
</string>

<string name="license_leakcanary">
<string name="license_leakcanary" translatable="false">
https://github.com/square/leakcanary/blob/master/LICENSE.txt\n
\n
Apache License\n
@@ -810,7 +810,7 @@ https://github.com/ACRA/acra\n
limitations under the License.\n
</string>\n
\n
<string name="license_ormlite">
<string name="license_ormlite" translatable="false">
dependency of geopackage-android\n
ISC License\n
\n
@@ -826,7 +826,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.\n
The author may be contacted via http://ormlite.com/\n
</string>
\n
<string name="license_pngj">
<string name="license_pngj" translatable="false">
dependency of geopackage-android\n
https://github.com/leonbloy/pngj/\n
Apache License\n
@@ -5,6 +5,10 @@ buildscript {
jcenter()
mavenCentral()
mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath "com.android.tools.build:gradle:${project.property('android-plugin.version')}"
@@ -37,6 +41,10 @@ allprojects {
mavenLocal()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "http://repo.maven.apache.org/maven2" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}

tasks.withType(JavaCompile) {
@@ -40,10 +40,12 @@ org.gradle.jvmargs=-Xms256m -Xmx2048m -XX:MaxPermSize=256m
gradleFury.version=1.0.14


android-plugin.version=2.1.0
android-support.version=23.1.1
android-plugin.version=2.2.0
android-support.version=26.1.0
# To be used for packages that depend on support lib (minSDK = 14 since 26.0.0)
android-minSdkForSupportLib.version=14
junit.version=4.12
robolectric.version=3.0
robolectric.version=3.8


# Maven Repository (i.e. Sonatype Nexus Repository Manager) Configuration --------------------------
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.osmdroid.library"
android:versionCode="1" android:versionName="5.3-SNAPSHOT">

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="23" />
package="org.osmdroid.library">
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" />

<uses-feature android:name="android.hardware.location.network" android:required="false" />
@@ -3,6 +3,30 @@ description = 'Geopackage support for osmdroid'
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"

// Attention! HACK!
// In https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle
// we have a hack to prevent builds from failing due to missing signing config. This is done by
// removing the signing task from the build if no keystore/pass is provided.
//
// At some point the signing task has been renamed from "validateReleaseSigning" to
// "validateSigningRelease", thus obviously breaking the build again.
//
// The following is just a copy of the relevant code from android-support.gradle adapted to the new
// name. This should be cleaned up in the future!
afterEvaluate { project ->
tasks.each { task ->
if (isAndroidApplication) {
if ((task.name.toLowerCase().startsWith("assemble") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("bundle") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("package") && task.name.toLowerCase().contains('release'))
|| (task.name.equals("validateSigningRelease"))) {

task.setEnabled(canSign)
}
}
}
}

android {

defaultConfig {
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.osmdroid.gpkg" >
<manifest
package="org.osmdroid.gpkg">


</manifest>
@@ -1,6 +1,31 @@
description = "An Android library to display OpenStreetMap views using Mapsforge. May use non ASF licensed dependencies"
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"

// Attention! HACK!
// In https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle
// we have a hack to prevent builds from failing due to missing signing config. This is done by
// removing the signing task from the build if no keystore/pass is provided.
//
// At some point the signing task has been renamed from "validateReleaseSigning" to
// "validateSigningRelease", thus obviously breaking the build again.
//
// The following is just a copy of the relevant code from android-support.gradle adapted to the new
// name. This should be cleaned up in the future!
afterEvaluate { project ->
tasks.each { task ->
if (isAndroidApplication) {
if ((task.name.toLowerCase().startsWith("assemble") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("bundle") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("package") && task.name.toLowerCase().contains('release'))
|| (task.name.equals("validateSigningRelease"))) {

task.setEnabled(canSign)
}
}
}
}

android {

defaultConfig {
@@ -1,8 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest
package="org.osmdroid.mapsforge">

<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="23" />

</manifest>
@@ -3,10 +3,34 @@ description = 'Simple Map'
apply plugin: 'com.android.application'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"

// Attention! HACK!
// In https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle
// we have a hack to prevent builds from failing due to missing signing config. This is done by
// removing the signing task from the build if no keystore/pass is provided.
//
// At some point the signing task has been renamed from "validateReleaseSigning" to
// "validateSigningRelease", thus obviously breaking the build again.
//
// The following is just a copy of the relevant code from android-support.gradle adapted to the new
// name. This should be cleaned up in the future!
afterEvaluate { project ->
tasks.each { task ->
if (isAndroidApplication) {
if ((task.name.toLowerCase().startsWith("assemble") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("bundle") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("package") && task.name.toLowerCase().contains('release'))
|| (task.name.equals("validateSigningRelease"))) {

task.setEnabled(canSign)
}
}
}
}

android {
defaultConfig {
applicationId 'org.osmdroid.sample'

minSdkVersion Integer.parseInt(project.property('android-minSdkForSupportLib.version'))
}
}

@@ -2,19 +2,45 @@ description = 'OSMdroid Android WMS Client'
apply plugin: 'com.android.library'
apply from: "https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle"

android {
// Attention! HACK!
// In https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/android-support.gradle
// we have a hack to prevent builds from failing due to missing signing config. This is done by
// removing the signing task from the build if no keystore/pass is provided.
//
// At some point the signing task has been renamed from "validateReleaseSigning" to
// "validateSigningRelease", thus obviously breaking the build again.
//
// The following is just a copy of the relevant code from android-support.gradle adapted to the new
// name. This should be cleaned up in the future!
afterEvaluate { project ->
tasks.each { task ->
if (isAndroidApplication) {
if ((task.name.toLowerCase().startsWith("assemble") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("bundle") && task.name.toLowerCase().contains('release'))
|| (task.name.toLowerCase().startsWith("package") && task.name.toLowerCase().contains('release'))
|| (task.name.equals("validateSigningRelease"))) {

task.setEnabled(canSign)
}
}
}
}

android {
defaultConfig {
minSdkVersion Integer.parseInt(project.property('android-minSdkForSupportLib.version'))
}
}


dependencies {

compile project(':osmdroid-android')
compile 'com.android.support:appcompat-v7:23.1.1'
compile "com.android.support:appcompat-v7:${project.property('android-support.version')}"

testCompile "org.robolectric:robolectric:3.0"
testCompile "org.robolectric:robolectric:${project.property('robolectric.version')}"

testCompile 'junit:junit:4.12'
testCompile "junit:junit:${project.property('junit.version')}"



@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.osmdroid.wms" >
<manifest
package="org.osmdroid.wms">


</manifest>
@@ -4,7 +4,7 @@
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.io.File;
@@ -13,7 +13,7 @@
import java.net.HttpURLConnection;
import java.net.URL;

@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class
, sdk = 21)
public class ParserTest{

0 comments on commit a1156f5

Please sign in to comment.
You can’t perform that action at this time.