cocoapods-fix-react-native 2018.04.01.16 → 2018.04.01.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -7
- data/lib/cocoapods-fix-react-native/versions/0_54_4.rb +15 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 909cc9e8295d7fa0da87935d9fe3972916e14542c42631505505d85af7cadb17
|
4
|
+
data.tar.gz: b7f55a3992638707eb71d786e1d1092df0698c7f26e4d3dfef7dd718c54b0588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0478326384b5b8c10ef60ed230bfc1d3d17e1a31e90ec64d117c74e0beae97ed66cb4ec6b004e3dfb7f4d6c64ebd6ba0571f4e23cafece8d1e1fcd460fc07ddd
|
7
|
+
data.tar.gz: 49b762c238078aa6ec608d3a4f1e502cb63de81c9fa7bfedb748ef502edd2b3ea7bc839b132368004440382aa120f2d8e838d193f5807fb777f7b005b53284e0
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Hi there! This a CocoaPods plugin that
|
1
|
+
Hi there! This a CocoaPods plugin that **we, the community**, can use to plug the holes in React Native's CocoaPods
|
2
2
|
support.
|
3
3
|
|
4
4
|
CocoaPods allows you to add code to run at the end of the Podfile via a `post_install` hook. You probably already have
|
@@ -15,8 +15,8 @@ Swift, you're pretty far from their workflow.
|
|
15
15
|
In order to get it working for just you app you scour, like, a million issues on React Native (or go look at
|
16
16
|
[artsy/eigen][eigen]) to get it compiling on your setup. Again, not optimal.
|
17
17
|
|
18
|
-
This plugin _tries_ to fix this by centralizing the code needed to modify React Native. This means makes it easy to
|
19
|
-
your versions of React Native, because you can update the gem at the same time.
|
18
|
+
This plugin _tries_ to fix this by centralizing the code needed to modify React Native. This means makes it easy to
|
19
|
+
update your versions of React Native, because you can update the gem at the same time.
|
20
20
|
|
21
21
|
## Installation
|
22
22
|
|
@@ -70,9 +70,11 @@ underscores. E.g. `0.54.4` -> `0_54_4.rb`.
|
|
70
70
|
The scripts itself should be entirely self contained, so that it's easy to understand wthout learning the project.
|
71
71
|
|
72
72
|
The biggest change you'd need to make from the sort of code you can find inside the issues is that it needs to support
|
73
|
-
many different potential roots. So instead of just `Pods
|
74
|
-
|
75
|
-
|
73
|
+
many different potential roots. So instead of just `Pods/React/*` - this plugin will also handle
|
74
|
+
`node_modules/react-native/*` and `../node_modules/react-native/*`. Basically, your dev repo, and your prod app.
|
75
|
+
|
76
|
+
This can be done by removing `'Pods/React'` from the path and wrapping it with a
|
77
|
+
`File.join(root, 'Path/InReactLib.js')`. You'll see this in the current scripts.
|
76
78
|
|
77
79
|
### Getting Setup To Improve
|
78
80
|
|
@@ -98,4 +100,4 @@ As `use_frameworks!` is more strict than static libraries, I'd recommend working
|
|
98
100
|
frameworks.
|
99
101
|
|
100
102
|
[eigen]: https://github.com/artsy/eigen/
|
101
|
-
[versions]: lib/cocoapods-fix-react-native/versions
|
103
|
+
[versions]: https://github.com/orta/cocoapods-fix-react-native/tree/master/lib/cocoapods-fix-react-native/versions
|
@@ -1,3 +1,8 @@
|
|
1
|
+
# Notes:
|
2
|
+
#
|
3
|
+
# - All file paths should be relative to the React repo, rather than the Pods dir, or node_modules
|
4
|
+
#
|
5
|
+
|
1
6
|
# Are you using :path based Pods?
|
2
7
|
dev_pods_react = !File.directory?('Pods/React/React')
|
3
8
|
|
@@ -6,15 +11,15 @@ same_repo_node_modules = File.directory?('node_modules/react-native')
|
|
6
11
|
previous_repo_node_modules = File.directory?('../node_modules/react-native')
|
7
12
|
|
8
13
|
# Find out where the files could be rooted
|
9
|
-
root = 'Pods'
|
14
|
+
$root = 'Pods/React'
|
10
15
|
if dev_pods_react
|
11
|
-
root = 'node_modules/react-native' if same_repo_node_modules
|
12
|
-
root = '../node_modules/react-native' if previous_repo_node_modules
|
16
|
+
$root = 'node_modules/react-native' if same_repo_node_modules
|
17
|
+
$root = '../node_modules/react-native' if previous_repo_node_modules
|
13
18
|
end
|
14
19
|
|
15
20
|
# TODO: move to be both file in pods and file in node_mods?
|
16
21
|
def edit_pod_file(path, old_code, new_code)
|
17
|
-
file = File.join(root, path)
|
22
|
+
file = File.join($root, path)
|
18
23
|
code = File.read(file)
|
19
24
|
if code.include?(old_code)
|
20
25
|
FileUtils.chmod('+w', file)
|
@@ -23,7 +28,7 @@ def edit_pod_file(path, old_code, new_code)
|
|
23
28
|
end
|
24
29
|
|
25
30
|
def fix_cplusplus_header_compiler_error
|
26
|
-
filepath = File.join(root, '
|
31
|
+
filepath = File.join($root, 'React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.h')
|
27
32
|
FileUtils.chmod('+w', filepath)
|
28
33
|
|
29
34
|
contents = []
|
@@ -72,15 +77,15 @@ fix_unused_yoga_headers
|
|
72
77
|
fix_cplusplus_header_compiler_error
|
73
78
|
|
74
79
|
# https://github.com/facebook/react-native/pull/14664
|
75
|
-
animation_view_file = '
|
80
|
+
animation_view_file = 'Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h'
|
76
81
|
animation_view_old_code = 'import <RCTAnimation/RCTValueAnimatedNode.h>'
|
77
82
|
animation_view_new_code = 'import "RCTValueAnimatedNode.h"'
|
78
83
|
edit_pod_file animation_view_file, animation_view_old_code, animation_view_new_code
|
79
84
|
|
80
85
|
# https://github.com/facebook/react-native/issues/13198
|
81
86
|
# Only needed when you have the DevSupport subspec
|
82
|
-
if File.exist?(File.join(root, '
|
83
|
-
websocket = '
|
87
|
+
if File.exist?(File.join($root, 'Libraries/WebSocket/RCTReconnectingWebSocket.m'))
|
88
|
+
websocket = 'Libraries/WebSocket/RCTReconnectingWebSocket.m'
|
84
89
|
websocket_old_code = 'import <fishhook/fishhook.h>'
|
85
90
|
websocket_new_code = 'import <React/fishhook.h>'
|
86
91
|
edit_pod_file websocket, websocket_old_code, websocket_new_code
|
@@ -88,8 +93,8 @@ end
|
|
88
93
|
|
89
94
|
# Newer build of Xcode don't allow you to set a non-obj to be strong,
|
90
95
|
# so this instead changes it to be an assign.
|
91
|
-
module_data_file = 'React/
|
92
|
-
bridge_module_file = 'React/
|
96
|
+
module_data_file = 'React/Base/RCTModuleData.h'
|
97
|
+
bridge_module_file = 'React/Base/RCTBridgeModule.h'
|
93
98
|
method_queue_old_code = '(nonatomic, strong, readonly) dispatch_queue_t methodQueue'
|
94
99
|
method_queue_new_code = '(nonatomic, assign, readonly) dispatch_queue_t methodQueue'
|
95
100
|
edit_pod_file module_data_file, method_queue_old_code, method_queue_new_code
|