From 0283e49c277340cfcbb1c6b08186766af1cc803c Mon Sep 17 00:00:00 2001 From: Amine Date: Mon, 29 May 2017 19:54:35 +0200 Subject: [PATCH] Testing circle ci. --- app/build.gradle | 18 ++++++++++++++---- circle.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 circle.yml diff --git a/app/build.gradle b/app/build.gradle index 4303422..628b13e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -115,10 +115,20 @@ dependencies { } +apply plugin: 'com.google.gms.google-services' +afterEvaluate { + initFabricPropertiesIfNeeded() +} - - - -apply plugin: 'com.google.gms.google-services' \ No newline at end of file +def initFabricPropertiesIfNeeded() { + def propertiesFile = file('fabric.properties') + if (!propertiesFile.exists()) { + def commentMessage = "This is autogenerated fabric property from system environment to prevent key to be committed to source control." + ant.propertyfile(file: "fabric.properties", comment: commentMessage) { + entry(key: "apiSecret", value: crashlyticsdemoApisecret) + entry(key: "apiKey", value: crashlyticsdemoApikey) + } + } +} \ No newline at end of file diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..91405e9 --- /dev/null +++ b/circle.yml @@ -0,0 +1,43 @@ +machine: + timezone: Europe/Paris + java: + version: 'oraclejdk8' + environment: + ANDROID_HOME: /usr/local/android-sdk-linux + PATH: ANDROID_HOME:$ANDROID_HOME/platform-tools:$ANDROID_BUUILD:$ANDROID_HOME/tools:$PATH + _JAVA_OPTIONS: "-Xms512m -Xmx1024m" + GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"' + +dependencies: + pre: + - touch app/google-services.json + - echo $GOOGLE_SERVICES_JSON > app/google-services.json + - touch app/src/main/res/values/secrets.xml + - echo $SECRETS_XML > app/src/main/res/values/secrets.xml + - mkdir app/src/main/res/mipmap-hdpi + - convert -size 72x72 xc:white app/src/main/res/mipmap-hdpi/ic_launcher.png + - mkdir app/src/main/res/mipmap-mdpi + - convert -size 48x48 xc:white app/src/main/res/mipmap-mdpi/ic_launcher.png + - mkdir app/src/main/res/mipmap-xhdpi + - convert -size 96x96 xc:white app/src/main/res/mipmap-xhdpi/ic_launcher.png + - mkdir app/src/main/res/mipmap-xxhdpi + - convert -size 192x192 xc:white app/src/main/res/mipmap-xxhdpi/ic_launcher.png + - mkdir app/src/main/res/mipmap-xxxhdpi + - convert -size 512x512 xc:white app/src/main/res/mipmap-xxxhdpi/ic_launcher.png + + cache_directories: + - ~/.gradle + - ~/.android + + override: + - echo y | android update sdk --no-ui --filter "android-25,build-tools-25.0.3" + - echo y | android update sdk --no-ui --all --filter "platform-tools, tools" + - echo y | android update sdk --no-ui --all --filter "android-25, build-tools-25.0.3" + - echo y | android update sdk --no-ui --all --filter "extra-android-m2repository" + - echo y | android update sdk --no-ui --all --filter "extra-android-support" + - echo y | android update sdk --no-ui --all --filter "extra-google-m2repository" + - echo y | android update sdk --no-ui --all --filter "extra-google-google_play_services" + +test: + override: + - gradlew assemble -P crashlyticsdemoApikey=$FABRIC_API_KEY -P crashlyticsdemoApisecret=$FABRIC_API_SECRET