-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload-properties.gradle
33 lines (26 loc) · 1.19 KB
/
load-properties.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
def keystoreLocal = "${System.properties['user.home']}/Android"
def keystoreCI = "/"
try {
keystoreCI = "${System.getenv('HOME')}/code"
} catch(Exception ignored) {}
if (file("${keystoreLocal}/keystore.jks").exists()) {
ext.storeFilePath = keystoreLocal
} else if (file("${keystoreCI}/keystore.jks").exists()) {
ext.storeFilePath = keystoreCI
}
File secureProperties = new File("${project.rootDir}/secure.properties")
if (secureProperties.exists()) {
Properties properties = new Properties()
properties.load(secureProperties.newDataInputStream())
ext.keyPassword = properties.getProperty("keyalias.password")
ext.storePassword = properties.getProperty("keystore.password")
ext.bintrayUser = properties.getProperty("bintray.user")
ext.bintrayApiKey = properties.getProperty("bintray.apikey")
ext.bintrayGpgPassword = properties.getProperty("bintray.gpg.password")
} else {
ext.keyPassword = System.getenv("KEYALIAS_PASSWORD")
ext.storePassword = System.getenv("KEYSTORE_PASSWORD")
ext.bintrayUser = System.getenv("BINTRAY_USER")
ext.bintrayApiKey = System.getenv("BINTRAY_APIKEY")
ext.bintrayGpgPassword = System.getenv("BINTRAY_GPG_PASSWORD")
}