Skip to content

Commit 928e91e

Browse files
committed
compile for different environments
1 parent fa1aeec commit 928e91e

File tree

11 files changed

+248
-148
lines changed

11 files changed

+248
-148
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ Pods
2727
#
2828
node_modules/
2929
npm-debug.log
30+
31+
/testbuild

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In the `ios` directory
1212
* Install Pods: `pod install`
1313
* Launch: `open Sample.xcworkspace`
1414

15-
#### Server
15+
### Server
1616

1717
There is a server that the app hits for data. The data is only stored in memory, but it should produce a more realistic environment.
1818

@@ -23,6 +23,12 @@ In the `server` directory
2323

2424
It has sample data in the `models.js` file. For example, there is a user bleonard (password: "sample") that you can log in as.
2525

26+
### Compiling
27+
28+
You can compile and put it on the phone with: `npm run install:staging`
29+
30+
Not that there's a staging server at this point, but it's an example of how to compile things via the command line.
31+
2632
### Android
2733

2834
We'll get there, but we're still working on the iOS version.

ios/Debug.xcconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "Pods/Target Support Files/Pods/Pods.debug.xcconfig"
2+
3+
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) kEnvironment="@\"debug\""

ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ DEPENDENCIES:
77
SPEC CHECKSUMS:
88
SimulatorRemoteNotifications: 1610643e0582b2af67bc254b071ace4077e8ef86
99

10-
COCOAPODS: 0.38.2
10+
COCOAPODS: 0.39.0

ios/Sample.xcodeproj/project.pbxproj

Lines changed: 55 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
1414
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
1515
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
16-
00E356F31AD99517003FC87E /* SampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SampleTests.m */; };
1716
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
1817
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
1918
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
@@ -65,13 +64,6 @@
6564
remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
6665
remoteInfo = RCTVibration;
6766
};
68-
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
69-
isa = PBXContainerItemProxy;
70-
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
71-
proxyType = 1;
72-
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
73-
remoteInfo = Sample;
74-
};
7567
139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
7668
isa = PBXContainerItemProxy;
7769
containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
@@ -130,7 +122,6 @@
130122
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; };
131123
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; };
132124
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; };
133-
00E356EE1AD99517003FC87E /* SampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
134125
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
135126
00E356F21AD99517003FC87E /* SampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SampleTests.m; sourceTree = "<group>"; };
136127
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
@@ -148,19 +139,14 @@
148139
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
149140
A565388F7CDBDB0548B5DC8D /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
150141
D339AEE11BAA808800CFA651 /* RNKeyboardEvents.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNKeyboardEvents.xcodeproj; path = "../node_modules/react-native-keyboardevents/RNKeyboardEvents.xcodeproj"; sourceTree = "<group>"; };
142+
D36DCD9F1BD4A92600B3EB2F /* Staging.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Staging.xcconfig; sourceTree = "<group>"; };
143+
D36DCDA01BD4A92600B3EB2F /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
151144
D374ADB51BA929B900453203 /* RNKeychain.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNKeychain.xcodeproj; path = "../node_modules/react-native-keychain/RNKeychain.xcodeproj"; sourceTree = "<group>"; };
152145
D374ADD21BA9336E00453203 /* EnvironmentManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EnvironmentManager.m; path = Sample/EnvironmentManager.m; sourceTree = "<group>"; };
153146
F8DE0F0169FA03E7C6B1C51E /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
154147
/* End PBXFileReference section */
155148

156149
/* Begin PBXFrameworksBuildPhase section */
157-
00E356EB1AD99517003FC87E /* Frameworks */ = {
158-
isa = PBXFrameworksBuildPhase;
159-
buildActionMask = 2147483647;
160-
files = (
161-
);
162-
runOnlyForDeploymentPostprocessing = 0;
163-
};
164150
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
165151
isa = PBXFrameworksBuildPhase;
166152
buildActionMask = 2147483647;
@@ -335,6 +321,7 @@
335321
83CBB9F61A601CBA00E9B192 = {
336322
isa = PBXGroup;
337323
children = (
324+
D36DCD921BD4A91C00B3EB2F /* Config */,
338325
13B07FAE1A68108700A75B9A /* Sample */,
339326
832341AE1AAA6A7D00B99B32 /* Libraries */,
340327
00E356EF1AD99517003FC87E /* SampleTests */,
@@ -350,7 +337,6 @@
350337
isa = PBXGroup;
351338
children = (
352339
13B07F961A680F5B00A75B9A /* Sample.app */,
353-
00E356EE1AD99517003FC87E /* SampleTests.xctest */,
354340
);
355341
name = Products;
356342
sourceTree = "<group>";
@@ -363,6 +349,15 @@
363349
name = Products;
364350
sourceTree = "<group>";
365351
};
352+
D36DCD921BD4A91C00B3EB2F /* Config */ = {
353+
isa = PBXGroup;
354+
children = (
355+
D36DCD9F1BD4A92600B3EB2F /* Staging.xcconfig */,
356+
D36DCDA01BD4A92600B3EB2F /* Debug.xcconfig */,
357+
);
358+
name = Config;
359+
sourceTree = "<group>";
360+
};
366361
D374ADB61BA929B900453203 /* Products */ = {
367362
isa = PBXGroup;
368363
children = (
@@ -374,24 +369,6 @@
374369
/* End PBXGroup section */
375370

376371
/* Begin PBXNativeTarget section */
377-
00E356ED1AD99517003FC87E /* SampleTests */ = {
378-
isa = PBXNativeTarget;
379-
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "SampleTests" */;
380-
buildPhases = (
381-
00E356EA1AD99517003FC87E /* Sources */,
382-
00E356EB1AD99517003FC87E /* Frameworks */,
383-
00E356EC1AD99517003FC87E /* Resources */,
384-
);
385-
buildRules = (
386-
);
387-
dependencies = (
388-
00E356F51AD99517003FC87E /* PBXTargetDependency */,
389-
);
390-
name = SampleTests;
391-
productName = SampleTests;
392-
productReference = 00E356EE1AD99517003FC87E /* SampleTests.xctest */;
393-
productType = "com.apple.product-type.bundle.unit-test";
394-
};
395372
13B07F861A680F5B00A75B9A /* Sample */ = {
396373
isa = PBXNativeTarget;
397374
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Sample" */;
@@ -401,6 +378,7 @@
401378
13B07F8C1A680F5B00A75B9A /* Frameworks */,
402379
13B07F8E1A680F5B00A75B9A /* Resources */,
403380
DF35A678DD70FEB3ABFDEA69 /* Copy Pods Resources */,
381+
B91827D077A8C198AC93F32E /* Embed Pods Frameworks */,
404382
);
405383
buildRules = (
406384
);
@@ -419,12 +397,6 @@
419397
attributes = {
420398
LastUpgradeCheck = 0610;
421399
ORGANIZATIONNAME = Facebook;
422-
TargetAttributes = {
423-
00E356ED1AD99517003FC87E = {
424-
CreatedOnToolsVersion = 6.2;
425-
TestTargetID = 13B07F861A680F5B00A75B9A;
426-
};
427-
};
428400
};
429401
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Sample" */;
430402
compatibilityVersion = "Xcode 3.2";
@@ -490,7 +462,6 @@
490462
projectRoot = "";
491463
targets = (
492464
13B07F861A680F5B00A75B9A /* Sample */,
493-
00E356ED1AD99517003FC87E /* SampleTests */,
494465
);
495466
};
496467
/* End PBXProject section */
@@ -583,13 +554,6 @@
583554
/* End PBXReferenceProxy section */
584555

585556
/* Begin PBXResourcesBuildPhase section */
586-
00E356EC1AD99517003FC87E /* Resources */ = {
587-
isa = PBXResourcesBuildPhase;
588-
buildActionMask = 2147483647;
589-
files = (
590-
);
591-
runOnlyForDeploymentPostprocessing = 0;
592-
};
593557
13B07F8E1A680F5B00A75B9A /* Resources */ = {
594558
isa = PBXResourcesBuildPhase;
595559
buildActionMask = 2147483647;
@@ -603,6 +567,21 @@
603567
/* End PBXResourcesBuildPhase section */
604568

605569
/* Begin PBXShellScriptBuildPhase section */
570+
B91827D077A8C198AC93F32E /* Embed Pods Frameworks */ = {
571+
isa = PBXShellScriptBuildPhase;
572+
buildActionMask = 2147483647;
573+
files = (
574+
);
575+
inputPaths = (
576+
);
577+
name = "Embed Pods Frameworks";
578+
outputPaths = (
579+
);
580+
runOnlyForDeploymentPostprocessing = 0;
581+
shellPath = /bin/sh;
582+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
583+
showEnvVarsInLog = 0;
584+
};
606585
C1D93FBDA4027FB5459323A3 /* Check Pods Manifest.lock */ = {
607586
isa = PBXShellScriptBuildPhase;
608587
buildActionMask = 2147483647;
@@ -636,14 +615,6 @@
636615
/* End PBXShellScriptBuildPhase section */
637616

638617
/* Begin PBXSourcesBuildPhase section */
639-
00E356EA1AD99517003FC87E /* Sources */ = {
640-
isa = PBXSourcesBuildPhase;
641-
buildActionMask = 2147483647;
642-
files = (
643-
00E356F31AD99517003FC87E /* SampleTests.m in Sources */,
644-
);
645-
runOnlyForDeploymentPostprocessing = 0;
646-
};
647618
13B07F871A680F5B00A75B9A /* Sources */ = {
648619
isa = PBXSourcesBuildPhase;
649620
buildActionMask = 2147483647;
@@ -656,14 +627,6 @@
656627
};
657628
/* End PBXSourcesBuildPhase section */
658629

659-
/* Begin PBXTargetDependency section */
660-
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
661-
isa = PBXTargetDependency;
662-
target = 13B07F861A680F5B00A75B9A /* Sample */;
663-
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
664-
};
665-
/* End PBXTargetDependency section */
666-
667630
/* Begin PBXVariantGroup section */
668631
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
669632
isa = PBXVariantGroup;
@@ -677,46 +640,9 @@
677640
/* End PBXVariantGroup section */
678641

679642
/* Begin XCBuildConfiguration section */
680-
00E356F61AD99517003FC87E /* Debug */ = {
681-
isa = XCBuildConfiguration;
682-
buildSettings = {
683-
BUNDLE_LOADER = "$(TEST_HOST)";
684-
FRAMEWORK_SEARCH_PATHS = (
685-
"$(SDKROOT)/Developer/Library/Frameworks",
686-
"$(inherited)",
687-
);
688-
GCC_PREPROCESSOR_DEFINITIONS = (
689-
"DEBUG=1",
690-
"$(inherited)",
691-
);
692-
INFOPLIST_FILE = SampleTests/Info.plist;
693-
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
694-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
695-
PRODUCT_NAME = "$(TARGET_NAME)";
696-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample";
697-
};
698-
name = Debug;
699-
};
700-
00E356F71AD99517003FC87E /* Release */ = {
701-
isa = XCBuildConfiguration;
702-
buildSettings = {
703-
BUNDLE_LOADER = "$(TEST_HOST)";
704-
COPY_PHASE_STRIP = NO;
705-
FRAMEWORK_SEARCH_PATHS = (
706-
"$(SDKROOT)/Developer/Library/Frameworks",
707-
"$(inherited)",
708-
);
709-
INFOPLIST_FILE = SampleTests/Info.plist;
710-
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
711-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
712-
PRODUCT_NAME = "$(TARGET_NAME)";
713-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample";
714-
};
715-
name = Release;
716-
};
717643
13B07F941A680F5B00A75B9A /* Debug */ = {
718644
isa = XCBuildConfiguration;
719-
baseConfigurationReference = F8DE0F0169FA03E7C6B1C51E /* Pods.debug.xcconfig */;
645+
baseConfigurationReference = D36DCDA01BD4A92600B3EB2F /* Debug.xcconfig */;
720646
buildSettings = {
721647
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
722648
HEADER_SEARCH_PATHS = (
@@ -734,26 +660,6 @@
734660
};
735661
name = Debug;
736662
};
737-
13B07F951A680F5B00A75B9A /* Release */ = {
738-
isa = XCBuildConfiguration;
739-
baseConfigurationReference = 5514946EFAE3635A0EDC2A3B /* Pods.release.xcconfig */;
740-
buildSettings = {
741-
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
742-
HEADER_SEARCH_PATHS = (
743-
"$(inherited)",
744-
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
745-
"$(SRCROOT)/../node_modules/react-native/React/**",
746-
);
747-
INFOPLIST_FILE = Sample/Info.plist;
748-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
749-
OTHER_LDFLAGS = (
750-
"$(inherited)",
751-
"-ObjC",
752-
);
753-
PRODUCT_NAME = Sample;
754-
};
755-
name = Release;
756-
};
757663
83CBBA201A601CBA00E9B192 /* Debug */ = {
758664
isa = XCBuildConfiguration;
759665
buildSettings = {
@@ -800,7 +706,7 @@
800706
};
801707
name = Debug;
802708
};
803-
83CBBA211A601CBA00E9B192 /* Release */ = {
709+
D36DCDA31BD4A96300B3EB2F /* Staging */ = {
804710
isa = XCBuildConfiguration;
805711
buildSettings = {
806712
ALWAYS_SEARCH_USER_PATHS = NO;
@@ -838,37 +744,48 @@
838744
SDKROOT = iphoneos;
839745
VALIDATE_PRODUCT = YES;
840746
};
841-
name = Release;
747+
name = Staging;
748+
};
749+
D36DCDA41BD4A96300B3EB2F /* Staging */ = {
750+
isa = XCBuildConfiguration;
751+
baseConfigurationReference = D36DCD9F1BD4A92600B3EB2F /* Staging.xcconfig */;
752+
buildSettings = {
753+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
754+
HEADER_SEARCH_PATHS = (
755+
"$(inherited)",
756+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
757+
"$(SRCROOT)/../node_modules/react-native/React/**",
758+
);
759+
INFOPLIST_FILE = Sample/Info.plist;
760+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
761+
OTHER_LDFLAGS = (
762+
"$(inherited)",
763+
"-ObjC",
764+
);
765+
PRODUCT_NAME = Sample;
766+
};
767+
name = Staging;
842768
};
843769
/* End XCBuildConfiguration section */
844770

845771
/* Begin XCConfigurationList section */
846-
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "SampleTests" */ = {
847-
isa = XCConfigurationList;
848-
buildConfigurations = (
849-
00E356F61AD99517003FC87E /* Debug */,
850-
00E356F71AD99517003FC87E /* Release */,
851-
);
852-
defaultConfigurationIsVisible = 0;
853-
defaultConfigurationName = Release;
854-
};
855772
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Sample" */ = {
856773
isa = XCConfigurationList;
857774
buildConfigurations = (
858775
13B07F941A680F5B00A75B9A /* Debug */,
859-
13B07F951A680F5B00A75B9A /* Release */,
776+
D36DCDA41BD4A96300B3EB2F /* Staging */,
860777
);
861778
defaultConfigurationIsVisible = 0;
862-
defaultConfigurationName = Release;
779+
defaultConfigurationName = Debug;
863780
};
864781
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Sample" */ = {
865782
isa = XCConfigurationList;
866783
buildConfigurations = (
867784
83CBBA201A601CBA00E9B192 /* Debug */,
868-
83CBBA211A601CBA00E9B192 /* Release */,
785+
D36DCDA31BD4A96300B3EB2F /* Staging */,
869786
);
870787
defaultConfigurationIsVisible = 0;
871-
defaultConfigurationName = Release;
788+
defaultConfigurationName = Debug;
872789
};
873790
/* End XCConfigurationList section */
874791
};

0 commit comments

Comments
 (0)