diff --git a/app/build.gradle b/app/build.gradle index 1cd91f875..11902153d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -127,9 +127,26 @@ android { } } +/** + * Create the Crashlytics properties file when building on CI + * @return + */ +def initCrashlyticsPropertiesIfNeeded() { + def propertiesFile = file('fabric.properties') + if (!propertiesFile.exists()) { + def commentMessage = "This is autogenerated crashlytics property from system environment to prevent key to be committed to source control." + ant.propertyfile(file: "fabric.properties", comment: commentMessage) { //the keys added here are invalid, just placeholders to make builds pass + entry(key: "apiSecret", value: "bd4e83a9a4c35fbf1fbe8d9ccce9443eebb9d5835605f9d06767850e0f1e5b22") + entry(key: "apiKey", value: "46fe045d00d4ad8a71014c53567be3368e10bd64") + } + } +} + def adb = android.getAdbExe().toString() afterEvaluate { + initCrashlyticsPropertiesIfNeeded() + task grantAnimationPermissionDevel(type: Exec, dependsOn: 'installDevelopmentDebug') { // or install{productFlavour}{buildType} commandLine "$adb", 'devices' standardOutput = new ByteArrayOutputStream()