From 19d856574e5cd88041020093c46c9bc93608d499 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Fri, 7 Aug 2020 18:19:41 +0200 Subject: [PATCH] Move keystore properties in own file This allows to sync gradle.properties with git --- .gitignore | 2 +- android/app/build.gradle | 17 +++++++++++------ android/gradle.properties | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 android/gradle.properties diff --git a/.gitignore b/.gitignore index 9d05363..50c9faa 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,7 @@ buck-out/ *.keystore !debug.keystore *.jks -/android/gradle.properties +/android/keystores/release.keystore.properties # fastlane # diff --git a/android/app/build.gradle b/android/app/build.gradle index a3fcaf1..5320938 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -124,6 +124,13 @@ def jscFlavor = 'org.webkit:android-jsc:+' */ def enableHermes = project.ext.react.get("enableHermes", false); +/** + * Load release keystore + */ +def keystorePropertiesFile = rootProject.file("keystores/release.keystore.properties"); +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { compileSdkVersion rootProject.ext.compileSdkVersion @@ -156,12 +163,10 @@ android { keyPassword 'android' } release { - if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) { - storeFile file(MYAPP_UPLOAD_STORE_FILE) - storePassword MYAPP_UPLOAD_STORE_PASSWORD - keyAlias MYAPP_UPLOAD_KEY_ALIAS - keyPassword MYAPP_UPLOAD_KEY_PASSWORD - } + storeFile file(keystoreProperties['UPLOAD_STORE_FILE']) + storePassword keystoreProperties['UPLOAD_STORE_PASSWORD'] + keyAlias keystoreProperties['UPLOAD_KEY_ALIAS'] + keyPassword keystoreProperties['UPLOAD_KEY_PASSWORD'] } } buildTypes { diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..99d49a9 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,27 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true +# Version of flipper SDK to use with React Native +FLIPPER_VERSION=0.37.0