1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-24 09:13:04 +02:00

added try catch block in signing config to avoid loading error in travis

This commit is contained in:
oliexdev
2020-04-29 07:43:53 +02:00
parent a1440443f1
commit a1c2685a8f

View File

@@ -34,36 +34,56 @@ android {
release { release {
def keystorePropertiesFile = rootProject.file("../../openScale.keystore") def keystorePropertiesFile = rootProject.file("../../openScale.keystore")
def keystoreProperties = new Properties() def keystoreProperties = new Properties()
try {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
} catch (FileNotFoundException e) {
keystoreProperties = null;
}
if (keystoreProperties != null) {
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['releaseKeyStore']) storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['releaseKeyStore'])
keyAlias keystoreProperties['releaseKeyAlias'] keyAlias keystoreProperties['releaseKeyAlias']
keyPassword keystoreProperties['releaseKeyPassword'] keyPassword keystoreProperties['releaseKeyPassword']
storePassword keystoreProperties['releaseStorePassword'] storePassword keystoreProperties['releaseStorePassword']
} }
}
light { light {
def keystoreLightPropertiesFile = rootProject.file("../../openScale_light.keystore") def keystoreLightPropertiesFile = rootProject.file("../../openScale_light.keystore")
def keystoreLightProperties = new Properties() def keystoreLightProperties = new Properties()
try {
keystoreLightProperties.load(new FileInputStream(keystoreLightPropertiesFile)) keystoreLightProperties.load(new FileInputStream(keystoreLightPropertiesFile))
}
catch (FileNotFoundException e) {
keystoreLightProperties = null;
}
if (keystoreLightProperties != null) {
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreLightProperties['releaseKeyStore']) storeFile file(rootDir.getCanonicalPath() + '/' + keystoreLightProperties['releaseKeyStore'])
keyAlias keystoreLightProperties['releaseKeyAlias'] keyAlias keystoreLightProperties['releaseKeyAlias']
keyPassword keystoreLightProperties['releaseKeyPassword'] keyPassword keystoreLightProperties['releaseKeyPassword']
storePassword keystoreLightProperties['releaseStorePassword'] storePassword keystoreLightProperties['releaseStorePassword']
} }
}
pro { pro {
def keystoreProPropertiesFile = rootProject.file("../../openScale_pro.keystore") def keystoreProPropertiesFile = rootProject.file("../../openScale_pro.keystore")
def keystoreProProperties = new Properties() def keystoreProProperties = new Properties()
try {
keystoreProProperties.load(new FileInputStream(keystoreProPropertiesFile)) keystoreProProperties.load(new FileInputStream(keystoreProPropertiesFile))
}
catch (FileNotFoundException e) {
keystoreProProperties = null;
}
if (keystoreProProperties != null) {
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProProperties['releaseKeyStore']) storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProProperties['releaseKeyStore'])
keyAlias keystoreProProperties['releaseKeyAlias'] keyAlias keystoreProProperties['releaseKeyAlias']
keyPassword keystoreProProperties['releaseKeyPassword'] keyPassword keystoreProProperties['releaseKeyPassword']
storePassword keystoreProProperties['releaseStorePassword'] storePassword keystoreProProperties['releaseStorePassword']
} }
} }
}
buildTypes { buildTypes {
release { release {