Skip to content

Commit

Permalink
fix(macOS): Add support for react-native-macos v0.62 (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 committed Aug 26, 2020
1 parent ef27b46 commit e73a4d8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"peerDependencies": {
"react": "~16.8.6 || ~16.9.0 || ~16.11.0 || ~16.13.1",
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63 || 1000.0.0",
"react-native-macos": "^0.60 || ^0.61.39"
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63.2 || 1000.0.0",
"react-native-macos": "^0.60.0 || ^0.61.0 || ^0.62.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
Expand Down
10 changes: 10 additions & 0 deletions ios/pod_helpers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

def try_pod(name, podspec, project_root)
pod name, :podspec => podspec if File.exist?(File.join(project_root, podspec))
end
9 changes: 6 additions & 3 deletions ios/use_react_native-0.60.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#
# rubocop:disable Layout/LineLength

require_relative('pod_helpers.rb')

def include_react_native!(react_native:, target_platform:, project_root:, flipper_versions:)
pod 'React', :path => react_native
pod 'React-Core', :path => "#{react_native}/React", :inhibit_warnings => true
Expand Down Expand Up @@ -36,9 +38,10 @@ def include_react_native!(react_native:, target_platform:, project_root:, flippe
pod 'glog', :podspec => "#{react_native}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{react_native}/third-party-podspecs/Folly.podspec"

# Required by `react-native-macos` otherwise it will find Boost elsewhere
boost = "#{react_native}/third-party-podspecs/boost-for-react-native.podspec"
pod 'boost-for-react-native', :podspec => boost if File.exist?(File.join(project_root, boost))
# Required by `react-native-macos`; otherwise it will find Boost elsewhere
try_pod('boost-for-react-native',
"#{react_native}/third-party-podspecs/boost-for-react-native.podspec",
project_root)
end

# rubocop:enable Layout/LineLength
12 changes: 11 additions & 1 deletion ios/use_react_native-0.62.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#
# rubocop:disable Layout/LineLength

require_relative('pod_helpers.rb')

def add_flipper_pods!(versions = {})
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
Expand Down Expand Up @@ -70,7 +72,15 @@ def include_react_native!(react_native:, target_platform:, project_root:, flippe

pod 'DoubleConversion', :podspec => "#{react_native}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{react_native}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{react_native}/third-party-podspecs/Folly.podspec"

# `react-native` pods
try_pod('Folly', "#{react_native}/third-party-podspecs/Folly.podspec", project_root)

# `react-native-macos` pods
try_pod('RCT-Folly', "#{react_native}/third-party-podspecs/RCT-Folly.podspec", project_root)
try_pod('boost-for-react-native',
"#{react_native}/third-party-podspecs/boost-for-react-native.podspec",
project_root)
end

# rubocop:enable Layout/LineLength
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"peerDependencies": {
"react": "~16.8.6 || ~16.9.0 || ~16.11.0 || ~16.13.1",
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63 || 1000.0.0",
"react-native-macos": "^0.60 || ^0.61.39"
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63.2 || 1000.0.0",
"react-native-macos": "^0.60.0 || ^0.61.0 || ^0.62.0"
},
"peerDependenciesMeta": {
"react-native-macos": {
Expand Down

0 comments on commit e73a4d8

Please sign in to comment.