Exclude google deps based on env

Export all vars from .env

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-11-02 11:43:54 +03:00
parent d14f232abf
commit 40e2839793
No known key found for this signature in database
GPG Key ID: C9A094959935A952
6 changed files with 25 additions and 10 deletions

View File

@ -23,4 +23,5 @@ ENABLE_ROOT_ALERT=1
ENABLE_REFERRAL_INVITE=1
DISABLE_WALLET_ON_MOBILE_NETWORK=1
APN_TOPIC=im.status.ethereum.pr
BLANK_PREVIEW=0
BLANK_PREVIEW=0
GOOGLE_FREE=0

View File

@ -123,6 +123,11 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false);
/**
* Exclude google library so we can publish to external android stores
*/
def googleFree = project.env.get("GOOGLE_FREE", false)
def getVersionCode = { ->
new ByteArrayOutputStream().withStream { stdOut ->
if (project.hasProperty("versionCode")) {

View File

@ -100,6 +100,9 @@ in stdenv.mkDerivation rec {
# Ensure we have the right .env file
cp -bf ./${envFileName} ./.env
# Export all vars from .env file
export $(cut -d= -f1 .env)
# Copy index.js and app/ input files
cp -ra --no-preserve=ownership ${builtJsBundle}/* ./

View File

@ -1,3 +1,5 @@
const rndi = process.env.GOOGLE_FREE == 1 ? {platforms: {android: null}} : {};
module.exports = {
dependencies: {
'react-native-config': {
@ -22,5 +24,6 @@ module.exports = {
ios: null,
},
},
'react-native-device-info': rndi,
},
};

View File

@ -11,6 +11,7 @@
[status-im.acquisition.advertiser :as advertiser]
[status-im.acquisition.persistance :as persistence]
[status-im.acquisition.gateway :as gateway]
[status-im.utils.config :as config]
[status-im.acquisition.install-referrer :as install-referrer]))
(def not-found-code "notfound.click_id")
@ -105,16 +106,18 @@
(ens/get-addr register contract on-success))))))
(fx/defn create [{:keys [db]}]
{::resolve-contract {:chain (ethereum/chain-keyword db)
:contract (contracts/get-address db :status/acquisition)
:on-success #(re-frame/dispatch [:set-in [:acquisition :contract] %])}
::get-referrer nil})
(when-not config/google-free
{::resolve-contract {:chain (ethereum/chain-keyword db)
:contract (contracts/get-address db :status/acquisition)
:on-success #(re-frame/dispatch [:set-in [:acquisition :contract] %])}
::get-referrer nil}))
(fx/defn login [{:keys [db]}]
{::resolve-contract {:chain (ethereum/chain-keyword db)
:contract (contracts/get-address db :status/acquisition)
:on-success #(re-frame/dispatch [:set-in [:acquisition :contract] %])}
::check-referrer nil})
(when-not config/google-free
{::resolve-contract {:chain (ethereum/chain-keyword db)
:contract (contracts/get-address db :status/acquisition)
:on-success #(re-frame/dispatch [:set-in [:acquisition :contract] %])}
::check-referrer nil}))
(re-frame/reg-sub
::metadata

View File

@ -40,7 +40,7 @@
(def qr-test-menu-enabled? (enabled? (get-config :QR_READ_TEST_MENU "0")))
(def referrals-invite-enabled? (enabled? (get-config :ENABLE_REFERRAL_INVITE "0")))
(def quo-preview-enabled? (enabled? (get-config :ENABLE_QUO_PREVIEW "0")))
(def google-free (enabled? (get-config :GOOGLE_FREE "0")))
;; CONFIG VALUES
(def log-level
(string/upper-case (get-config :LOG_LEVEL "")))