Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Metrics/MethodLength:
Enabled: false

Metrics/CyclomaticComplexity:
IgnoredMethods: [make_project!, use_test_app_internal!]
IgnoredMethods: [make_project!, react_native_pods, use_test_app_internal!]

Metrics/PerceivedComplexity:
IgnoredMethods: [make_project!, use_test_app_internal!]
IgnoredMethods: [make_project!, react_native_pods, use_test_app_internal!]

Naming/FileName:
Exclude:
Expand Down
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ repositories {
jcenter() {
content {
includeGroup("com.facebook.fbjni")
includeGroup("com.facebook.flipper")
includeGroup("com.facebook.fresco")
includeGroup("com.facebook.yoga")
includeGroup("com.facebook.flipper")
includeGroup("com.facebook.fresco")
includeGroup("com.facebook.yoga")
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion ios/test_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def react_native_path(project_root, target_platform)

def react_native_pods(version)
v = version.release
if v == Gem::Version.new('0.0.0') || v >= Gem::Version.new('0.63')
if v == Gem::Version.new('0.0.0') || v >= Gem::Version.new('0.64')
'use_react_native-0.64'
elsif v >= Gem::Version.new('0.63')
'use_react_native-0.63'
elsif v >= Gem::Version.new('0.62')
'use_react_native-0.62'
Expand Down
5 changes: 0 additions & 5 deletions ios/use_react_native-0.63.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ def include_react_native!(options)
use_flipper!(flipper_versions) if target_platform == :ios && flipper_versions
use_react_native!(options)

# In 0.64, `react_native_post_install` should be called instead
if defined?(react_native_post_install)
return ->(installer) { react_native_post_install(installer) }
end

if target_platform == :macos
return lambda { |installer|
begin
Expand Down
17 changes: 17 additions & 0 deletions ios/use_react_native-0.64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def include_react_native!(options)
react_native, flipper_versions, project_root, target_platform = options.values_at(
:path, :rta_flipper_versions, :rta_project_root, :rta_target_platform
)

require_relative(File.join(project_root, react_native, 'scripts', 'react_native_pods'))

use_flipper!(flipper_versions) if target_platform == :ios && flipper_versions
use_react_native!(options)

lambda { |installer|
react_native_post_install(installer)
if defined?(__apply_Xcode_12_5_M1_post_install_workaround)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
}
end
2 changes: 1 addition & 1 deletion scripts/set-react-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const os = require("os");

const VALID_TAGS = ["canary-macos", "canary-windows", "main", "nightly"];
const REACT_NATIVE_VERSIONS = {
"canary-macos": "^0.64",
"canary-macos": "^0.66",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a simple question for me to learn - here you can put 0.66 already even if it's not out yet?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(as far as I can see, the canary macos on npm have the 0.0.0-hash format)

Copy link
Member Author

@tido64 tido64 Jan 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for pointing at the correct version of react-native to install with react-native-macos. The latter doesn't specify which version to use because it is self-contained, but I think cli complains if it cannot find react-native.

"canary-windows": "^0.67.0-0",
};

Expand Down
7 changes: 5 additions & 2 deletions test/test_test_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ def test_package_version
end

def test_react_native_pods
assert_equal('use_react_native-0.63', react_native_pods(Gem::Version.new('1000.0.0')))
assert_equal('use_react_native-0.64', react_native_pods(Gem::Version.new('1000.0.0')))

assert_equal('use_react_native-0.64', react_native_pods(Gem::Version.new('0.64.0')))
assert_equal('use_react_native-0.64', react_native_pods(Gem::Version.new('0.64.0-rc.1')))

assert_equal('use_react_native-0.63', react_native_pods(Gem::Version.new('0.63.4')))
assert_equal('use_react_native-0.63', react_native_pods(Gem::Version.new('0.63.0')))
assert_equal('use_react_native-0.63', react_native_pods(Gem::Version.new('0.63.0-rc.1')))

assert_equal('use_react_native-0.62', react_native_pods(Gem::Version.new('0.62.2')))
assert_equal('use_react_native-0.62', react_native_pods(Gem::Version.new('0.62.0')))
Expand Down