Upgrade to Swift 5

This commit is contained in:
Sindre Sorhus 2019-03-26 14:11:57 +07:00
parent 2447e76fac
commit a0f712aa40
9 changed files with 14 additions and 509 deletions

3
.gitignore vendored
View File

@ -1,4 +1,3 @@
/.build
/Packages
xcuserdata
project.xcworkspace
/*.xcodeproj

View File

@ -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'

View File

@ -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

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.2.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -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 = "<group>"; tabWidth = 2; usesTabs = 0; };
OBJ_11 /* util.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = util.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = Package.swift; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
OBJ_9 /* Aperture.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Aperture.swift; sourceTree = "<group>"; 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 = "<group>";
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 */;
}

View File

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "9999"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aperture::Aperture"
BuildableName = "Aperture.framework"
BlueprintName = "Aperture"
ReferencedContainer = "container:Aperture.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aperture::Aperture"
BuildableName = "Aperture.framework"
BlueprintName = "Aperture"
ReferencedContainer = "container:Aperture.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,72 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "9999"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aperture::Aperture"
BuildableName = "Aperture.framework"
BlueprintName = "Aperture"
ReferencedContainer = "container:Aperture.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aperture::Aperture"
BuildableName = "Aperture.framework"
BlueprintName = "Aperture"
ReferencedContainer = "container:Aperture.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -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",

View File

@ -8,8 +8,8 @@
## Requirements
- macOS 10.12+
- Xcode 10+
- Swift 4.2+
- Xcode 10.2+
- Swift 5+
## Install