Skip to content

Commit

Permalink
Add Fabric/Turbo Modules flags to iOS autolinking script (#24867)
Browse files Browse the repository at this point in the history
Summary:
This makes it easier to enable fabric / turbo modules with the new fancy autolinking script.

## Changelog

[iOS] [Added] - Add Fabric/Turbo Module flags to iOS autolinking script
Pull Request resolved: #24867

Differential Revision: D15368550

Pulled By: fkgozali

fbshipit-source-id: 366cd9fb8b630011f9287ae762b985e4778de423
  • Loading branch information
ericlewis authored and facebook-github-bot committed May 16, 2019
1 parent a352ecf commit 9004029
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
10 changes: 2 additions & 8 deletions RNTester/Podfile
Expand Up @@ -7,7 +7,7 @@ target 'RNTester' do
# use_frameworks!

project 'RNTesterPods.xcodeproj'
use_react_native!(path: "..")
use_react_native!(path: "..", turbo_modules_enabled: true)

# Additional Pods which aren't included in the default Podfile
pod 'React-RCTCameraRoll', :path => '../Libraries/CameraRoll'
Expand All @@ -16,13 +16,7 @@ target 'RNTester' do

# Additional Pods which are classed as unstable
#
# Fabric Pods, uncomment these to enable in RNTester
# pod 'React-Fabric', :path => '../ReactCommon'
# pod 'React-graphics', :path => '../ReactCommon/fabric/graphics'
# pod 'React-jsi/Fabric', :path => '../ReactCommon/jsi'
# pod 'React-RCTFabric', :path => '../React'
# pod 'Folly/Fabric', :podspec => '../third-party-podspecs/Folly.podspec'
# To use fabric: add `fabric_enabled` option to the use_react_native method above

pod 'React-turbomodule-core', :path => '../ReactCommon/turbomodule/core'
pod 'React-turbomodule-samples', :path => '../ReactCommon/turbomodule/samples'
end
18 changes: 18 additions & 0 deletions scripts/autolink-ios.rb
Expand Up @@ -2,6 +2,12 @@ def use_react_native! (options={})

# The prefix to the react-native
prefix = options[:path] ||= "../node_modules/react-native"

# Include Fabric dependencies
fabric_enabled = options[:fabric_enabled] ||= false

# Include Turbo Modules dependencies
turbo_modules_enabled = options[:turbo_modules_enabled ||= false

# Include DevSupport dependency
production = options[:production] ||= false
Expand Down Expand Up @@ -35,4 +41,16 @@ def use_react_native! (options={})
pod 'DoubleConversion', :podspec => "#{prefix}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{prefix}/third-party-podspecs/Folly.podspec"

if fabric_enabled
pod 'React-Fabric', :path => "#{prefix}/ReactCommon"
pod 'React-graphics', :path => "#{prefix}/ReactCommon/fabric/graphics"
pod 'React-jsi/Fabric', :path => "#{prefix}/ReactCommon/jsi"
pod 'React-RCTFabric', :path => "#{prefix}/React"
pod 'Folly/Fabric', :podspec => "#{prefix}/third-party-podspecs/Folly.podspec"
end

if turbo_modules_enabled
pod 'React-turbomodule-core', :path => "#{prefix}/ReactCommon/turbomodule/core"
end
end

0 comments on commit 9004029

Please sign in to comment.