1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-24 17:23:03 +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,34 +34,54 @@ android {
release { release {
def keystorePropertiesFile = rootProject.file("../../openScale.keystore") def keystorePropertiesFile = rootProject.file("../../openScale.keystore")
def keystoreProperties = new Properties() def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) try {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
} catch (FileNotFoundException e) {
keystoreProperties = null;
}
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['releaseKeyStore']) if (keystoreProperties != null) {
keyAlias keystoreProperties['releaseKeyAlias'] storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['releaseKeyStore'])
keyPassword keystoreProperties['releaseKeyPassword'] keyAlias keystoreProperties['releaseKeyAlias']
storePassword keystoreProperties['releaseStorePassword'] keyPassword keystoreProperties['releaseKeyPassword']
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()
keystoreLightProperties.load(new FileInputStream(keystoreLightPropertiesFile)) try {
keystoreLightProperties.load(new FileInputStream(keystoreLightPropertiesFile))
}
catch (FileNotFoundException e) {
keystoreLightProperties = null;
}
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreLightProperties['releaseKeyStore']) if (keystoreLightProperties != null) {
keyAlias keystoreLightProperties['releaseKeyAlias'] storeFile file(rootDir.getCanonicalPath() + '/' + keystoreLightProperties['releaseKeyStore'])
keyPassword keystoreLightProperties['releaseKeyPassword'] keyAlias keystoreLightProperties['releaseKeyAlias']
storePassword keystoreLightProperties['releaseStorePassword'] keyPassword keystoreLightProperties['releaseKeyPassword']
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()
keystoreProProperties.load(new FileInputStream(keystoreProPropertiesFile)) try {
keystoreProProperties.load(new FileInputStream(keystoreProPropertiesFile))
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProProperties['releaseKeyStore']) }
keyAlias keystoreProProperties['releaseKeyAlias'] catch (FileNotFoundException e) {
keyPassword keystoreProProperties['releaseKeyPassword'] keystoreProProperties = null;
storePassword keystoreProProperties['releaseStorePassword'] }
if (keystoreProProperties != null) {
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProProperties['releaseKeyStore'])
keyAlias keystoreProProperties['releaseKeyAlias']
keyPassword keystoreProProperties['releaseKeyPassword']
storePassword keystoreProProperties['releaseStorePassword']
}
} }
} }