From facded0887dcca62b1cd10bc0a5d94f934b1e7c9 Mon Sep 17 00:00:00 2001 From: Oscar Bonilla <6f6231@gmail.com> Date: Mon, 15 Apr 2019 15:02:45 -0700 Subject: [PATCH] Xcode 10.2 (#320) --- .circleci/config.yml | 2 +- .../BPSampleApp.xcodeproj/project.pbxproj | 10 +++--- .../xcschemes/BPSampleApp.xcscheme | 2 +- .../CoreSimulator/CoreSimulator.h | 4 --- .../CoreSimulator/NSCoding-Protocol.h | 15 -------- .../CoreSimulator/NSObject-Protocol.h | 36 ------------------- .../NSPasteboardItemDataProvider-Protocol.h | 20 ----------- .../CoreSimulator/NSSecureCoding-Protocol.h | 14 -------- .../CoreSimulator/SimPasteboardItem.h | 1 - .../SimPasteboardItemWrappedData.h | 1 - .../Bluepill-cli/Simulator/SimulatorHelper.m | 5 ++- Bluepill-cli/bp.xcodeproj/project.pbxproj | 11 ++---- .../xcshareddata/xcschemes/bp-tests.xcscheme | 2 +- .../xcshareddata/xcschemes/bp.xcscheme | 2 +- .../bluepill.xcodeproj/project.pbxproj | 3 +- .../xcschemes/bluepill-tests.xcscheme | 2 +- .../xcshareddata/xcschemes/bluepill.xcscheme | 2 +- README.md | 3 +- Source/Shared/BPConstants.h | 4 +-- Source/Shared/BPUtils.m | 15 +++++--- 20 files changed, 35 insertions(+), 119 deletions(-) delete mode 100644 Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/NSCoding-Protocol.h delete mode 100644 Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/NSObject-Protocol.h delete mode 100644 Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/NSPasteboardItemDataProvider-Protocol.h delete mode 100644 Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/NSSecureCoding-Protocol.h diff --git a/.circleci/config.yml b/.circleci/config.yml index a512eb46..558aefa6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: macos: - xcode: 10.1.0 + xcode: 10.2.0 steps: - checkout - run: ./scripts/bluepill.sh build diff --git a/BPSampleApp/BPSampleApp.xcodeproj/project.pbxproj b/BPSampleApp/BPSampleApp.xcodeproj/project.pbxproj index 56055634..d52b84f1 100644 --- a/BPSampleApp/BPSampleApp.xcodeproj/project.pbxproj +++ b/BPSampleApp/BPSampleApp.xcodeproj/project.pbxproj @@ -400,7 +400,7 @@ BAB24F261DB5D45E00867756 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = LinkedIn; TargetAttributes = { BA4BCFC51DC47EC700592FA4 = { @@ -412,7 +412,7 @@ BA9C2DD11DD7F182007CB967 = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = 57Y47U492U; - LastSwiftMigration = 1010; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; TestTargetID = BAB24F2D1DB5D45E00867756; }; @@ -429,7 +429,7 @@ BAB24F461DB5D45E00867756 = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = 57Y47U492U; - LastSwiftMigration = 1010; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; TestTargetID = BAB24F2D1DB5D45E00867756; }; @@ -449,7 +449,7 @@ }; buildConfigurationList = BAB24F291DB5D45E00867756 /* Build configuration list for PBXProject "BPSampleApp" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -733,6 +733,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -789,6 +790,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; diff --git a/BPSampleApp/BPSampleApp.xcodeproj/xcshareddata/xcschemes/BPSampleApp.xcscheme b/BPSampleApp/BPSampleApp.xcodeproj/xcshareddata/xcschemes/BPSampleApp.xcscheme index 8b17df81..038e46f4 100644 --- a/BPSampleApp/BPSampleApp.xcodeproj/xcshareddata/xcschemes/BPSampleApp.xcscheme +++ b/BPSampleApp/BPSampleApp.xcodeproj/xcshareddata/xcschemes/BPSampleApp.xcscheme @@ -1,6 +1,6 @@ -- (void)pasteboard:(NSPasteboard *)arg1 item:(NSPasteboardItem *)arg2 provideDataForType:(NSString *)arg3; -#pragma clang diagnostic pop - -@optional -- (void)pasteboardFinishedWithDataProvider:(NSPasteboard *)arg1; -@end - diff --git a/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/NSSecureCoding-Protocol.h b/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/NSSecureCoding-Protocol.h deleted file mode 100644 index a731532c..00000000 --- a/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/NSSecureCoding-Protocol.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated by class-dump 3.5 (64 bit). -// -// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. -// - -@import Foundation; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wduplicate-protocol" -@protocol NSSecureCoding -+ (BOOL)supportsSecureCoding; -@end -#pragma clang diagnostic pop diff --git a/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItem.h b/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItem.h index 9ef2778b..b6b21cbc 100644 --- a/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItem.h +++ b/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItem.h @@ -6,7 +6,6 @@ @import Foundation; -#import "NSPasteboardItemDataProvider-Protocol.h" @class NSArray, NSMapTable, NSMutableArray, NSMutableDictionary, NSPasteboardItem, NSString; @interface SimPasteboardItem : NSObject diff --git a/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItemWrappedData.h b/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItemWrappedData.h index 902e3c46..c39390fa 100644 --- a/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItemWrappedData.h +++ b/Bluepill-cli/Bluepill-cli/PrivateHeaders/CoreSimulator/SimPasteboardItemWrappedData.h @@ -5,7 +5,6 @@ // @import Foundation; -#import "NSSecureCoding-Protocol.h" @class NSData; diff --git a/Bluepill-cli/Bluepill-cli/Simulator/SimulatorHelper.m b/Bluepill-cli/Bluepill-cli/Simulator/SimulatorHelper.m index a0e47af5..c69c69cc 100644 --- a/Bluepill-cli/Bluepill-cli/Simulator/SimulatorHelper.m +++ b/Bluepill-cli/Bluepill-cli/Simulator/SimulatorHelper.m @@ -104,8 +104,11 @@ + (NSString *)testEnvironmentWithConfiguration:(BPConfiguration *)config { xctConfig.automationFrameworkPath = [NSString stringWithFormat:@"%@/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework", config.xcodePath]; testHostPath = config.appBundlePath; + NSString *bundleID = [self bundleIdForPath:config.appBundlePath]; + xctConfig.testApplicationDependencies = @{bundleID: config.appBundlePath}; + if (config.testRunnerAppPath) { - xctConfig.targetApplicationBundleID = [self bundleIdForPath:config.appBundlePath]; + xctConfig.targetApplicationBundleID = bundleID; xctConfig.initializeForUITesting = YES; xctConfig.disablePerformanceMetrics = NO; xctConfig.reportActivities = YES; diff --git a/Bluepill-cli/bp.xcodeproj/project.pbxproj b/Bluepill-cli/bp.xcodeproj/project.pbxproj index 845f635f..1a39cd89 100644 --- a/Bluepill-cli/bp.xcodeproj/project.pbxproj +++ b/Bluepill-cli/bp.xcodeproj/project.pbxproj @@ -232,13 +232,9 @@ BA954F571D6D1AB3007D011D /* CDStructures.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDStructures.h; sourceTree = ""; }; BA954F581D6D1AB3007D011D /* CoreSimulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoreSimulator.h; sourceTree = ""; }; BA954F5A1D6D1AB3007D011D /* NSArray-SimArgv.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSArray-SimArgv.h"; sourceTree = ""; }; - BA954F5B1D6D1AB3007D011D /* NSCoding-Protocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSCoding-Protocol.h"; sourceTree = ""; }; BA954F5C1D6D1AB3007D011D /* NSDictionary-SimEnvp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSDictionary-SimEnvp.h"; sourceTree = ""; }; BA954F5D1D6D1AB3007D011D /* NSError-SimError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSError-SimError.h"; sourceTree = ""; }; - BA954F601D6D1AB3007D011D /* NSObject-Protocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject-Protocol.h"; sourceTree = ""; }; BA954F611D6D1AB3007D011D /* NSPasteboardItem-SimPasteboardItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSPasteboardItem-SimPasteboardItem.h"; sourceTree = ""; }; - BA954F621D6D1AB3007D011D /* NSPasteboardItemDataProvider-Protocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSPasteboardItemDataProvider-Protocol.h"; sourceTree = ""; }; - BA954F631D6D1AB3007D011D /* NSSecureCoding-Protocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSSecureCoding-Protocol.h"; sourceTree = ""; }; BA954F641D6D1AB3007D011D /* NSString-SIMCPUType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString-SIMCPUType.h"; sourceTree = ""; }; BA954F651D6D1AB3007D011D /* NSString-SIMPackedVersion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString-SIMPackedVersion.h"; sourceTree = ""; }; BA954F671D6D1AB3007D011D /* NSUserDefaults-SimDefaults.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSUserDefaults-SimDefaults.h"; sourceTree = ""; }; @@ -577,13 +573,9 @@ BA954F571D6D1AB3007D011D /* CDStructures.h */, BA954F581D6D1AB3007D011D /* CoreSimulator.h */, BA954F5A1D6D1AB3007D011D /* NSArray-SimArgv.h */, - BA954F5B1D6D1AB3007D011D /* NSCoding-Protocol.h */, BA954F5C1D6D1AB3007D011D /* NSDictionary-SimEnvp.h */, BA954F5D1D6D1AB3007D011D /* NSError-SimError.h */, - BA954F601D6D1AB3007D011D /* NSObject-Protocol.h */, BA954F611D6D1AB3007D011D /* NSPasteboardItem-SimPasteboardItem.h */, - BA954F621D6D1AB3007D011D /* NSPasteboardItemDataProvider-Protocol.h */, - BA954F631D6D1AB3007D011D /* NSSecureCoding-Protocol.h */, BA954F641D6D1AB3007D011D /* NSString-SIMCPUType.h */, BA954F651D6D1AB3007D011D /* NSString-SIMPackedVersion.h */, BA954F671D6D1AB3007D011D /* NSUserDefaults-SimDefaults.h */, @@ -854,10 +846,11 @@ }; buildConfigurationList = 7A79017D1D5CB679004D4325 /* Build configuration list for PBXProject "bp" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 7A7901791D5CB679004D4325; productRefGroup = 7A7901831D5CB679004D4325 /* Products */; diff --git a/Bluepill-cli/bp.xcodeproj/xcshareddata/xcschemes/bp-tests.xcscheme b/Bluepill-cli/bp.xcodeproj/xcshareddata/xcschemes/bp-tests.xcscheme index d4ab4d90..d5eae3f9 100644 --- a/Bluepill-cli/bp.xcodeproj/xcshareddata/xcschemes/bp-tests.xcscheme +++ b/Bluepill-cli/bp.xcodeproj/xcshareddata/xcschemes/bp-tests.xcscheme @@ -1,6 +1,6 @@ -#define BP_DEFAULT_RUNTIME "iOS 12.1" +#define BP_DEFAULT_RUNTIME "iOS 12.2" #define BP_DEFAULT_DEVICE_TYPE "iPhone 7" #define BP_TM_PROTOCOL_VERSION 17 #define BP_DAEMON_PROTOCOL_VERSION 26 -#define BP_DEFAULT_XCODE_VERSION "10.1" +#define BP_DEFAULT_XCODE_VERSION "10.2" #define BP_MAX_PROCESSES_PERCENT 0.75 diff --git a/Source/Shared/BPUtils.m b/Source/Shared/BPUtils.m index 8dd519f0..71ba6a45 100644 --- a/Source/Shared/BPUtils.m +++ b/Source/Shared/BPUtils.m @@ -48,6 +48,7 @@ @implementation BPUtils + (void)enableDebugOutput:(BOOL)enable { printDebugInfo = enable; + NSLog(@"Debug Enabled == %hhd", printDebugInfo); } + (void)quietMode:(BOOL)enable { @@ -94,12 +95,18 @@ + (void)printTo:(FILE*)fd kind:(BPKind)kind withString:(NSString *)txt { tms = localtime(&now); strftime(ts, 1<<6, "%Y%m%d.%H%M%S", tms); + const char * __nullable msg = [txt UTF8String]; + char *nl = "\n"; + if (msg && strlen(msg) > 1 && msg[strlen(msg)-1] == '\n') { + // don't add a new line if it already ends in new line + nl = ""; + } + if (isatty(1) && !bp_testing) { - fprintf(fd, "{%d} %s %s[%s]%s %s%s\n", - getpid(), ts, message.color, message.text, ANSI_COLOR_RESET, [simNum UTF8String], [txt UTF8String]); + fprintf(fd, "{%d} %s %s[%s]%s %s%s%s", + getpid(), ts, message.color, message.text, ANSI_COLOR_RESET, [simNum UTF8String], [txt UTF8String], nl); } else { - - fprintf(fd, "{%d} %s [%s] %s%s\n", getpid(), ts, message.text, [simNum UTF8String], [txt UTF8String]); + fprintf(fd, "{%d} %s [%s] %s%s%s", getpid(), ts, message.text, [simNum UTF8String], [txt UTF8String], nl); } fflush(fd); }