Skip to content

Commit 3eca023

Browse files
committed
add RNRepo to TVOSExample
1 parent 8063ab9 commit 3eca023

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

TVOSExample/ios/Podfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ require Pod::Executable.execute_command('node', ['-p',
55
{paths: [process.argv[1]]},
66
)', __dir__]).strip
77

8+
def is_ci_enabled?
9+
%w[1 true].include?(ENV['CI'].to_s.downcase)
10+
end
11+
12+
# ENV['DISABLE_RNREPO'] = "1" # Uncomment to disable RNRepo even in CI
13+
def is_rnrepo_enabled?
14+
ENV['DISABLE_RNREPO'].nil?
15+
end
16+
17+
# Use RNRepo in CI builds. Set DISABLE_RNREPO to any value to disable RNRepo.
18+
if is_ci_enabled? && is_rnrepo_enabled?
19+
require Pod::Executable.execute_command('node', ['-p',
20+
'require.resolve(
21+
"@rnrepo/build-tools/cocoapods-plugin/lib/plugin.rb",
22+
{paths: [process.argv[1]]},
23+
)', __dir__]).strip
24+
end
25+
826
require_relative '../../scripts/ios/rns_set_swift_compilation_flags'
927

1028
platform :tvos, min_ios_version_supported
@@ -26,6 +44,9 @@ target 'TVOSExample' do
2644
)
2745

2846
post_install do |installer|
47+
if is_ci_enabled? && is_rnrepo_enabled?
48+
rnrepo_post_install(installer)
49+
end
2950
react_native_post_install(
3051
installer,
3152
config[:reactNativePath],

TVOSExample/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@react-native/jest-preset": "0.85.0",
4646
"@react-native/metro-config": "0.85.0",
4747
"@react-native/typescript-config": "0.85.0",
48+
"@rnrepo/build-tools": "~0.1.3-beta.0",
4849
"@types/jest": "^29.5.13",
4950
"@types/react": "^19.2.0",
5051
"@types/react-test-renderer": "^19.1.0",

TVOSExample/yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,6 +3002,13 @@ __metadata:
30023002
languageName: node
30033003
linkType: soft
30043004

3005+
"@rnrepo/build-tools@npm:~0.1.3-beta.0":
3006+
version: 0.1.3-beta.0
3007+
resolution: "@rnrepo/build-tools@npm:0.1.3-beta.0"
3008+
checksum: 10c0/83d2c2b05d87ab038d139c56b2e8ea1df071c41a51094a6464d9c7bc5794f25eb289b8b9298418e829d9ebfe723a77d5556fb1eaf69d87b25dda1f7d19d2d5fb
3009+
languageName: node
3010+
linkType: hard
3011+
30053012
"@sideway/address@npm:^4.1.5":
30063013
version: 4.1.5
30073014
resolution: "@sideway/address@npm:4.1.5"
@@ -3388,6 +3395,7 @@ __metadata:
33883395
"@react-navigation/native-stack": "link:../react-navigation/packages/native-stack/"
33893396
"@react-navigation/routers": "link:../react-navigation/packages/routers/"
33903397
"@react-navigation/stack": "link:../react-navigation/packages/stack/"
3398+
"@rnrepo/build-tools": "npm:~0.1.3-beta.0"
33913399
"@types/jest": "npm:^29.5.13"
33923400
"@types/react": "npm:^19.2.0"
33933401
"@types/react-test-renderer": "npm:^19.1.0"

0 commit comments

Comments
 (0)