Skip to content

Commit

Permalink
feat: add matrix for Debug/Release and New/Legacy architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccardo Cipolleschi committed Aug 31, 2022
1 parent ed21a3e commit ae3f627
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 49 deletions.
55 changes: 47 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,16 @@ jobs:
# -------------------------
test_ios_template:
executor: reactnativeios
parameters:
flavor:
type: string
default: "Debug"
newarchitecture:
type: string
default: "OldArch"
hermes:
type: string
default: "Hermes"
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root
Expand All @@ -689,25 +699,49 @@ jobs:
- attach_workspace:
at: .
- *attach_hermes_workspace
- run:
name: Set USE_HERMES=1
command: echo "export USE_HERMES=1" >> $BASH_ENV
- run:
name: Set HERMES_ENGINE_TARBALL_PATH
command: |
echo "export HERMES_ENGINE_TARBALL_PATH=$(ls -AU $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-*.tar.gz | head -1)" >> $BASH_ENV
- when:
condition:
equal: ["Hermes", << parameters.hermes >>]
steps:
- run:
name: Set HERMES_ENGINE_TARBALL_PATH
command: |
echo "export HERMES_ENGINE_TARBALL_PATH=$(ls -AU $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-*.tar.gz | head -1)" >> $BASH_ENV
- run:
name: Create iOS template project
command: |
REPO_ROOT=$(pwd)
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
node ./scripts/set-rn-template-version.js "file:$PATH_TO_PACKAGE"
node cli.js init $PROJECT_NAME --directory "/tmp/$PROJECT_NAME" --template $REPO_ROOT --verbose
node cli.js init $PROJECT_NAME --directory "/tmp/$PROJECT_NAME" --template $REPO_ROOT --verbose --skip-install
- run:
name: Install iOS dependencies - Configuration << parameters.flavor >>; New Architecture << parameters.newarchitecture >>
command: |
cd /tmp/$PROJECT_NAME
yarn install
cd ios
bundle install
if [[ << parameters.flavor >> == "Release" ]]; then
export PRODUCTION=1
fi
if [[ << parameters.newarchitecture >> == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
if [[ << parameters.hermes >> == "NoHermes" ]]; then
export USE_HERMES=0
fi
bundle exec pod install
- run:
name: Build template project
command: |
xcodebuild build \
-configuration << parameters.flavor >> \
-workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
-scheme $PROJECT_NAME \
-sdk iphonesimulator
Expand Down Expand Up @@ -1308,6 +1342,11 @@ workflows:
- test_ios_template:
requires:
- build_npm_package
matrix:
parameters:
newarchitecture: ["NewArch", "OldArch"]
flavor: ["Debug", "Release"]
hermes: ["Hermes", "NoHermes"]
- test_ios_rntester:
requires:
- build_hermes_macos
Expand Down
112 changes: 76 additions & 36 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ PODS:
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5)
- hermes-engine (1000.0.0)
- libevent (2.1.12)
- MyNativeView (0.0.1):
- RCTRequired
- RCTTypeSafety
- React
- React-Codegen
- React-RCTFabric
- ReactCommon/turbomodule/core
- OpenSSL-Universal (1.1.1100)
- RCT-Folly (2021.07.22.00):
- boost
Expand All @@ -91,6 +99,12 @@ PODS:
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly/Futures (2021.07.22.00):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- libevent
- RCTRequired (1000.0.0)
- RCTTypeSafety (1000.0.0):
- FBLazyVector (= 1000.0.0)
Expand Down Expand Up @@ -590,6 +604,17 @@ PODS:
- React-graphics (1000.0.0):
- RCT-Folly/Fabric (= 2021.07.22.00)
- React-Core/Default (= 1000.0.0)
- React-hermes (1000.0.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- RCT-Folly/Futures (= 2021.07.22.00)
- React-cxxreact (= 1000.0.0)
- React-jsi (= 1000.0.0)
- React-jsiexecutor (= 1000.0.0)
- React-jsinspector (= 1000.0.0)
- React-perflogger (= 1000.0.0)
- React-jsi (1000.0.0):
- boost (= 1.76.0)
- DoubleConversion
Expand Down Expand Up @@ -631,6 +656,8 @@ PODS:
- RCTRequired
- RCTTypeSafety
- React-Core
- React-graphics
- React-RCTFabric
- ReactCommon/turbomodule/core
- React-RCTBlob (1000.0.0):
- RCT-Folly (= 2021.07.22.00)
Expand Down Expand Up @@ -753,6 +780,9 @@ DEPENDENCIES:
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
- FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
- glog (from `../../third-party-podspecs/glog.podspec`)
- hermes-engine (from `../../sdks/hermes/hermes-engine.podspec`)
- libevent (~> 2.1.12)
- MyNativeView (from `NativeComponentExample`)
- OpenSSL-Universal (= 1.1.1100)
- RCT-Folly (from `../../third-party-podspecs/RCT-Folly.podspec`)
- RCT-Folly/Fabric (from `../../third-party-podspecs/RCT-Folly.podspec`)
Expand All @@ -769,6 +799,7 @@ DEPENDENCIES:
- React-cxxreact (from `../../ReactCommon/cxxreact`)
- React-Fabric (from `../../ReactCommon`)
- React-graphics (from `../../ReactCommon/react/renderer/graphics`)
- React-hermes (from `../../ReactCommon/hermes`)
- React-jsi (from `../../ReactCommon/jsi`)
- React-jsi/Fabric (from `../../ReactCommon/jsi`)
- React-jsiexecutor (from `../../ReactCommon/jsiexecutor`)
Expand Down Expand Up @@ -824,6 +855,10 @@ EXTERNAL SOURCES:
:path: "../../React/FBReactNativeSpec"
glog:
:podspec: "../../third-party-podspecs/glog.podspec"
hermes-engine:
:podspec: "../../sdks/hermes/hermes-engine.podspec"
MyNativeView:
:path: NativeComponentExample
RCT-Folly:
:podspec: "../../third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
Expand All @@ -848,6 +883,8 @@ EXTERNAL SOURCES:
:path: "../../ReactCommon"
React-graphics:
:path: "../../ReactCommon/react/renderer/graphics"
React-hermes:
:path: "../../ReactCommon/hermes"
React-jsi:
:path: "../../ReactCommon/jsi"
React-jsiexecutor:
Expand Down Expand Up @@ -899,8 +936,8 @@ SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 19e408e76fa9258dd32191a50d60c41444f52d29
FBReactNativeSpec: a9bf67b4be55c0819bc88e1721820286c1340710
FBLazyVector: 979053530829c71b739d57b6f6b001da3cd5009d
FBReactNativeSpec: 9402b50832dc060fcf51a762fbd8b69dc8ed6d82
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
Expand All @@ -912,44 +949,47 @@ SPEC CHECKSUMS:
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 8ac5043cbadb1f244c7c0a6a5baa76e64248c484
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
MyNativeView: 412ff641161c6577d85641afa32d5f4f8014a816
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
RCTRequired: 1c8808cf84569265784a6c33984bbb506ada8c6e
RCTTypeSafety: b6dcb5036a808864ee8cad66ca15f263c24661cc
React: 8d809d414723bb5763093ddec7658066a21ccabc
React-bridging: c8806159f8ef90f27443857eed1efdb8c85940e1
React-callinvoker: 5f16202ad4e45f0607b1fae0f6955a8f7c87eef1
React-Codegen: 5adf19af97eb37a7d441c040521191e446255086
React-Core: ce4282fb714ffbe444b84d296d1728eaee4d0e9f
React-CoreModules: 675170bccf156da3a3348e04e2036ce401b2010d
React-cxxreact: 7276467c246302fedf598cc40d7003896ddb20ba
React-Fabric: b49c8e76c926b5b6b708802759b27dd6e02bb4bc
React-graphics: 5ccc9cc0d91794fd42bc1c693e9aea207554bbef
React-jsi: a042596cb558abea721ab5e23cb175647610a73d
React-jsiexecutor: f7fbac5dff7e7ff110a66edf2626b4f4f4600ef5
React-jsinspector: 7733dd522d044aef87caa39f3eda77593358a7eb
React-logger: c7960346b021767ed90971aff592a44e3d69f8bb
React-perflogger: c4fdd48988c2d3047186fc1bc1772d634cfca2ea
React-RCTActionSheet: 166fd1df85ac10219466b45d12a5884d3eaceac1
React-RCTAnimation: d6127046c6bb44bd3e67b7503c4ad7f91131b58e
React-RCTAppDelegate: 475ca9b80e26c1c4aed93ce04363092fa78cf788
React-RCTBlob: 68675c89ebe6edf310dddd0774ba07b685f090a9
React-RCTFabric: a98a6effece6719669b8c6b4d2c33fb0edddc613
React-RCTImage: 6de9f0f4402af859849e97cc73a56a52f400f4c9
React-RCTLinking: 21bb4675c3ec8fe704672ea511e817aeb3bf8370
React-RCTNetwork: a865deadacbf6b3d863f0496e7d2c2e81c269317
React-RCTPushNotification: 7f678a88147254ede5d21a1e1e71e8a964dd0051
React-RCTSettings: 23ce1aa52ddf5db44c973bb5cc93713e871e09b6
React-RCTTest: 06c388632dc7b30df17af01c8f9e89e641b4d31c
React-RCTText: a861fbf2835299d3cc4189697cddd8bd8602afb9
React-RCTVibration: 0386f50996a153b3f39cecbe7d139763ac9a9fdf
React-rncore: 2a6ad37560e94cf7ff32e3f2ae1e708491b4c1f3
React-runtimeexecutor: 97dca9247f4d3cfe0733384b189c6930fbd402b7
ReactCommon: 8e39c4b24da570ea2b631accbf779b5891befe0c
ScreenshotManager: 71d047abd38a77310985b87f8136b620c5c61e88
RCTRequired: 0c0caa808e7c8d32f1832dc6e6a5e1aa9f9fae12
RCTTypeSafety: ba7f6885182630e53cf05a8c55db33bf8a827ffc
React: a9c2f5c7bbebaaef4169e49742928b629302fbd4
React-bridging: 6126b2c6a63550560fd74a1348d631a4b1800182
React-callinvoker: 87d892fce455552e1deef2f2607f68e2588469ae
React-Codegen: 146630f64f2a33223b383486ed36544d83b279f4
React-Core: b7bd989940b1682cabcfed69721af0458f9f1d57
React-CoreModules: d1e28c5e4a62b45e2dd70c9f36f537011b0fe516
React-cxxreact: ac1e017187f6ab3227d0b9fdd215a4872e7567dc
React-Fabric: 247e5840c4b49b3550191c5db74a3e515be2f270
React-graphics: 6e6a92e4314b724a86c6b19f733e4e4ef4329a04
React-hermes: 2540a8554b8672e1125c8f8f655c90fa3f4b3048
React-jsi: cb8f1bf66c13d8b5d8785fb1960f8084a65fbea2
React-jsiexecutor: 8d4efc3be662ac69c18c137c22c2d22ff5f8d3c2
React-jsinspector: 4ac63a330737eed3febcf83ac38fdd7c6d4f5205
React-logger: 35c78671d5d2f9132d695cb01246c7b8f9ac7be5
React-perflogger: a2f86ac636d8d92d2b4e6cbb8dd3c4c845960cd7
React-RCTActionSheet: c9f787f086b811fd0d7791c69130cbdfa98bccf8
React-RCTAnimation: 3f6a972f3c13a6f4ea87a6679f1f61ad411eef17
React-RCTAppDelegate: b470a2d07620c45ff59055f504a2722876319b4f
React-RCTBlob: 969efadea4c49f0444bc03eb2bb96309013fc23d
React-RCTFabric: 6e786192a948d78aee0f35360190d4e41dcffecc
React-RCTImage: e8fc5acc6436659f13ed478074fbd412da4b3746
React-RCTLinking: 6c01a9925a28e46d8791ee154d7d2cd727894850
React-RCTNetwork: 4fc5397d0a3c2fb216a1a629f797189f62c5da77
React-RCTPushNotification: 5b7d15c20157c78b74fe5d13f650ddd674e193c0
React-RCTSettings: 54a8451253f65fb9a9d701acd80f7c454bd3bc55
React-RCTTest: 1e97e3501649cc9c7016cf0587a67c54ddd59ef3
React-RCTText: 6a5496a75c13ff7343954a33437992d4c20a7c5f
React-RCTVibration: 77c996a53e7dc6b220b6997bf595a3501e9e9086
React-rncore: 9210c935d07df8b9023954c511d27032a24f561c
React-runtimeexecutor: 80b1a5022790edff92fff1106cf7a04f17e2c712
ReactCommon: 69577830f66cba0662355eae7ac4d10a5d7b49a2
ScreenshotManager: 5fe3d8792945f28a66baebf199c45c19dc59035b
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: 1b1a12ff3d86a10565ea7cbe057d42f5e5fb2a07
Yoga: 752c5da1e08dbb0d9d142394c940b8ce582c85e8
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: c3d82494e47e0adce02921f2ed9dba2427f0a9ff
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -996,7 +996,7 @@
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
Expand Down
13 changes: 12 additions & 1 deletion scripts/react-native-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,24 @@ fi
# shellcheck source=/dev/null
source "$REACT_NATIVE_DIR/scripts/node-binary.sh"

# If hermes-engine is in the podfile.lock, it means that Hermes is a dependency of the project
# and it is enabled. If not, it means that hermes is disabled.
HERMES_ENABLED=$(grep hermes-engine podfile.lock)

# If hermes-engine is not in the podfile.lock, it means that the app is not using Hermes.
# Setting USE_HERMES is no the only way to set whether the app can use hermes or not: users
# can also modify manually the Podfile.
if [[ -z "$HERMES_ENABLED" ]]; then
USE_HERMES=false
fi

HERMES_ENGINE_PATH="$PODS_ROOT/hermes-engine"
[ -z "$HERMES_CLI_PATH" ] && HERMES_CLI_PATH="$HERMES_ENGINE_PATH/destroot/bin/hermesc"

# Hermes is enabled in new projects by default, so we cannot assume that USE_HERMES=1 is set as an envvar.
# If hermes-engine is found in Pods, we can assume Hermes has not been disabled.
# If hermesc is not available and USE_HERMES is either unset or true, show error.
if [[ -f "$HERMES_ENGINE_PATH" && ! -f "$HERMES_CLI_PATH" ]]; then
if [[ ! -z "$HERMES_ENABLED" && -f "$HERMES_ENGINE_PATH" && ! -f "$HERMES_CLI_PATH" ]]; then
echo "error: Hermes is enabled but the hermesc binary could not be found at ${HERMES_CLI_PATH}." \
"Perhaps you need to run 'bundle exec pod install' or otherwise " \
"point the HERMES_CLI_PATH variable to your custom location." >&2
Expand Down
2 changes: 1 addition & 1 deletion scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def use_react_native! (
fabric_enabled: false,
new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == '1',
production: ENV['PRODUCTION'] == '1',
hermes_enabled: true,
hermes_enabled: ENV['USE_HERMES'] && ENV['USE_HERMES'] == '0' ? false : true,
flipper_configuration: FlipperConfiguration.disabled,
app_path: '..',
config_file_dir: '')
Expand Down
2 changes: 1 addition & 1 deletion template/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ target 'HelloWorld' do
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
Expand Down

0 comments on commit ae3f627

Please sign in to comment.