Skip to content

Commit 4e8526c

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Add CircleCI tests for use frameworks (#35497)
Summary: Pull Request resolved: #35497 In 0.71.0-RC.2, we had a regression in `use_frameworks!`. This adds some CircleCI jobs to make sure we do not regress on those. It also updates the template to support these tests. ## Changelog [iOS][Added] - CircleCI jobs to keep the use_framework! setup in check for the Old Arch Reviewed By: cortinico Differential Revision: D41551288 fbshipit-source-id: 531fabb1a7b6aceab2926bb83cf2887129df1776
1 parent 3d7b53d commit 4e8526c

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.circleci/config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,11 @@ jobs:
817817
description: Whether Flipper is enabled. Must be one of "WithFlipper", "WithoutFlipper".
818818
type: enum
819819
enum: ["WithFlipper", "WithoutFlipper"]
820+
use_frameworks:
821+
default: "StaticLibraries"
822+
description: Which kind of option we want to use for `use_frameworks!`
823+
type: enum
824+
enum: ["StaticLibraries", "StaticFrameworks"] #TODO: Add "DynamicFrameworks"
820825
environment:
821826
- PROJECT_NAME: "iOSTemplateProject"
822827
- HERMES_WS_DIR: *hermes_workspace_root
@@ -831,6 +836,24 @@ jobs:
831836
steps:
832837
- run:
833838
command: circleci-agent step halt # this interrupts the job successfully.
839+
# use_frameworks! does not works with Flipper enabled
840+
- when:
841+
condition:
842+
and:
843+
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
844+
- equal: [ << parameters.flipper >>, "WithFlipper" ]
845+
steps:
846+
- run:
847+
command: circleci-agent step halt # this interrupts the job successfully.
848+
# use_frameworks! does not works with the New Architecture enabled
849+
- when:
850+
condition:
851+
and:
852+
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
853+
- equal: [ << parameters.architecture >>, "NewArch" ]
854+
steps:
855+
- run:
856+
command: circleci-agent step halt # this interrupts the job successfully.
834857
# Valid configuration, we can continue
835858
- checkout_code_with_cache
836859
- run_yarn
@@ -878,6 +901,10 @@ jobs:
878901
export NO_FLIPPER=1
879902
fi
880903
904+
if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
905+
export USE_FRAMEWORKS=static
906+
fi
907+
881908
bundle exec pod install
882909
- run:
883910
name: Build template project
@@ -1565,6 +1592,7 @@ workflows:
15651592
flavor: ["Debug", "Release"]
15661593
jsengine: ["Hermes", "JSC"]
15671594
flipper: ["WithFlipper", "WithoutFlipper"]
1595+
use_frameworks: [ "StaticLibraries", "StaticFrameworks" ] #TODO: make it works with DynamicFrameworks
15681596
- test_ios_rntester:
15691597
requires:
15701598
- build_hermes_macos

template/ios/Podfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ prepare_react_native_project!
66

77
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
88

9+
linkage = ENV['USE_FRAMEWORKS']
10+
if linkage != nil
11+
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
12+
use_frameworks! :linkage => linkage.to_sym
13+
end
14+
915
target 'HelloWorld' do
1016
config = use_native_modules!
1117

0 commit comments

Comments
 (0)