react_native_util 0.2.0 → 0.2.1

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: ee275507e4938a754820b5f6f57ad9ea84c7a3776994678014466610ceed3eb8
4
- data.tar.gz: 18b76367f8df90fd0cf53616e36f4935b88d2abc50dcb360e824517c28ec228c
3
+ metadata.gz: 11ea13b794e259fd108a7ee0bde1fea6fdd26f1d2a2b8caf407eb4f3f84bad10
4
+ data.tar.gz: 8d1b5bab6d808249ae166ccda1db6022f7733b9e62843099a070be54b13d008a
5
5
  SHA512:
6
- metadata.gz: f99663e838c47561e06e62ce2ad252461ad8e9d7ab99c3e416542bee174dd39205feb89c71cac49dfb0899dfc2e519593d99c595cee1afb73f00619e3edfb099
7
- data.tar.gz: 498a37155945ca93d42c8de8dab9f7c77aea8eeec275b84e7e7bb1f92acc2bf980b0d4a34cdfb2a059a794c6b4820ec56e7f9d36b41e4de0e3b30640ee772ec2
6
+ metadata.gz: '0369e513d78c6a581fd53c5e95e7ce9f066f7d161371917442b548bb474c0ae7996622dec6ca92bc93b436ee075d01c7302fa8504e7deed8149f9ca1c5fc576a'
7
+ data.tar.gz: 5775dbf8bf502d8d611f62106fb8289fbb5701ea266e365a924e5a4675d19dc5beed0a2d8ebf1bee889657a1dcf6a5b3d94b8dc74f16ab809f114cac4c6c69d8
data/README.md CHANGED
@@ -65,34 +65,34 @@ git status
65
65
 
66
66
  _Typical command output:_
67
67
  ```
68
- 2019-05-11T12:06:17-07:00 react_native_util react_pod v0.2.0
69
- 2019-05-11T12:06:17-07:00 Darwin 18.5.0 x86_64
70
- 2019-05-11T12:06:17-07:00 Ruby 2.6.3: ~/.rvm/rubies/ruby-2.6.3/bin/ruby
71
- 2019-05-11T12:06:17-07:00 RubyGems 3.0.3: ~/.rvm/rubies/ruby-2.6.3/bin/gem
72
- 2019-05-11T12:06:17-07:00 Bundler 2.0.1: ~/.rvm/gems/ruby-2.6.3/bin/bundle
73
- 2019-05-11T12:06:17-07:00 react-native-cli: /usr/local/bin/react-native
74
- 2019-05-11T12:06:17-07:00 react-native-cli: 2.0.1
75
- 2019-05-11T12:06:17-07:00 react-native: 0.59.8
76
- 2019-05-11T12:06:18-07:00 yarn 1.16.0: /usr/local/bin/yarn
77
- 2019-05-11T12:06:18-07:00 cocoapods 1.6.1: ~/.rvm/gems/ruby-2.6.3/bin/pod
78
- 2019-05-11T12:06:18-07:00 cocoapods-core: 1.6.1
79
- 2019-05-11T12:06:18-07:00 package.json:
80
- 2019-05-11T12:06:18-07:00 app name: "TestApp"
81
- 2019-05-11T12:06:18-07:00 Found Xcode project at ~/sandbox/TestApp/ios/TestApp.xcodeproj
82
- 2019-05-11T12:06:18-07:00 Installing NPM dependencies with yarn
68
+ 2019-05-11T12:25:14-07:00 react_native_util react_pod v0.2.0
69
+ 2019-05-11T12:25:14-07:00 Installed from Homebrew
70
+ 2019-05-11T12:25:14-07:00 Darwin 18.5.0 x86_64
71
+ 2019-05-11T12:25:14-07:00 Ruby 2.3.7: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
72
+ 2019-05-11T12:25:14-07:00 RubyGems 2.6.14: /usr/bin/gem
73
+ 2019-05-11T12:25:14-07:00 react-native-cli: /usr/local/bin/react-native
74
+ 2019-05-11T12:25:14-07:00 react-native-cli: 2.0.1
75
+ 2019-05-11T12:25:14-07:00 react-native: 0.59.8
76
+ 2019-05-11T12:25:14-07:00 yarn 1.16.0: /usr/local/bin/yarn
77
+ 2019-05-11T12:25:15-07:00 cocoapods 1.6.1: /usr/local/bin/pod
78
+ 2019-05-11T12:25:15-07:00 cocoapods-core: 1.6.1
79
+ 2019-05-11T12:25:15-07:00 package.json:
80
+ 2019-05-11T12:25:15-07:00 app name: "TestApp"
81
+ 2019-05-11T12:25:15-07:00 Found Xcode project at ~/sandbox/TestApp/ios/TestApp.xcodeproj
82
+ 2019-05-11T12:25:15-07:00 Installing NPM dependencies with yarn
83
83
  [✔] yarn success in 0.8 s
84
- 2019-05-11T12:06:19-07:00 Dependencies:
85
- 2019-05-11T12:06:19-07:00 react-native-webview
86
- 2019-05-11T12:06:19-07:00 Unlinking dependencies
87
- [✔] react-native unlink react-native-webview success in 0.5 s
88
- 2019-05-11T12:06:20-07:00 Removing Libraries from TestApp
89
- 2019-05-11T12:06:20-07:00 Removing Libraries from TestAppTests
90
- 2019-05-11T12:06:20-07:00 Removing Libraries group
91
- 2019-05-11T12:06:20-07:00 Generating ios/Podfile
92
- 2019-05-11T12:06:20-07:00 Linking dependencies
93
- [✔] react-native link react-native-webview success in 0.5 s
94
- 2019-05-11T12:06:20-07:00 Generating Pods project and ios/TestApp.xcworkspace
95
- [✔] pod install success in 7.4 s
96
- 2019-05-11T12:06:28-07:00 Conversion complete ✅
97
- 2019-05-11T12:06:28-07:00 $ open ios/TestApp.xcworkspace
84
+ 2019-05-11T12:25:16-07:00 Dependencies:
85
+ 2019-05-11T12:25:16-07:00 react-native-webview
86
+ 2019-05-11T12:25:16-07:00 Unlinking dependencies
87
+ [✔] react-native unlink react-native-webview success in 0.6 s
88
+ 2019-05-11T12:25:17-07:00 Removing Libraries from TestApp
89
+ 2019-05-11T12:25:17-07:00 Removing Libraries from TestAppTests
90
+ 2019-05-11T12:25:17-07:00 Removing Libraries group
91
+ 2019-05-11T12:25:17-07:00 Generating ios/Podfile
92
+ 2019-05-11T12:25:17-07:00 Linking dependencies
93
+ [✔] react-native link react-native-webview success in 0.6 s
94
+ 2019-05-11T12:25:17-07:00 Generating Pods project and ios/TestApp.xcworkspace
95
+ [✔] pod install success in 10.5 s
96
+ 2019-05-11T12:25:28-07:00 Conversion complete ✅
97
+ 2019-05-11T12:25:28-07:00 $ open ios/TestApp.xcworkspace
98
98
  ```
@@ -1,4 +1,4 @@
1
- platform :ios, '9.0'
1
+ platform :ios, '<%= app_target.deployment_target %>'
2
2
 
3
3
  target '<%= app_name %>' do
4
4
  pod 'React',
@@ -87,7 +87,6 @@ module ReactNativeUtil
87
87
  log 'Installing NPM dependencies with yarn'
88
88
  run_command_with_spinner! 'yarn', log: File.join(Dir.tmpdir, 'yarn.log')
89
89
 
90
- # Unused, but should be there and parseable
91
90
  load_react_podspec!
92
91
 
93
92
  # 2. Detect native dependencies in Libraries group.
@@ -254,6 +253,10 @@ module ReactNativeUtil
254
253
  @app_name ||= package_json['name']
255
254
  end
256
255
 
256
+ def app_target
257
+ xcodeproj.targets.find { |t| t.name == app_name }
258
+ end
259
+
257
260
  def test_target
258
261
  xcodeproj.targets.select(&:test_target_type?).reject { |t| t.name =~ /tvOS/ }.first
259
262
  end
@@ -261,7 +264,6 @@ module ReactNativeUtil
261
264
  # Validate an assumption about the project. TODO: Provide override option.
262
265
  # @raise ConversionError if an application target is not found with the same name as the project.
263
266
  def validate_app_target!
264
- app_target = xcodeproj.targets.find { |t| t.name = app_name }
265
267
  raise ConversionError, "Unable to find target #{app_name} in #{xcodeproj_path}." if app_target.nil?
266
268
  raise ConversionError, "Target #{app_name} is not an application target." unless app_target.product_type == 'com.apple.product-type.application'
267
269
  end
@@ -319,9 +321,7 @@ module ReactNativeUtil
319
321
  # location of project is different relative to packager script
320
322
  script = old_packager_phase.shell_script.gsub(%r{../scripts}, '../node_modules/react-native/scripts')
321
323
 
322
- # target can't be nil. Already validated earlier by #validate_app_target!
323
- target = xcodeproj.targets.find { |t| t.name == app_name }
324
- phase = target.new_shell_script_build_phase old_packager_phase.name
324
+ phase = app_target.new_shell_script_build_phase old_packager_phase.name
325
325
  phase.shell_script = script
326
326
  end
327
327
 
@@ -1,7 +1,7 @@
1
1
  # Conversion tools for React Native projects
2
2
  module ReactNativeUtil
3
3
  NAME = 'react_native_util'
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  SUMMARY = 'Community utility CLI for React Native projects'
6
6
  DESCRIPTION = 'Automatically modifies a project created with react-native ' \
7
7
  'init to use the React pod from node_modules.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_native_util
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Dee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-11 00:00:00.000000000 Z
11
+ date: 2019-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods