Skip to content

Commit 041a12d

Browse files
authored
Update react-native PR build pipeline to use macOS Mojave agents and XCode 11 beta (#153)
* Switch to XCode 11. * All tests passing * Update node to 10 * Update yaml scripts to use the Mojave agent pools * Fixed ado-test-setup.sh script * Fix build error for RNTesterBundle-macOS * fixed shellcheck issues
1 parent aa69588 commit 041a12d

20 files changed

+53
-26
lines changed

.ado/ado-test-cleanup.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill
99
# kill whatever is occupying port 5555 (web socket server)
1010
lsof -i tcp:5555 | awk 'NR!=1 {print $2}' | xargs kill
1111

12-
osascript <<'EOF'
13-
tell application "Terminal"
14-
set winlist to windows where name contains "React Packager" or name contains "Metro Bundler" or name contains "Web Socket Test Server"
15-
repeat with win in winlist
16-
tell application "Terminal" to close win
17-
end repeat
18-
end tell
19-
EOF
12+
# AppleScript can't be invoked from Azure DevOps Mojave agents until the following ticket is resolved: https://dev.azure.com/mseng/AzureDevOps/_workitems/edit/1513729
13+
# osascript <<'EOF'
14+
# tell application "Terminal"
15+
# set winlist to windows where name contains "React Packager" or name contains "Metro Bundler" or name contains "Web Socket Test Server"
16+
# repeat with win in winlist
17+
# tell application "Terminal" to close win
18+
# end repeat
19+
# end tell
20+
# EOF
2021

2122
# clear packager cache
22-
rm -fr $TMPDIR/react-*
23+
rm -fr "$TMPDIR/react-*"
2324

2425
# clear watchman state
2526
rm -rf /usr/local/var/run/watchman/*

.ado/ado-test-setup.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@ set -ex
55

66
THIS_DIR=$PWD
77

8+
# AppleScript can't be invoked from Azure DevOps Mojave agents until the following ticket is resolved: https://dev.azure.com/mseng/AzureDevOps/_workitems/edit/1513729
9+
810
# Start the packager
9-
osascript -e "tell application \"Terminal\" to do script \"cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./scripts/launchPackager.command --reactNativePath ${THIS_DIR}\""
11+
# osascript -e "tell application \"Terminal\" to do script \"cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./scripts/launchPackager.command --reactNativePath ${THIS_DIR}\""
1012

1113
# Start the WebSocket test server
12-
osascript -e "tell application \"Terminal\" to do script \"cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./IntegrationTests/launchWebSocketServer.command\""
14+
# osascript -e "tell application \"Terminal\" to do script \"cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./IntegrationTests/launchWebSocketServer.command\""
15+
16+
COMMAND="$TMPDIR/launchPackager.command"
17+
echo "cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./scripts/launchPackager.command --reactNativePath ${THIS_DIR}" > "$COMMAND"
18+
chmod +x "$COMMAND"
19+
open "$COMMAND"
20+
21+
COMMAND="$TMPDIR/launchWebSocketServer.command"
22+
echo "cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./IntegrationTests/launchWebSocketServer.command" > "$COMMAND"
23+
chmod +x "$COMMAND"
24+
open "$COMMAND"

.ado/apple-pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
packager_platform: 'ios'
1616
xcode_sdk: iphonesimulator
1717
xcode_scheme: 'RNTester'
18-
xcode_destination: 'platform=iOS Simulator,OS=latest,name=iPhone 5s'
18+
xcode_destination: 'platform=iOS Simulator,OS=latest,name=iPhone 8'
1919
tvos:
2020
packager_platform: 'ios'
2121
xcode_sdk: appletvsimulator
@@ -27,6 +27,7 @@ jobs:
2727
xcode_scheme: 'RNTester-macOS'
2828
xcode_destination: 'platform=macOS,arch=x86_64'
2929
pool:
30+
name: Hosted Mac Internal Mojave
3031
demands: ['xcode', 'sh', 'npm']
3132
timeoutInMinutes: 60 # how long to run the job before automatically cancelling
3233
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them

.ado/templates/apple-xcode-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ steps:
1717
sdk: ${{ parameters.xcode_sdk }}
1818
xcWorkspacePath: ${{ parameters.xcode_workspacePath }}
1919
scheme: ${{ parameters.xcode_scheme }}
20-
xcodeVersion: 10
20+
xcodeVersion: 11
2121
signingOption: auto
2222
packageApp: false
2323
teamId: '$(XCodeSigningMicrosoftTeamID)'

.ado/templates/apple-xcode-select.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
# Task Group: XCode select proper version
33
#
44
steps:
5-
# The XCODE_10_DEVELOPER_DIR variable is defined in the Hosted Agents and is used by the Xcode@5 tasks.
5+
# The XCODE_11_DEVELOPER_DIR variable is defined in the Hosted Agents and is used by the Xcode@5 tasks.
66
# The 'OE Mac Pool' agents do not define this variable, so manually set it here if it is not defined.
77
- script: |
8-
if [ -z $XCODE_10_DEVELOPER_DIR ]; then
9-
DIR='/Applications/Xcode_10.1.app/Contents/Developer/'
8+
if [ -z $XCODE_11_DEVELOPER_DIR ]; then
9+
DIR='/Applications/Xcode_11_beta.app/Contents/Developer/'
1010
if [ ! -d $DIR ]; then
1111
DIR='/Applications/Xcode.app/Contents/Developer/'
1212
fi
1313
if [ -d $DIR ]; then
14-
echo "##vso[task.setvariable variable=XCODE_10_DEVELOPER_DIR;]$DIR"
14+
echo "##vso[task.setvariable variable=XCODE_11_DEVELOPER_DIR;]$DIR"
1515
else
1616
(>&2 echo "No Xcode found.")
1717
fi
1818
fi
19-
displayName: 'Ensure XCODE_10_DEVELOPER_DIR'
19+
displayName: 'Ensure XCODE_11_DEVELOPER_DIR'
2020
failOnStderr: true
2121
2222
# The DEVELOPER_DIR variable is used by xcodebuild to specify the version of Xcode to use.
2323
# Set the variable here so that npm components and CMake build steps get the latest XCode version
2424
# instead of whatever version is the default on the build agent.
2525
- script: |
26-
echo "##vso[task.setvariable variable=DEVELOPER_DIR;]$XCODE_10_DEVELOPER_DIR"
26+
echo "##vso[task.setvariable variable=DEVELOPER_DIR;]$XCODE_11_DEVELOPER_DIR"
2727
displayName: 'Set DEVELOPER_DIR'
2828
2929
- script: |
30-
REQUIRED=10.1
30+
REQUIRED=11.0
3131
VER=`xcodebuild -version | head -n1 | cut -d' ' -f2`
3232
if (( $(echo "$VER >= $REQUIRED" | bc -l) )); then
3333
echo "XCode version $VER is active."

Brewfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
brew "node@8", link: true
1+
brew "node@10", link: true
22
brew "watchman"

RNTester/RNTester.xcodeproj/project.pbxproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,9 @@
20592059
3D13F83D1D6F6AE000E69E0E = {
20602060
CreatedOnToolsVersion = 7.3.1;
20612061
};
2062+
641DD8E51F16AA8500B6415F = {
2063+
ProvisioningStyle = Automatic;
2064+
};
20622065
};
20632066
};
20642067
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNTester" */;
@@ -3830,12 +3833,16 @@
38303833
isa = XCBuildConfiguration;
38313834
buildSettings = {
38323835
CLANG_ANALYZER_NONNULL = YES;
3836+
CODE_SIGN_IDENTITY = "-";
3837+
CODE_SIGN_STYLE = Automatic;
38333838
COMBINE_HIDPI_IMAGES = YES;
3839+
DEVELOPMENT_TEAM = "";
38343840
GCC_NO_COMMON_BLOCKS = YES;
38353841
INFOPLIST_FILE = "RNTesterBundle copy-Info.plist";
38363842
MACOSX_DEPLOYMENT_TARGET = 10.10;
38373843
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;
38383844
PRODUCT_NAME = "$(TARGET_NAME)";
3845+
PROVISIONING_PROFILE_SPECIFIER = "";
38393846
SDKROOT = macosx;
38403847
WRAPPER_EXTENSION = bundle;
38413848
};
@@ -3845,12 +3852,16 @@
38453852
isa = XCBuildConfiguration;
38463853
buildSettings = {
38473854
CLANG_ANALYZER_NONNULL = YES;
3855+
CODE_SIGN_IDENTITY = "-";
3856+
CODE_SIGN_STYLE = Automatic;
38483857
COMBINE_HIDPI_IMAGES = YES;
3858+
DEVELOPMENT_TEAM = "";
38493859
GCC_NO_COMMON_BLOCKS = YES;
38503860
INFOPLIST_FILE = "RNTesterBundle copy-Info.plist";
38513861
MACOSX_DEPLOYMENT_TARGET = 10.10;
38523862
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;
38533863
PRODUCT_NAME = "$(TARGET_NAME)";
3864+
PROVISIONING_PROFILE_SPECIFIER = "";
38543865
SDKROOT = macosx;
38553866
WRAPPER_EXTENSION = bundle;
38563867
};

RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ - (void)test##name \
3939
[_runner runTest:_cmd module:@#name]; \
4040
}
4141

42-
// TODO(ISS#2739352: the tests disabled below do not reliably pass on XCode 10.1)
43-
//RCT_TEST(ViewExample)
42+
RCT_TEST(ViewExample)
4443
RCT_TEST(LayoutExample)
4544
RCT_TEST(ARTExample)
4645
RCT_TEST(ScrollViewExample)
47-
//RCT_TEST(TextExample)
4846
#if !TARGET_OS_TV
47+
// TODO(OSS Candidate ISS#2710739): RCTPicker which TextExample depends on not available on tvOS
48+
RCT_TEST(TextExample)
4949
// No switch or slider available on tvOS
50-
//RCT_TEST(SwitchExample)
51-
//RCT_TEST(SliderExample)
50+
RCT_TEST(SwitchExample)
51+
RCT_TEST(SliderExample)
5252
#endif
5353

5454
- (void)testZZZNotInRecordMode
73.1 KB
Loading
58.6 KB
Loading

0 commit comments

Comments
 (0)