Skip to content

Commit

Permalink
Fix broken Travis CI build
Browse files Browse the repository at this point in the history
Generate a fabric.properties for crashlytics if one doesn't exist
  • Loading branch information
codinguser committed Nov 5, 2015
1 parent ffdae9d commit 68ed270
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 68ed270

Please sign in to comment.