cocoapods-fix-react-native 2018.08.29.00 → 2018.09.11.01

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: 001e0f593cdcd65af4265438c3610adb44086d795742af9d601c916be1c1cde7
4
- data.tar.gz: 8eec5ec9d2de9ef0dcf247a16eadcd54248c742c908216b746de34fcf49dff3a
3
+ metadata.gz: 16043d29888926a35830a166600f931a6031f80161694a285ef9ad30bf0aeac2
4
+ data.tar.gz: 11807baa08e8570c4aacd30440887894161bcb2e6cebcbb723cbc7a5bad03684
5
5
  SHA512:
6
- metadata.gz: cfb224cb835b28a0c0e232e90f4e2dcb2b1a26fa1629e575da38e9bc79310fce2dab3621a25264ce8446e8532e55161379c2ab7ae62e407fb57ac5e88a32863e
7
- data.tar.gz: 1646ba793507e579db35347d95b5d526498546711c6ea34887b2900ba5bb33156607f6a38cd11e20ec24458de74045e944301a064ee163dc0c59bb1bf58049bc
6
+ metadata.gz: 08789f6958b527c0e03af79d294caf50db3eb786daf8e17c5bb72affda4493358a96b0d1d6c8c150fa2c79aa0c6b0e13eb6f6cbd58ed4e02c7065ebdec3c8b8a
7
+ data.tar.gz: 53a5e0fe2190997ca51f788b4f6a358c22928ba1e698fd9b46d1c3aa16493a2201594ce2b966292bc13700a329e7a714923e8418c69528a2f3ad4a31840d83c1
@@ -0,0 +1,60 @@
1
+ require 'cocoapods'
2
+ require 'cocoapods-fix-react-native/helpers/root_helper'
3
+
4
+ # Obtain the React Native root directory
5
+ $root = get_root
6
+
7
+ # Detect CocoaPods + Frameworks
8
+ $has_frameworks = File.exists?'Pods/Target Support Files/React/React-umbrella.h'
9
+
10
+ # TODO: move to be both file in pods and file in node_mods?
11
+ def patch_pod_file(path, old_code, new_code)
12
+ file = File.join($root, path)
13
+ unless File.exist?(file)
14
+ Pod::UI.warn "#{file} does not exist so was not patched.."
15
+ return
16
+ end
17
+ code = File.read(file)
18
+ if code.include?(old_code)
19
+ Pod::UI.message "Patching #{file}", '- '
20
+ FileUtils.chmod('+w', file)
21
+ File.write(file, code.sub(old_code, new_code))
22
+ end
23
+ end
24
+
25
+ # Detect source file dependency in the generated Pods.xcodeproj workspace sub-project
26
+ def has_pods_project_source_file(source_filename)
27
+ pods_project = 'Pods/Pods.xcodeproj/project.pbxproj'
28
+ File.open(pods_project).grep(/#{source_filename}/).any?
29
+ end
30
+
31
+ # Detect dependent source file required for building when the given source file is present
32
+ def meets_pods_project_source_dependency(source_filename, dependent_source_filename)
33
+ has_pods_project_source_file(source_filename) ? has_pods_project_source_file(dependent_source_filename) : true
34
+ end
35
+
36
+ def detect_missing_subspec_dependency(subspec_name, source_filename, dependent_source_filename)
37
+ unless meets_pods_project_source_dependency(source_filename, dependent_source_filename)
38
+ Pod::UI.warn "#{subspec_name} subspec may be required given your current dependencies"
39
+ end
40
+ end
41
+
42
+ def detect_missing_subspecs
43
+ return unless $has_frameworks
44
+
45
+ # For CocoaPods + Frameworks, RCTNetwork and CxxBridge subspecs are necessary for DevSupport.
46
+ # When the React pod is generated it must include all the required source, and see umbrella deps.
47
+ detect_missing_subspec_dependency('RCTNetwork', 'RCTBlobManager.mm', 'RCTNetworking.mm')
48
+ detect_missing_subspec_dependency('CxxBridge', 'RCTJavaScriptLoader.mm', 'RCTCxxBridge.mm')
49
+
50
+ # RCTText itself shouldn't require DevSupport, but it depends on Core -> RCTDevSettings -> RCTPackagerClient
51
+ detect_missing_subspec_dependency('DevSupport', 'RCTDevSettings.mm', 'RCTPackagerClient.m')
52
+ end
53
+
54
+ detect_missing_subspecs
55
+
56
+ # # https://github.com/facebook/react-native/pull/14664
57
+ animation_view_file = 'Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h'
58
+ animation_view_old_code = 'import <RCTAnimation/RCTValueAnimatedNode.h>'
59
+ animation_view_new_code = 'import "RCTValueAnimatedNode.h"'
60
+ patch_pod_file animation_view_file, animation_view_old_code, animation_view_new_code
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-fix-react-native
3
3
  version: !ruby/object:Gem::Version
4
- version: 2018.08.29.00
4
+ version: 2018.09.11.01
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-29 00:00:00.000000000 Z
11
+ date: 2018-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ files:
62
62
  - lib/cocoapods-fix-react-native/versions/0_55_3-post.rb
63
63
  - lib/cocoapods-fix-react-native/versions/0_55_4-post.rb
64
64
  - lib/cocoapods-fix-react-native/versions/0_56_0-post.rb
65
+ - lib/cocoapods-fix-react-native/versions/0_56_1-post.rb
65
66
  - lib/cocoapods_plugin.rb
66
67
  - spec/command/native_spec.rb
67
68
  - spec/spec_helper.rb