Browse Source

Fix gradle build when release keystore is missing

Arnaud Vergnet 4 years ago
parent
commit
8c5adfde79
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      android/app/build.gradle

+ 8
- 3
android/app/build.gradle View File

@@ -125,11 +125,16 @@ def jscFlavor = 'org.webkit:android-jsc:+'
125 125
 def enableHermes = project.ext.react.get("enableHermes", false);
126 126
 
127 127
 /**
128
- * Load release keystore
128
+ * Load release keystore using release properties file.
129
+ * If the file is not found, uses a dummy keystore file to prevent build from crashing
129 130
  */
130 131
 def keystorePropertiesFile = rootProject.file("keystores/release.keystore.properties");
131 132
 def keystoreProperties = new Properties()
132
-keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
133
+if (keystorePropertiesFile.exists() && !keystorePropertiesFile.isDirectory()) {
134
+    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
135
+} else {
136
+    keystoreProperties['UPLOAD_STORE_FILE'] = 'release.keystore';
137
+}
133 138
 
134 139
 android {
135 140
     compileSdkVersion rootProject.ext.compileSdkVersion
@@ -143,7 +148,7 @@ android {
143 148
         applicationId 'fr.amicaleinsat.application'
144 149
         minSdkVersion rootProject.ext.minSdkVersion
145 150
         targetSdkVersion rootProject.ext.targetSdkVersion
146
-        versionCode 39
151
+        versionCode 41
147 152
         versionName "4.0.1"
148 153
         missingDimensionStrategy 'react-native-camera', 'general'
149 154
     }

Loading…
Cancel
Save