Skip to content

Commit a804228

Browse files
committed
Updates to package, link commands
1 parent 8a7fa3c commit a804228

File tree

7 files changed

+106
-43
lines changed

7 files changed

+106
-43
lines changed

bin/cocoapods.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/sh
2+
3+
## https://github.com/auth0/react-native-lock/blob/master/bin/cocoapods.sh
4+
5+
ios_dir=`pwd`/ios
6+
if [ -d ios_dir ]
7+
then
8+
exit 0
9+
fi
10+
11+
podfile="$ios_dir/Podfile"
12+
template=`pwd`/node_modules/react-native-firestack/ios/Podfile.template
13+
14+
echo "Checking Podfile in iOS project ($podfile)"
15+
16+
if [ -f $podfile ]
17+
then
18+
echo ""
19+
echo "Found an existing Podfile, Do you want to override it? [N/y]"
20+
read generate_env_file
21+
22+
if [ "$generate_env_file" != "y" ]
23+
then
24+
echo "Add the following pods":
25+
echo ""
26+
echo ""
27+
cat $template
28+
echo ""
29+
echo ""
30+
echo "and run 'pod install' to install Firestack for iOS"
31+
exit 0
32+
fi
33+
34+
rm -f $podfile
35+
rm -f "$podfile.lock"
36+
fi
37+
38+
echo "Adding Podfile to iOS project"
39+
40+
cd ios
41+
pod init >/dev/null 2>&1
42+
cat $template >> $podfile
43+
cd ..
44+
45+
echo "Installing Pods"
46+
47+
pod install --project-directory=ios

bin/prepare.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
## https://github.com/auth0/react-native-lock/blob/master/bin/prepare.sh
4+
5+
echo "Preparing to link react-native-firestack for iOS"
6+
7+
echo "Checking CocoaPods..."
8+
has_cocoapods=`which pod >/dev/null 2>&1`
9+
if [ -z "$has_cocoapods" ]
10+
then
11+
echo "CocoaPods already installed"
12+
else
13+
echo "Installing CocoaPods..."
14+
gem install cocoapods
15+
fi

ios/Firestack.xcodeproj/project.pbxproj

+8-40
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
D962903F1D6D15B00099A3EC /* FirestackErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = D962903E1D6D15B00099A3EC /* FirestackErrors.m */; };
1313
D96290451D6D16100099A3EC /* FirestackAnalytics.m in Sources */ = {isa = PBXBuildFile; fileRef = D96290441D6D16100099A3EC /* FirestackAnalytics.m */; };
1414
D96290851D6D28B80099A3EC /* FirestackDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = D96290841D6D28B80099A3EC /* FirestackDatabase.m */; };
15-
D97261C71D551BF5000F703F /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D97261C61D551BF5000F703F /* CFNetwork.framework */; };
16-
D97261C91D551BFF000F703F /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D97261C81D551BFF000F703F /* AddressBook.framework */; };
1715
D9D62E7C1D6D86FD003D826D /* FirestackStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = D9D62E7B1D6D86FD003D826D /* FirestackStorage.m */; };
1816
D9D62E801D6D8717003D826D /* FirestackAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = D9D62E7F1D6D8717003D826D /* FirestackAuth.m */; };
1917
/* End PBXBuildFile section */
@@ -43,9 +41,6 @@
4341
D96290441D6D16100099A3EC /* FirestackAnalytics.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirestackAnalytics.m; path = Firestack/FirestackAnalytics.m; sourceTree = "<group>"; };
4442
D96290831D6D28B80099A3EC /* FirestackDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FirestackDatabase.h; path = Firestack/FirestackDatabase.h; sourceTree = "<group>"; };
4543
D96290841D6D28B80099A3EC /* FirestackDatabase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirestackDatabase.m; path = Firestack/FirestackDatabase.m; sourceTree = "<group>"; };
46-
D97261C61D551BF5000F703F /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
47-
D97261C81D551BFF000F703F /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; };
48-
D984ECF51D9253930037D97B /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = Firestack/module.modulemap; sourceTree = SOURCE_ROOT; };
4944
D9D62E7A1D6D86FD003D826D /* FirestackStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FirestackStorage.h; path = Firestack/FirestackStorage.h; sourceTree = "<group>"; };
5045
D9D62E7B1D6D86FD003D826D /* FirestackStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirestackStorage.m; path = Firestack/FirestackStorage.m; sourceTree = "<group>"; };
5146
D9D62E7E1D6D8717003D826D /* FirestackAuth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FirestackAuth.h; path = Firestack/FirestackAuth.h; sourceTree = "<group>"; };
@@ -57,8 +52,6 @@
5752
isa = PBXFrameworksBuildPhase;
5853
buildActionMask = 2147483647;
5954
files = (
60-
D97261C91D551BFF000F703F /* AddressBook.framework in Frameworks */,
61-
D97261C71D551BF5000F703F /* CFNetwork.framework in Frameworks */,
6255
);
6356
runOnlyForDeploymentPostprocessing = 0;
6457
};
@@ -73,24 +66,13 @@
7366
name = Products;
7467
sourceTree = "<group>";
7568
};
76-
4C361DE13748C14BF1F87624 /* Frameworks */ = {
77-
isa = PBXGroup;
78-
children = (
79-
D97261C81D551BFF000F703F /* AddressBook.framework */,
80-
D97261C61D551BF5000F703F /* CFNetwork.framework */,
81-
);
82-
name = Frameworks;
83-
sourceTree = "<group>";
84-
};
8569
58B511D21A9E6C8500147676 = {
8670
isa = PBXGroup;
8771
children = (
88-
D984ECF51D9253930037D97B /* module.modulemap */,
8972
D96290351D6D145F0099A3EC /* Modules */,
9073
D950369C1D19C77400F7094D /* Firestack.h */,
9174
D950369D1D19C77400F7094D /* Firestack.m */,
9275
134814211AA4EA7D00B7C361 /* Products */,
93-
4C361DE13748C14BF1F87624 /* Frameworks */,
9476
);
9577
sourceTree = "<group>";
9678
};
@@ -262,10 +244,9 @@
262244
58B511F01A9E6C8500147676 /* Debug */ = {
263245
isa = XCBuildConfiguration;
264246
buildSettings = {
265-
DEFINES_MODULE = YES;
266-
DYLIB_INSTALL_NAME_BASE = "";
247+
DEFINES_MODULE = NO;
267248
EMBEDDED_CONTENT_CONTAINS_SWIFT = NO;
268-
ENABLE_BITCODE = NO;
249+
ENABLE_BITCODE = YES;
269250
FRAMEWORK_SEARCH_PATHS = (
270251
"$(inherited)",
271252
"${BUILT_PRODUCTS_DIR}",
@@ -279,16 +260,10 @@
279260
"${PROJECT_DIR}/../../../ios/Pods/**",
280261
);
281262
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
282-
LD_DYLIB_INSTALL_NAME = "@rpath/${EXECUTABLE_NAME}";
283263
LIBRARY_SEARCH_PATHS = "$(inherited)";
284-
MACH_O_TYPE = mh_dylib;
285-
MODULEMAP_FILE = module.modulemap;
264+
MACH_O_TYPE = staticlib;
286265
ONLY_ACTIVE_ARCH = YES;
287-
OTHER_LDFLAGS = (
288-
"$(inherited)",
289-
"-undefined",
290-
dynamic_lookup,
291-
);
266+
OTHER_LDFLAGS = "$(inherited)";
292267
PRODUCT_NAME = Firestack;
293268
SKIP_INSTALL = YES;
294269
};
@@ -297,10 +272,9 @@
297272
58B511F11A9E6C8500147676 /* Release */ = {
298273
isa = XCBuildConfiguration;
299274
buildSettings = {
300-
DEFINES_MODULE = YES;
301-
DYLIB_INSTALL_NAME_BASE = "";
275+
DEFINES_MODULE = NO;
302276
EMBEDDED_CONTENT_CONTAINS_SWIFT = NO;
303-
ENABLE_BITCODE = NO;
277+
ENABLE_BITCODE = YES;
304278
FRAMEWORK_SEARCH_PATHS = (
305279
"$(inherited)",
306280
"${BUILT_PRODUCTS_DIR}",
@@ -314,15 +288,9 @@
314288
"${PROJECT_DIR}/../../../ios/Pods/**",
315289
);
316290
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
317-
LD_DYLIB_INSTALL_NAME = "@rpath/${EXECUTABLE_NAME}";
318291
LIBRARY_SEARCH_PATHS = "$(inherited)";
319-
MACH_O_TYPE = mh_dylib;
320-
MODULEMAP_FILE = module.modulemap;
321-
OTHER_LDFLAGS = (
322-
"$(inherited)",
323-
"-undefined",
324-
dynamic_lookup,
325-
);
292+
MACH_O_TYPE = staticlib;
293+
OTHER_LDFLAGS = "$(inherited)";
326294
PRODUCT_NAME = Firestack;
327295
SKIP_INSTALL = YES;
328296
};

ios/Firestack/module.modulemap

-3
This file was deleted.

ios/Podfile.template

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
source 'https://github.com/CocoaPods/Specs.git'
2+
platform :ios, '8.0'
3+
4+
[
5+
'Firebase',
6+
'Firebase/Core',
7+
'Firebase/Auth',
8+
'Firebase/Storage',
9+
'Firebase/Database',
10+
'Firebase/RemoteConfig',
11+
'Firebase/Messaging'
12+
].each do |lib|
13+
pod lib
14+
end

ios/buildScript.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
# buildScript.sh
4+
# Firestack
5+
#
6+
# Created by Ari Lerner on 8/3/16.
7+
# Copyright © 2016 Facebook. All rights reserved.
8+
frameworks="Firebase FirebaseAnalytics"
9+
10+
source "${SRCROOT}/Pods/Target Support Files/Pods-Firestack/Pods-Firestack-frameworks.sh"
11+
FRAMEWORKS_FOLDER_PATH=""
12+
13+
for framework in $frameworks
14+
do
15+
16+
install_framework "${SRCROOT}/Pods/$framework"
17+
18+
done

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
"react-native": "*"
4040
},
4141
"rnpm": {
42+
"commands": {
43+
"prelink": "node_modules/react-native-firestack/bin/prepare.sh",
44+
"postlink": "node_modules/react-native-firestack/bin/cocoapods.sh"
45+
},
4246
"ios": {
4347
"project": "ios/Firestack.xcodeproj"
4448
},

0 commit comments

Comments
 (0)