Skip to content

Commit

Permalink
link react-native-config 🔗
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoungbinkim committed Feb 27, 2023
1 parent c4a459e commit 6685316
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ANDROID_GANACHE_PROVIDER = 'http://10.0.2.2:7545'
IOS_GANACHE_PROVIDER = 'http://127.0.0.1:7545'

IOS_HTTP_URL = 'http://127.0.0.1:10801'
ANDROID_HTTP_URL = 'http://10.0.2.2:10801'

EC_TYPE = 'EC_ALT_BN128'
DATA_BLOCK_NUM = '530'
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: "com.android.application"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os
Expand Down Expand Up @@ -266,6 +267,8 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules

implementation project(':react-native-config')

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.soloader.SoLoader;
import com.datatradeapp.newarchitecture.MainApplicationReactNativeHost;
// import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

Expand All @@ -29,6 +30,7 @@ protected List<ReactPackage> getPackages() {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new MyAppPackage());
// packages.add(new ReactNativeConfigPackage());
return packages;
}

Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":react-native-config")
project(":react-native-config").projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
11 changes: 11 additions & 0 deletions ios/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Config.xcconfig
// dataTradeApp
//
// Created by 김경빈 on 2023/02/27.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974

#include? "tmp.xcconfig"
14 changes: 14 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ PODS:
- React-jsinspector (0.70.6)
- React-logger (0.70.6):
- glog
- react-native-config (1.5.0):
- react-native-config/App (= 1.5.0)
- react-native-config/App (1.5.0):
- React-Core
- react-native-get-random-values (1.8.0):
- React-Core
- react-native-randombytes (3.6.1):
Expand All @@ -314,6 +318,8 @@ PODS:
- RCTTypeSafety
- React-Core
- ReactCommon/turbomodule/core
- react-native-sqlite-storage (6.0.1):
- React-Core
- React-perflogger (0.70.6)
- React-RCTActionSheet (0.70.6):
- React-Core/RCTActionSheetHeaders (= 0.70.6)
Expand Down Expand Up @@ -444,9 +450,11 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-config (from `../node_modules/react-native-config`)
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
- react-native-randombytes (from `../node_modules/react-native-randombytes`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-sqlite-storage (from `../node_modules/react-native-sqlite-storage`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
Expand Down Expand Up @@ -529,12 +537,16 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-config:
:path: "../node_modules/react-native-config"
react-native-get-random-values:
:path: "../node_modules/react-native-get-random-values"
react-native-randombytes:
:path: "../node_modules/react-native-randombytes"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-sqlite-storage:
:path: "../node_modules/react-native-sqlite-storage"
React-perflogger:
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
React-RCTActionSheet:
Expand Down Expand Up @@ -608,9 +620,11 @@ SPEC CHECKSUMS:
React-jsiexecutor: b4a65947391c658450151275aa406f2b8263178f
React-jsinspector: 60769e5a0a6d4b32294a2456077f59d0266f9a8b
React-logger: 1623c216abaa88974afce404dc8f479406bbc3a0
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846
react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc
react-native-sqlite-storage: f6d515e1c446d1e6d026aa5352908a25d4de3261
React-perflogger: 8c79399b0500a30ee8152d0f9f11beae7fc36595
React-RCTActionSheet: 7316773acabb374642b926c19aef1c115df5c466
React-RCTAnimation: 5341e288375451297057391227f691d9b2326c3d
Expand Down
65 changes: 65 additions & 0 deletions ios/dataTradeApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
3B6E8A2E298CB9D300BB4A23 /* libgmpxx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B6E8A28298CB9B000BB4A23 /* libgmpxx.a */; };
3B84D118299221E5005283B5 /* libSnark.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA6CED92991FEDF0062EE86 /* libSnark.a */; };
3B84D11929922AD4005283B5 /* crs in Resources */ = {isa = PBXBuildFile; fileRef = 3BA6CED72991F4840062EE86 /* crs */; };
3BAB490829ACBAE90067FF4F /* Config.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3BAB490729ACBAE90067FF4F /* Config.xcconfig */; };
3BB244B82988EC9900EFD587 /* libPods-dataTradeApp-dataTradeAppTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-dataTradeApp-dataTradeAppTests.a */; };
3BB244BA2988EED800EFD587 /* zkSnark in Frameworks */ = {isa = PBXBuildFile; productRef = 3BB244B92988EED800EFD587 /* zkSnark */; };
3BC88AAE298B59C00097527D /* LibsnarkModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BE3666829882DA700A702E3 /* LibsnarkModule.swift */; };
Expand All @@ -35,6 +36,20 @@
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = dataTradeApp;
};
3BAB48F529AC6E920067FF4F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 3BAB48F029AC6E920067FF4F /* ReactNativeConfig.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = EB2648DF1C7BE17A00B8F155;
remoteInfo = ReactNativeConfig;
};
3BAB48F729AC6E920067FF4F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 3BAB48F029AC6E920067FF4F /* ReactNativeConfig.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3DF7F6AC203AA09B00D0EAB7;
remoteInfo = "ReactNativeConfig-tvOS";
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
Expand All @@ -58,6 +73,8 @@
3BA6CED72991F4840062EE86 /* crs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = crs; sourceTree = "<group>"; };
3BA6CED92991FEDF0062EE86 /* libSnark.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSnark.a; path = native_libs/lib/sim/libSnark.a; sourceTree = "<group>"; };
3BA6CEDC2992017E0062EE86 /* Packages */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Packages; sourceTree = "<group>"; };
3BAB48F029AC6E920067FF4F /* ReactNativeConfig.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeConfig.xcodeproj; path = "../node_modules/react-native-config/ios/ReactNativeConfig.xcodeproj"; sourceTree = "<group>"; };
3BAB490729ACBAE90067FF4F /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
3BB244932988CC3300EFD587 /* LibsnarkModule-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LibsnarkModule-Bridging-Header.h"; sourceTree = "<group>"; };
3BE3665829882AA500A702E3 /* libsnark_module */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = libsnark_module; sourceTree = "<group>"; };
3BE3666829882DA700A702E3 /* LibsnarkModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibsnarkModule.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -119,6 +136,7 @@
13B07FAE1A68108700A75B9A /* dataTradeApp */ = {
isa = PBXGroup;
children = (
3BAB48EF29AC6AF60067FF4F /* www */,
3BE366722988AEE900A702E3 /* LibsnarkModule.h */,
3BE3666A29882DD200A702E3 /* LibsnarkModule.m */,
3BE3666829882DA700A702E3 /* LibsnarkModule.swift */,
Expand Down Expand Up @@ -152,6 +170,22 @@
name = Frameworks;
sourceTree = "<group>";
};
3BAB48EF29AC6AF60067FF4F /* www */ = {
isa = PBXGroup;
children = (
);
path = www;
sourceTree = "<group>";
};
3BAB48F129AC6E920067FF4F /* Products */ = {
isa = PBXGroup;
children = (
3BAB48F629AC6E920067FF4F /* libRNCConfig.a */,
3BAB48F829AC6E920067FF4F /* libRNCConfig-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
3BE3666629882D3A00A702E3 /* Packages */ = {
isa = PBXGroup;
children = (
Expand All @@ -163,13 +197,15 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
3BAB48F029AC6E920067FF4F /* ReactNativeConfig.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
3BAB490729ACBAE90067FF4F /* Config.xcconfig */,
3BA6CED72991F4840062EE86 /* crs */,
3BE3666629882D3A00A702E3 /* Packages */,
13B07FAE1A68108700A75B9A /* dataTradeApp */,
Expand Down Expand Up @@ -281,6 +317,12 @@
mainGroup = 83CBB9F61A601CBA00E9B192;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 3BAB48F129AC6E920067FF4F /* Products */;
ProjectRef = 3BAB48F029AC6E920067FF4F /* ReactNativeConfig.xcodeproj */;
},
);
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* dataTradeApp */,
Expand All @@ -289,6 +331,25 @@
};
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
3BAB48F629AC6E920067FF4F /* libRNCConfig.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
name = libRNCConfig.a;
path = libReactNativeConfig.a;
remoteRef = 3BAB48F529AC6E920067FF4F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
3BAB48F829AC6E920067FF4F /* libRNCConfig-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
name = "libRNCConfig-tvOS.a";
path = "libReactNativeConfig-tvOS.a";
remoteRef = 3BAB48F729AC6E920067FF4F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
00E356EC1AD99517003FC87E /* Resources */ = {
isa = PBXResourcesBuildPhase;
Expand All @@ -301,6 +362,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3BAB490829ACBAE90067FF4F /* Config.xcconfig in Resources */,
3B84D11929922AD4005283B5 /* crs in Resources */,
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
Expand Down Expand Up @@ -602,6 +664,7 @@
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
"\"$(PODS_TARGET_SRCROOT)/include/\"",
"\"${PODS_ROOT}/Headers/Public/React\"/**",
"\"$(SRCROOT)/../node_modules/react-native-config/ios/**\"",
);
INFOPLIST_FILE = dataTradeApp/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = dataTradeApp;
Expand Down Expand Up @@ -738,6 +801,7 @@
};
83CBBA201A601CBA00E9B192 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3BAB490729ACBAE90067FF4F /* Config.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -811,6 +875,7 @@
};
83CBBA211A601CBA00E9B192 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3BAB490729ACBAE90067FF4F /* Config.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;&#10;cp &quot;${PROJECT_DIR}/../.env&quot; &quot;${PROJECT_DIR}/../.env&quot; # replace .env.staging for your file&#10;&quot;${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildXCConfig.rb&quot; &quot;${SRCROOT}/..&quot; &quot;${SRCROOT}/tmp.xcconfig&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "dataTradeApp.app"
BlueprintName = "dataTradeApp"
ReferencedContainer = "container:dataTradeApp.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
6 changes: 6 additions & 0 deletions ios/tmp.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ANDROID_GANACHE_PROVIDER=http:/$()/10.0.2.2:7545
IOS_GANACHE_PROVIDER=http:/$()/127.0.0.1:7545
IOS_HTTP_URL=http:/$()/127.0.0.1:10801
ANDROID_HTTP_URL=http:/$()/10.0.2.2:10801
EC_TYPE=EC_ALT_BN128
DATA_BLOCK_NUM=530
35 changes: 35 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6685316

Please sign in to comment.