Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes for XCode 9.1 #207

Merged
merged 11 commits into from
Nov 29, 2017
4 changes: 2 additions & 2 deletions BPSampleApp/BPSampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = BPSampleApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = LI.BPSampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -843,7 +843,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = BPSampleApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = LI.BPSampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Bluepill-cli/BPInstanceTests/BluepillTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ - (void)setUp {
XCTAssert(self.config.simDeviceType != nil);

for (SimRuntime *runtime in [sc supportedRuntimes]) {
if ([[runtime name] isEqualToString:self.config.runtime]) {
if ([[runtime name] containsString:self.config.runtime]) {
self.config.simRuntime = runtime;
break;
}
Expand Down
14 changes: 13 additions & 1 deletion Bluepill-cli/Bluepill-cli.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@
7A79017A1D5CB679004D4325 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = LinkedIn;
TargetAttributes = {
7A7901811D5CB679004D4325 = {
Expand Down Expand Up @@ -796,15 +796,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand Down Expand Up @@ -845,15 +851,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Bluepill-cli/Bluepill-cli/Bluepill/Helpers/BPHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
dispatch_once_t onceToken;
}

typedef void (^BasicHandlerBlock)();
typedef void (^BasicHandlerBlock)(void);
typedef void (^BasicErrorBlock)(NSError *error);

@property (nonatomic, strong) BPWaitTimer *timer;
Expand Down
2 changes: 1 addition & 1 deletion Bluepill-cli/Bluepill-cli/Bluepill/Helpers/BPWaitTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@class BPWaitTimer;

typedef void (^BPWaitTimerBlock)(BPWaitTimer *timer);
typedef void (^BPWaitTimerTimeoutBlock)();
typedef void (^BPWaitTimerTimeoutBlock)(void);

/**
This class will call the specified timeout block if the
Expand Down
2 changes: 1 addition & 1 deletion Bluepill-cli/Bluepill-cli/Bluepill/Helpers/BPWaitTimer.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (void)start {
}];
}

- (void)startTimerFor:(NSTimeInterval)seconds withCompletion:(void (^)())block {
- (void)startTimerFor:(NSTimeInterval)seconds withCompletion:(void (^)(void))block {
self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0));
__weak typeof(self) __self = self;
dispatch_source_set_timer(self.timer, dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC), DISPATCH_TIME_FOREVER, 0.1 * NSEC_PER_SEC);
Expand Down
2 changes: 1 addition & 1 deletion Bluepill-cli/Bluepill-cli/Simulator/SimulatorHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ + (NSString *)testEnvironmentWithConfiguration:(BPConfiguration *)config {
xctConfig.treatMissingBaselinesAsFailures = NO;
xctConfig.targetApplicationPath = config.appBundlePath;
xctConfig.reportResultsToIDE = YES;
xctConfig.automationFrameworkPath = [NSString stringWithFormat:@"%@/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework", config.xcodePath],
xctConfig.automationFrameworkPath = [NSString stringWithFormat:@"%@/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework", config.xcodePath];
testHostPath = config.appBundlePath;

if (config.testRunnerAppPath) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
14 changes: 13 additions & 1 deletion Bluepill-runner/Bluepill.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
BAEF4B2C1DAC539400E68294 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = LinkedIn;
TargetAttributes = {
BA1809DF1DBA8FB100D7D130 = {
Expand Down Expand Up @@ -426,15 +426,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand Down Expand Up @@ -475,15 +481,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/BPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import <Foundation/Foundation.h>

#define BP_DEFAULT_RUNTIME "iOS 11.0"
#define BP_DEFAULT_RUNTIME "iOS 11"
#define BP_DEFAULT_DEVICE_TYPE "iPhone 7"
#define BP_DEFAULT_XCODE_VERSION "Xcode 9"
#define BP_TM_PROTOCOL_VERSION 17
Expand Down
23 changes: 14 additions & 9 deletions Source/Shared/BPXCTestFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ + (instancetype)BPXCTestFileFromDictionary:(NSDictionary *)dict
NSAssert(testRoot, @"A testRoot argument must be supplied");
NSString * const TESTROOT = @"__TESTROOT__";
NSString * const TESTHOST = @"__TESTHOST__";
NSString * const PLATFORMS = @"__PLATFORMS__";
NSString *testHostPath = [dict objectForKey:@"TestHostPath"];
NSString *testHostBundleIdentifier = [dict objectForKey:@"TestHostBundleIdentifier"];
if (!testHostPath) {
Expand All @@ -129,15 +130,19 @@ + (instancetype)BPXCTestFileFromDictionary:(NSDictionary *)dict
if ([testBundlePath rangeOfString:TESTHOST].location != NSNotFound) {
testBundlePath = [testBundlePath stringByReplacingOccurrencesOfString:TESTHOST withString:testHostPath];
} else if ([testBundlePath rangeOfString:TESTROOT].location != NSNotFound) {
testHostPath = [testHostPath stringByDeletingLastPathComponent]; //remove /bluepill
NSString *temp = [testHostPath stringByDeletingLastPathComponent]; //remove /iphonesimulator
//extract app name with .app extension
NSRange dotPosition = [testHostBundleIdentifier rangeOfString:@"." options:NSBackwardsSearch];
NSString *appName = [testHostBundleIdentifier substringFromIndex:dotPosition.location + 1];
NSString *appNameWithExtension = [appName stringByAppendingString:@".app"];
//append the app name to the direction
testHostPath = [testHostPath stringByAppendingString:appNameWithExtension];
testBundlePath = [testBundlePath stringByReplacingOccurrencesOfString:TESTROOT withString:temp];
if ([testHostPath rangeOfString:PLATFORMS].location != NSNotFound) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any handling here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually from a different PR... I'm not sure how I ended up committing it here. I'll finish it and piggyback my fix on this PR.

} else {
testHostPath = [testHostPath stringByDeletingLastPathComponent]; //remove /bluepill
NSString *temp = [testHostPath stringByDeletingLastPathComponent]; //remove /iphonesimulator
//extract app name with .app extension
NSRange dotPosition = [testHostBundleIdentifier rangeOfString:@"." options:NSBackwardsSearch];
NSString *appName = [testHostBundleIdentifier substringFromIndex:dotPosition.location + 1];
NSString *appNameWithExtension = [appName stringByAppendingString:@".app"];
//append the app name to the direction
testHostPath = [testHostPath stringByAppendingString:appNameWithExtension];
testBundlePath = [testBundlePath stringByReplacingOccurrencesOfString:TESTROOT withString:temp];
}
} else {
[BPUtils printInfo:ERROR withString:@"testBundlePath is incorrect, please check xctestrun file"];
}
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
machine:
xcode:
version: 9.0
version: 9.1

compile:
override:
Expand Down
2 changes: 1 addition & 1 deletion scripts/bluepill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ bluepill_build_sample_app()
-workspace Bluepill.xcworkspace \
-scheme BPSampleApp \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 7,OS=11.0' \
-destination 'platform=iOS Simulator,name=iPhone 7,OS=11.1' \
-derivedDataPath "build/" 2>&1 | tee result.txt | $XCPRETTY

test $? == 0 || {
Expand Down