1
1
/*
2
- * Copyright (c) 2024 Balázs Püspök-Kiss (Illyan)
2
+ * Copyright (c) 2022- 2024 Balázs Püspök-Kiss (Illyan)
3
3
*
4
4
* Jay is a driver behaviour analytics app.
5
5
*
16
16
* If not, see <https://www.gnu.org/licenses/>.
17
17
*/
18
18
19
- import com.google.android.libraries.mapsplatform.secrets_gradle_plugin.loadPropertiesFile
20
-
21
- /*
22
- * Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
23
- *
24
- * Jay is a driver behaviour analytics app.
25
- *
26
- * This file is part of Jay.
27
- *
28
- * Jay is free software: you can redistribute it and/or modify it under the
29
- * terms of the GNU General Public License as published by the Free Software
30
- * Foundation, either version 3 of the License, or (at your option) any later version.
31
- * Jay is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
32
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR
33
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
34
- *
35
- * You should have received a copy of the GNU General Public License along with Jay.
36
- * If not, see <https://www.gnu.org/licenses/>.
37
- */
19
+ import org.jetbrains.kotlin.konan.properties.loadProperties
38
20
39
21
plugins {
40
22
alias(libs.plugins.android.application)
@@ -52,6 +34,8 @@ plugins {
52
34
alias(libs.plugins.compose.compiler)
53
35
}
54
36
37
+ val localProperties = loadProperties(" $projectDir /../local.properties" )
38
+
55
39
android {
56
40
compileSdk = 35
57
41
@@ -61,54 +45,30 @@ android {
61
45
applicationId = " illyan.jay"
62
46
minSdk = 23
63
47
targetSdk = 35
64
- versionCode = 18
65
- versionName = " 0.4.0 -alpha"
48
+ versionCode = 19
49
+ versionName = " 0.4.1 -alpha"
66
50
67
51
testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
68
52
vectorDrawables {
69
53
useSupportLibrary = true
70
54
}
71
55
}
72
56
73
- buildTypes {
74
- val mapboxAccessToken = properties[" MAPBOX_ACCESS_TOKEN" ].toString()
75
- val mapboxDownloadsToken = properties[" MAPBOX_DOWNLOADS_TOKEN" ].toString()
76
- val mapboxSdkRegistryToken = properties[" SDK_REGISTRY_TOKEN" ].toString()
77
- getByName(" debug" ) {
78
- isDebuggable = true
79
- buildConfigField(" String" , " MapboxAccessToken" , " \" $mapboxAccessToken \" " )
80
- buildConfigField(" String" , " MapboxDownloadsToken" , " \" $mapboxDownloadsToken \" " )
81
- buildConfigField(" String" , " MapboxSdkRegistryToken" , " \" $mapboxSdkRegistryToken \" " )
82
- }
83
- getByName(" release" ) {
84
- initWith(getByName(" debug" ))
85
- isDebuggable = false
86
- isMinifyEnabled = true
87
- isShrinkResources = true
88
- proguardFiles(
89
- getDefaultProguardFile(" proguard-android-optimize.txt" ),
90
- " proguard-rules.pro"
91
- )
92
- }
93
- }
94
-
95
57
signingConfigs {
96
- val properties = loadPropertiesFile(" ../local.properties" ).toMap()
97
-
98
- val debugStorePath = properties[" DEBUG_KEY_PATH" ].toString()
99
- val debugKeyAlias = properties[" DEBUG_KEY_ALIAS" ].toString()
100
- val debugStorePassword = properties[" DEBUG_KEYSTORE_PASSWORD" ].toString()
101
- val debugKeyPassword = properties[" DEBUG_KEY_PASSWORD" ].toString()
58
+ val debugStorePath = localProperties[" DEBUG_KEY_PATH" ].toString()
59
+ val debugKeyAlias = localProperties[" DEBUG_KEY_ALIAS" ].toString()
60
+ val debugStorePassword = localProperties[" DEBUG_KEYSTORE_PASSWORD" ].toString()
61
+ val debugKeyPassword = localProperties[" DEBUG_KEY_PASSWORD" ].toString()
102
62
getByName(" debug" ) {
103
63
storeFile = file(debugStorePath)
104
64
keyAlias = debugKeyAlias
105
65
storePassword = debugStorePassword
106
66
keyPassword = debugKeyPassword
107
67
}
108
- val releaseStorePath = properties [" RELEASE_KEY_PATH" ].toString()
109
- val releaseKeyAlias = properties [" RELEASE_KEY_ALIAS" ].toString()
110
- val releaseStorePassword = properties [" RELEASE_KEYSTORE_PASSWORD" ].toString()
111
- val releaseKeyPassword = properties [" RELEASE_KEY_PASSWORD" ].toString()
68
+ val releaseStorePath = localProperties [" RELEASE_KEY_PATH" ].toString()
69
+ val releaseKeyAlias = localProperties [" RELEASE_KEY_ALIAS" ].toString()
70
+ val releaseStorePassword = localProperties [" RELEASE_KEYSTORE_PASSWORD" ].toString()
71
+ val releaseKeyPassword = localProperties [" RELEASE_KEY_PASSWORD" ].toString()
112
72
create(" release" ) {
113
73
storeFile = file(releaseStorePath)
114
74
keyAlias = releaseKeyAlias
@@ -117,6 +77,32 @@ android {
117
77
}
118
78
}
119
79
80
+ buildTypes {
81
+ val mapboxAccessToken = localProperties[" MAPBOX_ACCESS_TOKEN" ].toString()
82
+ val mapboxDownloadsToken = localProperties[" MAPBOX_DOWNLOADS_TOKEN" ].toString()
83
+ val mapboxSdkRegistryToken = localProperties[" SDK_REGISTRY_TOKEN" ].toString()
84
+ val admobAppId = localProperties[" ADMOB_APPLICATION_ID" ].toString()
85
+ getByName(" debug" ) {
86
+ isDebuggable = true
87
+ buildConfigField(" String" , " MAPBOX_ACCESS_TOKEN" , " \" $mapboxAccessToken \" " )
88
+ buildConfigField(" String" , " MAPBOX_DOWNLOADS_TOKEN" , " \" $mapboxDownloadsToken \" " )
89
+ buildConfigField(" String" , " SDK_REGISTRY_TOKEN" , " \" $mapboxSdkRegistryToken \" " )
90
+ buildConfigField(" String" , " ADMOB_APPLICATION_ID" , " \" $admobAppId \" " )
91
+ }
92
+ getByName(" release" ) {
93
+ isDebuggable = false
94
+ isMinifyEnabled = true
95
+ isShrinkResources = true
96
+ buildConfigField(" String" , " MAPBOX_ACCESS_TOKEN" , " \" $mapboxAccessToken \" " )
97
+ buildConfigField(" String" , " ADMOB_APPLICATION_ID" , " \" $admobAppId \" " )
98
+ proguardFiles(
99
+ getDefaultProguardFile(" proguard-android-optimize.txt" ),
100
+ " proguard-rules.pro"
101
+ )
102
+ signingConfig = signingConfigs.getByName(" release" )
103
+ }
104
+ }
105
+
120
106
compileOptions {
121
107
sourceCompatibility = JavaVersion .VERSION_17
122
108
targetCompatibility = JavaVersion .VERSION_17
@@ -291,3 +277,22 @@ hilt {
291
277
room {
292
278
schemaDirectory(" $projectDir /schemas" )
293
279
}
280
+
281
+ secrets {
282
+ // Ignore everything, except ADMOB_APPLICATION_ID for AndroidManifest.xml
283
+ ignoreList.addAll(
284
+ listOf (
285
+ " RELEASE_KEYSTORE_PASSWORD*" ,
286
+ " RELEASE_KEY_PASSWORD*" ,
287
+ " RELEASE_KEY_ALIAS*" ,
288
+ " RELEASE_KEY_PATH*" ,
289
+ " DEBUG_KEYSTORE_PASSWORD*" ,
290
+ " DEBUG_KEY_PASSWORD*" ,
291
+ " DEBUG_KEY_ALIAS*" ,
292
+ " DEBUG_KEY_PATH*" ,
293
+ " MAPBOX_DOWNLOADS_TOKEN*" ,
294
+ " SDK_REGISTRY_TOKEN*" ,
295
+ " MAPBOX_ACCESS_TOKEN*"
296
+ )
297
+ )
298
+ }
0 commit comments