From 47a72d6f3e577b5fe00242f4a61c371e532133a3 Mon Sep 17 00:00:00 2001 From: Connor Wakamo Date: Mon, 23 May 2022 15:36:43 -0700 Subject: [PATCH 1/5] Performed Xcode project modernizations using Xcode 13.4. --- .../project.pbxproj | 4 ++- .../xcschemes/PlaygroundLogger (iOS).xcscheme | 2 +- .../PlaygroundLogger (macOS).xcscheme | 2 +- .../PlaygroundLogger (tvOS).xcscheme | 2 +- .../project.pbxproj | 32 +++++++++++++++++-- .../PlaygroundSupport (iOS).xcscheme | 24 ++++++-------- .../PlaygroundSupport (macOS).xcscheme | 24 ++++++-------- .../PlaygroundSupport (tvOS).xcscheme | 24 ++++++-------- .../xcschemes/XCPlayground (iOS).xcscheme | 24 ++++++-------- .../xcschemes/XCPlayground (macOS).xcscheme | 24 ++++++-------- .../xcschemes/XCPlayground (tvOS).xcscheme | 24 ++++++-------- ...cript-Test-PlaygroundLogger-macOS.xcscheme | 15 +-------- .../xcschemes/BuildScript-iOS.xcscheme | 10 ++---- .../xcschemes/BuildScript-macOS.xcscheme | 10 ++---- .../xcschemes/BuildScript-tvOS.xcscheme | 10 ++---- 15 files changed, 105 insertions(+), 126 deletions(-) diff --git a/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj b/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj index 8399f3c..74f6c41 100644 --- a/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj +++ b/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj @@ -813,7 +813,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1340; ORGANIZATIONNAME = "Apple Inc. and the Swift project authors"; TargetAttributes = { 5E2646261FB64876002DC6B6 = { @@ -1153,6 +1153,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -1208,6 +1209,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; diff --git a/PlaygroundLogger/PlaygroundLogger.xcodeproj/xcshareddata/xcschemes/PlaygroundLogger (iOS).xcscheme b/PlaygroundLogger/PlaygroundLogger.xcodeproj/xcshareddata/xcschemes/PlaygroundLogger (iOS).xcscheme index ce63d27..09f9ce8 100644 --- a/PlaygroundLogger/PlaygroundLogger.xcodeproj/xcshareddata/xcschemes/PlaygroundLogger (iOS).xcscheme +++ b/PlaygroundLogger/PlaygroundLogger.xcodeproj/xcshareddata/xcschemes/PlaygroundLogger (iOS).xcscheme @@ -1,6 +1,6 @@ + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - - - - - - - - - - - - - + + - - - - - - + + - - - - - - + + - - Date: Mon, 23 May 2022 15:41:13 -0700 Subject: [PATCH 2/5] Updated PlaygroundSupport and XCPlayground to Swift 5. --- PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj b/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj index 048411b..48b5f54 100644 --- a/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj +++ b/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj @@ -1295,7 +1295,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; SWIFT_STDLIB = swiftCore; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1333,7 +1333,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; SWIFT_SKIP_IMPLICIT_STDLIB_RUNPATH_SEARCH_PATH = YES; SWIFT_STDLIB = swiftCore; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; From 6b3cb114403587e25493ed148bee29172f066b14 Mon Sep 17 00:00:00 2001 From: Connor Wakamo Date: Mon, 23 May 2022 15:41:27 -0700 Subject: [PATCH 3/5] Fixed a warning in XCPlaygroundPage.swift. --- PlaygroundSupport/XCPlayground/XCPlaygroundPage.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PlaygroundSupport/XCPlayground/XCPlaygroundPage.swift b/PlaygroundSupport/XCPlayground/XCPlaygroundPage.swift index 44af8db..bc63960 100644 --- a/PlaygroundSupport/XCPlayground/XCPlaygroundPage.swift +++ b/PlaygroundSupport/XCPlayground/XCPlaygroundPage.swift @@ -44,9 +44,7 @@ public final class XCPlaygroundPage { /// /// - note: This function has been deprecated. @available(*,deprecated) public func captureValue(value: T, withIdentifier identifier: String) { - if let value = value as? AnyObject { - NotificationCenter.default.post(name: "XCPCaptureValue" as NSString as NSNotification.Name, object: self, userInfo: [ "value" : value, "identifier": identifier as AnyObject]) - } + NotificationCenter.default.post(name: "XCPCaptureValue" as NSString as NSNotification.Name, object: self, userInfo: [ "value" : value, "identifier": identifier as AnyObject]) } /// Indicates whether the playground page needs to execute indefinitely. From d6f254a54aafb8a5ff6bdafcf269420b83c3f731 Mon Sep 17 00:00:00 2001 From: Connor Wakamo Date: Mon, 23 May 2022 15:43:37 -0700 Subject: [PATCH 4/5] Enabled library evolution for PlaygroundLogger, PlaygroundSupport, and XCPlayground. This is for . --- .../PlaygroundLogger.xcodeproj/project.pbxproj | 2 ++ .../PlaygroundSupport.xcodeproj/project.pbxproj | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj b/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj index 74f6c41..00f075a 100644 --- a/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj +++ b/PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj @@ -1238,6 +1238,7 @@ 5E26463C1FB64876002DC6B6 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; @@ -1260,6 +1261,7 @@ 5E26463D1FB64876002DC6B6 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; diff --git a/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj b/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj index 48b5f54..4bacf17 100644 --- a/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj +++ b/PlaygroundSupport/PlaygroundSupport.xcodeproj/project.pbxproj @@ -1341,6 +1341,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_OBJC_WEAK = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1362,6 +1363,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_OBJC_WEAK = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1399,6 +1401,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1446,6 +1449,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1520,6 +1524,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_OBJC_WEAK = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1542,6 +1547,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_OBJC_WEAK = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1564,6 +1570,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1612,6 +1619,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1655,6 +1663,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1703,6 +1712,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1997,6 +2007,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -2044,6 +2055,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; From 296e773d68260c851e8d692c01610dad853721da Mon Sep 17 00:00:00 2001 From: Connor Wakamo Date: Mon, 23 May 2022 15:44:28 -0700 Subject: [PATCH 5/5] Fixed a few straightforward warnings in PlaygroundLogger. --- .../CustomLoggable/SpriteKit/SpriteKitOpaqueLoggable.swift | 2 +- .../PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PlaygroundLogger/PlaygroundLogger/CustomLoggable/SpriteKit/SpriteKitOpaqueLoggable.swift b/PlaygroundLogger/PlaygroundLogger/CustomLoggable/SpriteKit/SpriteKitOpaqueLoggable.swift index 370fd6d..ce6b92b 100644 --- a/PlaygroundLogger/PlaygroundLogger/CustomLoggable/SpriteKit/SpriteKitOpaqueLoggable.swift +++ b/PlaygroundLogger/PlaygroundLogger/CustomLoggable/SpriteKit/SpriteKitOpaqueLoggable.swift @@ -18,7 +18,7 @@ import SpriteKit } } -fileprivate protocol SpriteKitOpaqueLoggable: class, OpaqueImageRepresentable, CustomOpaqueLoggable {} +fileprivate protocol SpriteKitOpaqueLoggable: AnyObject, OpaqueImageRepresentable, CustomOpaqueLoggable {} extension SpriteKitOpaqueLoggable { func encodeImage(into encoder: LogEncoder, withFormat format: LogEncoder.Format) throws { diff --git a/PlaygroundLogger/PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift b/PlaygroundLogger/PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift index e3b67d9..4eef6ab 100644 --- a/PlaygroundLogger/PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift +++ b/PlaygroundLogger/PlaygroundLoggerTests/LegacyPlaygroundLoggerTests.swift @@ -894,7 +894,7 @@ extension UInt64 { init? (eightBytesStorage: BytesStorage) { if !eightBytesStorage.has(8) { return nil } - var up_byte = UnsafeMutablePointer.allocate(capacity: 8) + let up_byte = UnsafeMutablePointer.allocate(capacity: 8) defer { up_byte.deallocate() } for idx in 0..<8 { up_byte[idx] = eightBytesStorage.get() @@ -958,7 +958,7 @@ extension Bool { extension Float { init? (storage: BytesStorage) { - var ubPtr = UnsafeMutablePointer.allocate(capacity: 4) + let ubPtr = UnsafeMutablePointer.allocate(capacity: 4) defer { ubPtr.deallocate() } for idx in 0..<4 { ubPtr[idx] = storage.get() @@ -973,7 +973,7 @@ extension Float { extension Double { init? (storage: BytesStorage) { - var ubPtr = UnsafeMutablePointer.allocate(capacity: 8) + let ubPtr = UnsafeMutablePointer.allocate(capacity: 8) defer { ubPtr.deallocate() } for idx in 0..<8 { ubPtr[idx] = storage.get()