Skip to content

Commit 2e80798

Browse files
ravimandalaob
andauthored
Xcode 12.0 support (#458)
Xcode 12.0 support * Fix Paths and use libXCTestBundleInject from the app, not from Xcode * Fix error message that changed * Clean up some scripts and fix a failing test * Fix xctestrun path Co-authored-by: Oscar Bonilla <6f6231@gmail.com>
1 parent 506e399 commit 2e80798

File tree

10 files changed

+49
-53
lines changed

10 files changed

+49
-53
lines changed

.github/workflows/PR.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
steps:
1111
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
1212
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
13-
- name: Select Xcode 11.5
14-
run: sudo xcode-select -s /Applications/Xcode_11.5.app
13+
- name: Select Xcode 12
14+
run: sudo xcode-select -s /Applications/Xcode_12.app
1515
- name: Run Bluepill tests
1616
run: ./scripts/bluepill.sh instance_tests
1717

@@ -22,8 +22,8 @@ jobs:
2222
steps:
2323
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
2424
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
25-
- name: Select Xcode 11.5
26-
run: sudo xcode-select -s /Applications/Xcode_11.5.app
25+
- name: Select Xcode 12
26+
run: sudo xcode-select -s /Applications/Xcode_12.app
2727
- name: Run BP tests
2828
run: ./scripts/bluepill.sh runner_tests
2929
- name: Build and Package

.github/workflows/master.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ jobs:
1111
# First machine, runs Bluepill tests
1212
integration_tests:
1313
name: Bluepill Test
14-
runs-on: macOS-latest
14+
runs-on: macos-latest
1515
steps:
1616
# actions/checkout@v2 but we use the sha because tags can be rewritten in git
1717
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
18-
- name: Select Xcode 11.5
19-
run: sudo xcode-select -s /Applications/Xcode_11.5.app
18+
- name: Select Xcode 12
19+
run: sudo xcode-select -s /Applications/Xcode_12.app
2020
- name: Run Bluepill tests
2121
run: ./scripts/bluepill.sh instance_tests
2222

2323
# Second machine, runs BP tests and makes build
2424
build:
2525
name: BP Test and build
26-
runs-on: macOS-latest
26+
runs-on: macos-latest
2727
steps:
2828
# actions/checkout@v2 but we use the sha because tags can be rewritten in git
2929
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
30-
- name: Select Xcode 11.5
31-
run: sudo xcode-select -s /Applications/Xcode_11.5.app
30+
- name: Select Xcode 12
31+
run: sudo xcode-select -s /Applications/Xcode_12.app
3232
- name: Run BP tests
3333
run: ./scripts/bluepill.sh runner_tests
3434
- name: Build and Package

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ jobs:
99
# First machine, runs Bluepill tests
1010
integration_tests:
1111
name: Bluepill Test
12-
runs-on: macOS-latest
12+
runs-on: macos-latest
1313
steps:
1414
# actions/checkout@v2 but we use the sha because tags can be rewritten in git
1515
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
16-
- name: Select Xcode 11.5
17-
run: sudo xcode-select -s /Applications/Xcode_11.5.app
16+
- name: Select Xcode 12
17+
run: sudo xcode-select -s /Applications/Xcode_12.app
1818
- name: Run Bluepill tests
1919
run: ./scripts/bluepill.sh instance_tests
2020

2121
# Second machine, runs BP tests and makes build
2222
build:
2323
name: BP Test and build
24-
runs-on: macOS-latest
24+
runs-on: macos-latest
2525
steps:
2626
# actions/checkout@v2 but we use the sha because tags can be rewritten in git
2727
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
2828
- name: Report event trigger data
2929
run: |
3030
echo "Event ${{ github.event_name }}, ref: ${{ github.ref }}"
31-
- name: Select Xcode 11.5
32-
run: sudo xcode-select -s /Applications/Xcode_11.5.app
31+
- name: Select Xcode 12
32+
run: sudo xcode-select -s /Applications/Xcode_12.app
3333
- name: Run Bluepill tests
3434
run: ./scripts/bluepill.sh runner_tests
3535
- name: Build Bluepill

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Here is a list of Bluepill exit codes. If a Bluepill execution has multiple exit
119119
120120
## Requirements
121121
122-
Bluepill officially supports **Xcode 11.5**. If you're looking for old Xcode support, please checkout the following branches:
122+
Bluepill officially supports **Xcode 12.0**. If you're looking for old Xcode support, please checkout the following branches:
123123
124124
* [Xcode-8](https://github.com/linkedin/bluepill/tree/xcode8)
125125
* [Xcode-9.0](https://github.com/linkedin/bluepill/tree/xcode-9.0)
@@ -136,6 +136,7 @@ Bluepill officially supports **Xcode 11.5**. If you're looking for old Xcode sup
136136
* [Xcode-11.2](https://github.com/linkedin/bluepill/tree/xcode-11.2)
137137
* [Xcode-11.3](https://github.com/linkedin/bluepill/tree/xcode-11.3)
138138
* [Xcode-11.4](https://github.com/linkedin/bluepill/tree/xcode-11.4)
139+
* [Xcode-11.5](https://github.com/linkedin/bluepill/tree/xcode-11.5)
139140
140141
If you're looking for newer Xcode version support, try using Bluepill with `unsafe-skip-xcode-version-check` flag but make sure your app is tested with it and the underlying risks are understand.
141142

bluepill/tests/BPIntegrationTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ - (void)testTwoBPInstancesWithXCTestRunFile {
133133
config.testBundlePath = nil;
134134
config.testRunnerAppPath = nil;
135135
NSString *baseSDK = [[NSString stringWithUTF8String:BP_DEFAULT_BASE_SDK] stringByReplacingOccurrencesOfString:@"iOS " withString:@""];
136-
NSString *xcTestRunFile = [NSString stringWithFormat:@"Build/Products/BPSampleApp_iphonesimulator%@-x86_64.xctestrun", baseSDK];
136+
NSString *xcTestRunFile = [NSString stringWithFormat:@"Build/Products/BPSampleApp_iphonesimulator%@-arm64-i386-x86_64.xctestrun", baseSDK];
137137
config.xcTestRunPath = [[[BPTestHelper derivedDataPath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:xcTestRunFile];
138138
NSError *err;
139139
[config validateConfigWithError:&err];

bp/src/BPConstants.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#import <Foundation/Foundation.h>
1111

1212
#pragma mark - Version Constants
13-
#define BP_DEFAULT_XCODE_VERSION "11.5"
14-
#define BP_DEFAULT_RUNTIME "iOS 13.5"
15-
#define BP_DEFAULT_BASE_SDK "13.5"
13+
#define BP_DEFAULT_XCODE_VERSION "12.0"
14+
#define BP_DEFAULT_RUNTIME "iOS 14.0"
15+
#define BP_DEFAULT_BASE_SDK "14.0"
1616

1717
#define BP_DEFAULT_DEVICE_TYPE "iPhone 8"
1818

bp/src/SimulatorHelper.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ + (NSDictionary *)appLaunchEnvironmentWithBundleID:(NSString *)hostBundleID
6363
device:(SimDevice *)device
6464
config:(BPConfiguration *)config {
6565
NSString *hostAppExecPath = [SimulatorHelper executablePathforPath:config.appBundlePath];
66-
NSString *testSimulatorFrameworkPath = [[hostAppExecPath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent];
66+
NSString *hostAppPath = [hostAppExecPath stringByDeletingLastPathComponent];
67+
NSString *testSimulatorFrameworkPath = [hostAppPath stringByDeletingLastPathComponent];
68+
NSString *libXCTestBundleInject = [[hostAppPath stringByAppendingPathComponent:@"Frameworks"] stringByAppendingPathComponent:@"libXCTestBundleInject.dylib"];
6769
NSMutableDictionary<NSString *, NSString *> *environment = [@{
6870
@"DYLD_FALLBACK_FRAMEWORK_PATH" : [NSString stringWithFormat:@"%@/Library/Frameworks:%@/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks", config.xcodePath, config.xcodePath],
69-
@"DYLD_FALLBACK_LIBRARY_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib", config.xcodePath],
70-
@"DYLD_INSERT_LIBRARIES" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/usr/lib/libXCTTargetBootstrapInject.dylib", config.xcodePath],
71+
@"DYLD_FALLBACK_LIBRARY_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib", config.xcodePath],
72+
@"DYLD_INSERT_LIBRARIES" : libXCTestBundleInject,
7173
@"DYLD_LIBRARY_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks", config.xcodePath],
72-
@"DYLD_ROOT_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot", config.xcodePath],
74+
@"DYLD_ROOT_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot", config.xcodePath],
7375
@"NSUnbufferedIO" : @"1",
7476
@"OS_ACTIVITY_DT_MODE" : @"1",
7577
@"XCODE_DBG_XPC_EXCLUSIONS" : @"com.apple.dt.xctestSymbolicator",

bp/tests/Resource Files/BPAppNegativeTests-results.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<testcase classname="BPAppNegativeTests" name="testAssertTrue">
1414
</testcase>
1515
<testcase classname="BPAppNegativeTests" name="testRaiseException">
16-
<error type="Error" message="-[BPAppNegativeTests testRaiseException] : failed: caught &quot;Invalid foo value&quot;, &quot;foo of 1 is invalid&quot;">
16+
<error type="Error" message="-[BPAppNegativeTests testRaiseException] : foo of 1 is invalid (Invalid foo value)">
1717
/Users/obonilla/o/bluepill/BPSampleApp/BPAppNegativeTests/BPAppNegativeTests.m:48
1818
</error>
1919
<system-out>

bp/tests/SimulatorHelperTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ - (void)testAppLaunchEnvironment {
4040
config.outputDirectory = @"/Users/test/output";
4141
NSDictionary *appLaunchEnvironment = [SimulatorHelper appLaunchEnvironmentWithBundleID:hostBundleId device:nil config:config];
4242
XCTAssert([appLaunchEnvironment[@"DYLD_FALLBACK_FRAMEWORK_PATH"] containsString:@"Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks"]);
43-
XCTAssert([appLaunchEnvironment[@"DYLD_INSERT_LIBRARIES"] containsString:@"Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/usr/lib/libXCTTargetBootstrapInject.dylib"]);
43+
XCTAssert([appLaunchEnvironment[@"DYLD_INSERT_LIBRARIES"] containsString:@"libXCTestBundleInject.dylib"]);
4444
XCTAssert([appLaunchEnvironment[@"DYLD_LIBRARY_PATH"] containsString:@"/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks"]);
4545
XCTAssert([appLaunchEnvironment[@"XCTestConfigurationFilePath"] containsString:@"T/BPSampleAppTests-"]);
4646
XCTAssertEqualObjects(appLaunchEnvironment[@"LLVM_PROFILE_FILE"], @"/Users/test/output/%p.profraw");

scripts/bluepill.sh

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1-
# // Copyright 2016 LinkedIn Corporation
2-
# // Licensed under the BSD 2-Clause License (the "License");
3-
# // you may not use this file except in compliance with the License.
4-
# // You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause
5-
# //
6-
# // Unless required by applicable law or agreed to in writing, software
7-
# // distributed under the License is distributed on an "AS IS" BASIS,
8-
# // WITHOUT WARRANTIES OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
9-
101
#!/bin/bash
2+
# Copyright 2016 LinkedIn Corporation
3+
# Licensed under the BSD 2-Clause License (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
1110

1211
XCPRETTY='xcpretty --report junit'
13-
command -v $XCPRETTY >/dev/null 2>&1 || {
14-
XCPRETTY=cat
12+
command -v "$XCPRETTY" >/dev/null 2>&1 || {
13+
XCPRETTY="cat"
1514
}
1615

17-
if [ "$1" == "-v" ]
18-
then
19-
VERBOSE=1
20-
shift
21-
fi
22-
2316
if [[ $# -ne 1 ]]; then
2417
echo "$0: usage: bluepill.sh <command>"
2518
exit 1
@@ -60,18 +53,18 @@ bluepill_build()
6053
# package bluepill
6154
TAG=$(git describe --always --tags)
6255
DST="Bluepill-$TAG"
63-
mkdir -p build/$DST/bin
64-
cp build/Build/Products/Release/{bp,bluepill} build/$DST/bin
56+
mkdir -p "build/$DST/bin"
57+
cp build/Build/Products/Release/{bp,bluepill} "build/$DST/bin"
6558
## build the man page
66-
mkdir -p build/$DST/man/man1
67-
/usr/bin/python scripts/man.py build/$DST/man/man1/bluepill.1
59+
mkdir -p "build/$DST/man/man1"
60+
/usr/bin/python scripts/man.py "build/$DST/man/man1/bluepill.1"
6861
# License
69-
cp LICENSE build/$DST
62+
cp LICENSE "build/$DST"
7063
# bptestrunner
71-
cp bptestrunner/* build/$DST
64+
cp bptestrunner/* "build/$DST"
7265

73-
(cd build && zip -qr $DST.zip $DST)
74-
echo Release in build/$DST.zip
66+
(cd build && zip -qr "$DST.zip" "$DST")
67+
echo Release in "build/$DST.zip"
7568
}
7669

7770
bluepill_build_sample_app()
@@ -142,6 +135,6 @@ then
142135
bluepill_build_sample_app
143136
fi
144137

145-
bluepill_$conf
138+
"bluepill_$conf"
146139

147140
exit 0

0 commit comments

Comments
 (0)