From a0f712aa40158dff61d92f239a222097943d1fe6 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 26 Mar 2019 14:11:57 +0700 Subject: [PATCH] Upgrade to Swift 5 --- .gitignore | 3 +- .swiftlint.yml | 6 + Aperture.podspec | 2 +- Aperture.xcodeproj/Aperture_Info.plist | 22 -- Aperture.xcodeproj/project.pbxproj | 338 ------------------ .../xcschemes/Aperture-Package.xcscheme | 71 ---- .../xcshareddata/xcschemes/Aperture.xcscheme | 72 ---- Package.swift | 5 +- readme.md | 4 +- 9 files changed, 14 insertions(+), 509 deletions(-) delete mode 100644 Aperture.xcodeproj/Aperture_Info.plist delete mode 100644 Aperture.xcodeproj/project.pbxproj delete mode 100644 Aperture.xcodeproj/xcshareddata/xcschemes/Aperture-Package.xcscheme delete mode 100644 Aperture.xcodeproj/xcshareddata/xcschemes/Aperture.xcscheme diff --git a/.gitignore b/.gitignore index 0854237..6c81dc5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /.build /Packages -xcuserdata -project.xcworkspace +/*.xcodeproj diff --git a/.swiftlint.yml b/.swiftlint.yml index 27b375e..7c666d4 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -15,6 +15,7 @@ whitelist_rules: - conditional_returns_on_newline - contains_over_first_not_nil - control_statement + - deployment_target - discarded_notification_center_observer - discouraged_direct_init - discouraged_object_literal @@ -148,3 +149,8 @@ identifier_name: - 'y' - 'a' - 'b' + - 'x1' + - 'x2' + - 'y1' + - 'y2' +macOS_deployment_target: '10.12' diff --git a/Aperture.podspec b/Aperture.podspec index 8d2d1fb..cd053a6 100644 --- a/Aperture.podspec +++ b/Aperture.podspec @@ -8,6 +8,6 @@ Pod::Spec.new do |s| s.authors = { 'Sindre Sorhus' => 'sindresorhus@gmail.com', 'Matheus Fernandes' => 'github@matheus.top' } s.source = { :git => 'https://github.com/wulkano/Aperture.git', :tag => "v#{s.version}" } s.source_files = 'Sources/**/*.swift' - s.swift_version = '4.2' + s.swift_version = '5' s.platform = :macos, '10.12' end diff --git a/Aperture.xcodeproj/Aperture_Info.plist b/Aperture.xcodeproj/Aperture_Info.plist deleted file mode 100644 index 36218c6..0000000 --- a/Aperture.xcodeproj/Aperture_Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.2.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Aperture.xcodeproj/project.pbxproj b/Aperture.xcodeproj/project.pbxproj deleted file mode 100644 index dbcf393..0000000 --- a/Aperture.xcodeproj/project.pbxproj +++ /dev/null @@ -1,338 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - OBJ_21 /* Aperture.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* Aperture.swift */; }; - OBJ_22 /* Devices.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_10 /* Devices.swift */; }; - OBJ_23 /* util.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_11 /* util.swift */; }; - OBJ_30 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_6 /* Package.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - "Aperture::Aperture::Product" /* Aperture.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Aperture.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - OBJ_10 /* Devices.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Devices.swift; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; - OBJ_11 /* util.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = util.swift; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; - OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = Package.swift; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; - OBJ_9 /* Aperture.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Aperture.swift; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - OBJ_24 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - OBJ_12 /* Tests */ = { - isa = PBXGroup; - children = ( - ); - name = Tests; - sourceTree = SOURCE_ROOT; - }; - OBJ_14 /* Products */ = { - isa = PBXGroup; - children = ( - "Aperture::Aperture::Product" /* Aperture.framework */, - ); - name = Products; - sourceTree = BUILT_PRODUCTS_DIR; - }; - OBJ_5 = { - isa = PBXGroup; - children = ( - OBJ_6 /* Package.swift */, - OBJ_7 /* Sources */, - OBJ_12 /* Tests */, - OBJ_14 /* Products */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - OBJ_7 /* Sources */ = { - isa = PBXGroup; - children = ( - OBJ_8 /* Aperture */, - ); - name = Sources; - sourceTree = SOURCE_ROOT; - }; - OBJ_8 /* Aperture */ = { - isa = PBXGroup; - children = ( - OBJ_9 /* Aperture.swift */, - OBJ_10 /* Devices.swift */, - OBJ_11 /* util.swift */, - ); - name = Aperture; - path = Sources/Aperture; - sourceTree = SOURCE_ROOT; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - "Aperture::Aperture" /* Aperture */ = { - isa = PBXNativeTarget; - buildConfigurationList = OBJ_17 /* Build configuration list for PBXNativeTarget "Aperture" */; - buildPhases = ( - E349B4AA2217CFAA00D6CCEB /* SwiftLint */, - OBJ_20 /* Sources */, - OBJ_24 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Aperture; - productName = Aperture; - productReference = "Aperture::Aperture::Product" /* Aperture.framework */; - productType = "com.apple.product-type.framework"; - }; - "Aperture::SwiftPMPackageDescription" /* AperturePackageDescription */ = { - isa = PBXNativeTarget; - buildConfigurationList = OBJ_26 /* Build configuration list for PBXNativeTarget "AperturePackageDescription" */; - buildPhases = ( - OBJ_29 /* Sources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AperturePackageDescription; - productName = AperturePackageDescription; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - OBJ_1 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 9999; - ORGANIZATIONNAME = Wulkano; - }; - buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "Aperture" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = English; - hasScannedForEncodings = 0; - mainGroup = OBJ_5; - productRefGroup = OBJ_14 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - "Aperture::Aperture" /* Aperture */, - "Aperture::SwiftPMPackageDescription" /* AperturePackageDescription */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - E349B4AA2217CFAA00D6CCEB /* SwiftLint */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = SwiftLint; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed\"\nfi\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - OBJ_20 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 0; - files = ( - OBJ_21 /* Aperture.swift in Sources */, - OBJ_22 /* Devices.swift in Sources */, - OBJ_23 /* util.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - OBJ_29 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 0; - files = ( - OBJ_30 /* Package.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - OBJ_18 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PLATFORM_DIR)/Developer/Library/Frameworks", - ); - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Aperture.xcodeproj/Aperture_Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", - ); - OTHER_CFLAGS = "$(inherited)"; - OTHER_LDFLAGS = "$(inherited)"; - OTHER_SWIFT_FLAGS = "$(inherited)"; - PRODUCT_BUNDLE_IDENTIFIER = Aperture; - PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; - SWIFT_VERSION = 4.2; - TARGET_NAME = Aperture; - }; - name = Debug; - }; - OBJ_19 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PLATFORM_DIR)/Developer/Library/Frameworks", - ); - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Aperture.xcodeproj/Aperture_Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", - ); - OTHER_CFLAGS = "$(inherited)"; - OTHER_LDFLAGS = "$(inherited)"; - OTHER_SWIFT_FLAGS = "$(inherited)"; - PRODUCT_BUNDLE_IDENTIFIER = Aperture; - PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; - SWIFT_VERSION = 4.2; - TARGET_NAME = Aperture; - }; - name = Release; - }; - OBJ_27 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - LD = /usr/bin/true; - OTHER_SWIFT_FLAGS = "-swift-version 4.2 -I $(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"; - SWIFT_VERSION = 4.2; - }; - name = Debug; - }; - OBJ_28 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - LD = /usr/bin/true; - OTHER_SWIFT_FLAGS = "-swift-version 4.2 -I $(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"; - SWIFT_VERSION = 4.2; - }; - name = Release; - }; - OBJ_3 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_ARC = YES; - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_NS_ASSERTIONS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - MACOSX_DEPLOYMENT_TARGET = 10.12; - ONLY_ACTIVE_ARCH = YES; - OTHER_SWIFT_FLAGS = "-DXcode"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SUPPORTED_PLATFORMS = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "SWIFT_PACKAGE DEBUG"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - USE_HEADERMAP = NO; - VALID_ARCHS = x86_64; - }; - name = Debug; - }; - OBJ_4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_ARC = YES; - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_OPTIMIZATION_LEVEL = s; - MACOSX_DEPLOYMENT_TARGET = 10.12; - OTHER_SWIFT_FLAGS = "-DXcode"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SUPPORTED_PLATFORMS = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - USE_HEADERMAP = NO; - VALID_ARCHS = x86_64; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - OBJ_17 /* Build configuration list for PBXNativeTarget "Aperture" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - OBJ_18 /* Debug */, - OBJ_19 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - OBJ_2 /* Build configuration list for PBXProject "Aperture" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - OBJ_3 /* Debug */, - OBJ_4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - OBJ_26 /* Build configuration list for PBXNativeTarget "AperturePackageDescription" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - OBJ_27 /* Debug */, - OBJ_28 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = OBJ_1 /* Project object */; -} diff --git a/Aperture.xcodeproj/xcshareddata/xcschemes/Aperture-Package.xcscheme b/Aperture.xcodeproj/xcshareddata/xcschemes/Aperture-Package.xcscheme deleted file mode 100644 index e00685d..0000000 --- a/Aperture.xcodeproj/xcshareddata/xcschemes/Aperture-Package.xcscheme +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Aperture.xcodeproj/xcshareddata/xcschemes/Aperture.xcscheme b/Aperture.xcodeproj/xcshareddata/xcschemes/Aperture.xcscheme deleted file mode 100644 index d9e29cb..0000000 --- a/Aperture.xcodeproj/xcshareddata/xcschemes/Aperture.xcscheme +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Package.swift b/Package.swift index a0f6d02..42ed043 100644 --- a/Package.swift +++ b/Package.swift @@ -1,8 +1,11 @@ -// swift-tools-version:4.2 +// swift-tools-version:5.0 import PackageDescription let package = Package( name: "Aperture", + platforms: [ + .macOS(.v10_12) + ], products: [ .library( name: "Aperture", diff --git a/readme.md b/readme.md index 4615293..7dd7553 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,8 @@ ## Requirements - macOS 10.12+ -- Xcode 10+ -- Swift 4.2+ +- Xcode 10.2+ +- Swift 5+ ## Install