File tree Expand file tree Collapse file tree 6 files changed +28
-41
lines changed
Expand file tree Collapse file tree 6 files changed +28
-41
lines changed Original file line number Diff line number Diff line change @@ -146,3 +146,21 @@ apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
146146apply from : file(" ../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" ); applyNativeModulesAppBuildGradle(project)
147147
148148apply from : project(' :react-native-config' ). projectDir. getPath() + " /dotenv.gradle"
149+
150+ def properties = loadProperties()
151+ def storefrontDomain = properties. getProperty(" STOREFRONT_DOMAIN" )
152+
153+ if (! storefrontDomain) {
154+ println (" **** Please add a .env file with STOREFRONT_DOMAIN set *****" )
155+ }
156+
157+ task generateAndroidManifestFromTemplate {
158+ doLast {
159+ def templateFile = file(' src/main/AndroidManifest.template.xml' )
160+ def outputFile = file(' src/main/AndroidManifest.xml' )
161+ def content = templateFile. getText(' UTF-8' ). replace(' {{STOREFRONT_DOMAIN}}' , " $storefrontDomain " )
162+ outputFile. write(content, ' UTF-8' )
163+ }
164+ }
165+
166+ preBuild. dependsOn(generateAndroidManifestFromTemplate)
Original file line number Diff line number Diff line change 3333 <category android : name =" android.intent.category.BROWSABLE" />
3434
3535 <!-- Note: the host here will be replaced on application start -->
36- <data android : scheme =" https" android : host =" { STOREFRONT_DOMAIN}" />
36+ <data android : scheme =" https" android : host ={{ STOREFRONT_DOMAIN}} />
3737 </intent-filter >
3838 </activity >
3939 </application >
Original file line number Diff line number Diff line change @@ -20,4 +20,12 @@ buildscript {
2020 }
2121}
2222
23+ def loadProperties () {
24+ def props = new Properties ()
25+ file(' ../.env' ). withInputStream {
26+ props. load(it)
27+ }
28+ return props
29+ }
30+
2331apply plugin : " com.facebook.react.rootproject"
Original file line number Diff line number Diff line change 1111 "build:ios" : " sh ./scripts/build_ios" ,
1212 "lint" : " yarn typecheck && eslint ." ,
1313 "ios" : " react-native run-ios --simulator 'iPhone 15 Pro'" ,
14- "start" : " ./scripts/prestart && react-native start -- --simulator 'iPhone 15 Pro' --reset-cache" ,
14+ "start" : " react-native start -- --simulator 'iPhone 15 Pro' --reset-cache" ,
1515 "typecheck" : " tsc --noEmit" ,
1616 "test:ios" : " sh ./scripts/test_ios" ,
1717 "test:android" : " sh ./scripts/test_android"
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments