11apply plugin : ' com.android.application'
22apply plugin : ' realm-android'
3+ apply plugin : " com.github.b3er.local.properties"
4+
5+ def KEYSTORE_FILE = rootProject. file(' scripts/key.jks' )
6+ def TRAVIS_BUILD = System . getenv(" TRAVIS" ) == " true" && KEYSTORE_FILE . exists()
7+ def LOCAL_KEY_PRESENT = project. hasProperty(' SIGNING_KEY_FILE' ) && rootProject. file(SIGNING_KEY_FILE ). exists()
38
49android {
510 compileSdkVersion rootProject. ext. compileSdkVersion
@@ -8,20 +13,43 @@ android {
813 applicationId " io.pslab"
914 minSdkVersion rootProject. ext. minSdkVersion
1015 targetSdkVersion rootProject. ext. targetSdkVersion
11- versionCode 17
12- versionName " 2.0.16 "
16+ versionCode 18
17+ versionName " 2.0.17 "
1318 multiDexEnabled true
1419 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
1520 }
21+
22+ signingConfigs {
23+ if (TRAVIS_BUILD ) {
24+ release {
25+ storeFile KEYSTORE_FILE
26+ storePassword System . getenv(" STORE_PASS" )
27+ keyAlias System . getenv(" ALIAS" )
28+ keyPassword System . getenv(" KEY_PASS" )
29+ }
30+ } else if (LOCAL_KEY_PRESENT ) {
31+ release {
32+ storeFile rootProject. file(SIGNING_KEY_FILE )
33+ storePassword STORE_PASS
34+ keyAlias ALIAS
35+ keyPassword KEY_PASS
36+ }
37+ }
38+ }
39+
1640 buildTypes {
1741 debug {
1842 versionNameSuffix " Version: "
1943 resValue " string" , " version" , " ${ versionNameSuffix}${ defaultConfig.versionName} "
44+ resValue " string" , " google_maps_key" , google_key
2045 }
2146 release {
2247 minifyEnabled false
2348 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
2449 resValue " string" , " version" , " ${ defaultConfig.versionName} "
50+ resValue " string" , " google_maps_key" , google_key
51+ if (LOCAL_KEY_PRESENT || TRAVIS_BUILD )
52+ signingConfig signingConfigs. release
2553 }
2654 }
2755 lintOptions {
@@ -31,6 +59,16 @@ android {
3159 sourceCompatibility JavaVersion . VERSION_1_8
3260 targetCompatibility JavaVersion . VERSION_1_8
3361 }
62+
63+ flavorDimensions ' default'
64+ productFlavors {
65+ fdroid {
66+ dimension = ' default'
67+ }
68+ playstore {
69+ dimension = ' default'
70+ }
71+ }
3472}
3573
3674dependencies {
@@ -73,9 +111,10 @@ dependencies {
73111 annotationProcessor " com.jakewharton:butterknife-compiler:$rootProject . butterKnifeVersion "
74112
75113 // Map libraries
76- implementation " org.osmdroid:osmdroid-android:$rootProject . osmVersion "
77- implementation " org.osmdroid:osmdroid-mapsforge:$rootProject . mapsforgeVersion "
78- implementation " org.osmdroid:osmdroid-geopackage:$rootProject . geoPackageVersion "
114+ fdroidImplementation " org.osmdroid:osmdroid-android:$rootProject . osmVersion "
115+ fdroidImplementation " org.osmdroid:osmdroid-mapsforge:$rootProject . mapsforgeVersion "
116+ fdroidImplementation " org.osmdroid:osmdroid-geopackage:$rootProject . geoPackageVersion "
117+ playstoreImplementation " com.google.android.gms:play-services-maps:$rootProject . googleMapsVersion "
79118
80119 implementation " com.android.support:multidex:$rootProject . multiDexVersion "
81120 implementation " io.realm:android-adapters:$rootProject . realmAdapter "
0 commit comments