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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1f43a7f65ef774c954ccd90a5b7ab1d3449e4684003df50b4b59daddeb88241
4
- data.tar.gz: 539c82b1163f6f822031585b4c54a1fe97c566466ef3210ef35d1d291fff5dfd
3
+ metadata.gz: 909cc9e8295d7fa0da87935d9fe3972916e14542c42631505505d85af7cadb17
4
+ data.tar.gz: b7f55a3992638707eb71d786e1d1092df0698c7f26e4d3dfef7dd718c54b0588
5
5
  SHA512:
6
- metadata.gz: e754efc68132ba0123c2fdb82541c9a6d3be05f82b70bc4b007b96016bd790ee66f404e7163d168bf27e7001f14d716c0555d61d9557e242928997d373bb9046
7
- data.tar.gz: 39a36d5382250facb29740cf8d631d26b29910375f343f7da9f3cb4b9d74e5537352169cbde954a4782f69f90652debba5f58203e66e9f68b8481e3fde7878a6
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 _we, the community_, can use to plug the holes in React Native's CocoaPods
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 update
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/` - it wants to also handle `node_modules/react-native` and
74
- `../node_modules/react-native`. This can be done by removing `'Pods'` from the path and wrapping it with a
75
- `File.join(root, 'Path/InReactLib.js')`.
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, 'Pods/React/React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.h')
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 = 'React/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h'
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, 'React/Libraries/WebSocket/RCTReconnectingWebSocket.m'))
83
- websocket = 'React/Libraries/WebSocket/RCTReconnectingWebSocket.m'
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/React/Base/RCTModuleData.h'
92
- bridge_module_file = 'React/React/Base/RCTBridgeModule.h'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-fix-react-native
3
3
  version: !ruby/object:Gem::Version
4
- version: 2018.04.01.16
4
+ version: 2018.04.01.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox