-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.gradle
60 lines (54 loc) · 2.85 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias libs.plugins.android.application apply false
alias libs.plugins.android.library apply false
alias libs.plugins.kotlin.android apply false
alias libs.plugins.benManes.versions apply true
}
// load secrets.properties for properties that should be part of app but not in source control
// maybe shouldn't be done in-line but somewhere else.
def secretProperties = new Properties()
def secretPropertiesFile = file('secrets.properties')
if (!secretPropertiesFile.exists()) {
logger.error("App will not work as expected. Please copy-paste 'secrets.example.properties'" +
" to a new file called 'secrets.properties' and add API keys to it")
} else {
secretProperties.load(secretPropertiesFile.newReader())
}
ext {
// set keys from secretProperties
keys = [
google: [
/*
* must define Google Maps API Debug Key in gradle.properties by adding google_maps_api_debug=<KEY>
* must have a project in Google Console Developers and add the correct key: https://console.developers.google.com
* The SHA1 key from Android Studio's debug keystore. Find this in by the following in the command line:
* `keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android`
*/
maps: [
debug: "\"${System.getenv("GOOGLE_MAPS_API_DEBUG") ?: secretProperties['google_maps_api_debug']}\"" ?: '"Define Google Maps Debug API Key in secrets.properties#google_maps_api_debug"',
release: "\"${System.getenv("GOOGLE_MAPS_API_RELEASE") ?: secretProperties['google_maps_api_release']}\"" ?: '"Define Google Maps Release API Key in secrets.properties#google_maps_api_release"'
]
],
/*
* must define PAT_API_KEY in gradle.properties by adding pat_api=<KEY>
*/
truetime: [
debug: System.getenv("PAT_API_DEBUG") ?: secretProperties['pat_api_debug'] ?: 'Define Port Authority TrueTime API Key in secrets.properties#pat_api_debug',
release: System.getenv("PAT_API_RELEASE") ?: secretProperties['pat_api'] ?: 'Define Port Authority TrueTime API Key in secrets.properties#pat_api'
]
]
// versions not defined in gradle/libs.versions.toml
versions = [
java: [
languageVersion: JavaLanguageVersion.of(8),
target: JavaVersion.VERSION_1_8,
version: "1.8",
],
android: [
buildTools: '33.0.2',
minSdk: 21,
targetSdk: 33
],
]
}