From aff335b305c08f89c4874021aebf2eb4566340cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 2 Mar 2021 12:53:36 +0100 Subject: [PATCH] gradle: Exclude Google libraries when GOOGLE_FREE=1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 3 ++- android/app/build.gradle | 8 ++++++++ react-native.config.js | 3 --- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b433e0bdf9..acb49052be 100644 --- a/Makefile +++ b/Makefile @@ -175,12 +175,13 @@ release-android: export ANDROID_ABI_INCLUDE ?= armeabi-v7a;arm64-v8a;x86 release-android: keystore ##@build Build release for Android scripts/release-android.sh -release-fdroid: export BUILD_ENV ?= prod +release-fdroid: export BUILD_ENV = prod release-fdroid: export BUILD_TYPE = release release-fdroid: export ANDROID_APK_SIGNED = false release-fdroid: export ANDROID_ABI_SPLIT = false release-fdroid: export ANDROID_ABI_INCLUDE = armeabi-v7a;arm64-v8a;x86;x86_64 release-fdroid: ##@build Build release for F-Droid + echo "GOOGLE_FREE=1" >> .env.release scripts/release-android.sh release-ios: export TARGET := ios diff --git a/android/app/build.gradle b/android/app/build.gradle index 587de91a1e..f1e5ae0dde 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -327,6 +327,14 @@ dependencies { implementation jscFlavor } + if (googleFree) { + implementation(project(':react-native-device-info')) { + exclude group: 'com.google.firebase' + exclude group: 'com.google.android.gms' + exclude group: 'com.android.installreferrer' + } + } + // react-native-screens implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02' diff --git a/react-native.config.js b/react-native.config.js index 8ca73c099d..3357184d96 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -1,5 +1,3 @@ -const rndi = process.env.GOOGLE_FREE == 1 ? {platforms: {android: null}} : {}; - module.exports = { dependencies: { 'react-native-config': { @@ -24,6 +22,5 @@ module.exports = { ios: null, }, }, - 'react-native-device-info': rndi, }, };