1
1
plugins {
2
2
id " com.diffplug.gradle.spotless" version " 3.23.1"
3
+ id " com.github.b3er.local.properties" version " 1.1"
3
4
}
4
5
5
6
def rootConfiguration = {}
@@ -15,6 +16,8 @@ def YOUTUBE_API_KEY = System.getenv('YOUTUBE_API_KEY') ?: "YOUR_API_KEY"
15
16
// noinspection SpellCheckingInspection
16
17
def MAPBOX_API_KEY = ' "' + System . getenv(' MAPBOX_API_KEY' )+ ' "' ?: ' "DEFAULT"'
17
18
19
+ def LOCAL_KEY_PRESENT = project. hasProperty(' SIGNING_KEY_FILE' ) && rootProject. file(SIGNING_KEY_FILE ). exists()
20
+
18
21
android {
19
22
compileSdkVersion rootConfiguration. compileSdkVersion
20
23
@@ -35,12 +38,34 @@ android {
35
38
sourceCompatibility JavaVersion . VERSION_1_8
36
39
targetCompatibility JavaVersion . VERSION_1_8
37
40
}
41
+
42
+ signingConfigs {
43
+ if (CIRCLE_BUILD ) {
44
+ release {
45
+ storeFile KEYSTORE_FILE
46
+ storePassword System . getenv(" STORE_PASS" )
47
+ keyAlias System . getenv(" ALIAS" )
48
+ keyPassword System . getenv(" KEY_PASS" )
49
+ }
50
+ } else if (LOCAL_KEY_PRESENT ) {
51
+ release {
52
+ storeFile rootProject. file(SIGNING_KEY_FILE )
53
+ storePassword STORE_PASS
54
+ keyAlias ALIAS
55
+ keyPassword KEY_PASS
56
+ }
57
+ }
58
+ }
59
+
38
60
buildTypes {
39
61
release {
40
62
minifyEnabled false
41
63
proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
42
64
buildConfigField " String" , " SPEAKER_BASE_URL" , ' "http://10.0.0.1:5000"'
43
65
buildConfigField " String" , " MAPBOX_API_KEY" , MAPBOX_API_KEY
66
+
67
+ if (LOCAL_KEY_PRESENT || CIRCLE_BUILD )
68
+ signingConfig signingConfigs. release
44
69
}
45
70
46
71
debug {
0 commit comments