Skip to content

Commit

Permalink
Swift 5.1 Support (#204)
Browse files Browse the repository at this point in the history
* Updated project for Swift 5.1 support

* Updated xcconfig files & removed superfluous project overrides

* [Example] Update example app settings

Co-authored-by: rob phillips <rob@robphillips.me>
  • Loading branch information
stevebaranski and iwasrobbed authored Mar 3, 2020
1 parent 79c3d29 commit 69a006c
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 58 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

25 changes: 21 additions & 4 deletions Down-Example/Down-Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
remoteGlobalIDString = 8AFAEAFB1E6E32E900E09B68;
remoteInfo = DownTests;
};
D4C77E06240EEB64004675B3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D49980AF1FA560F8004EE42E /* Down.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = EEBA153A2344845500B54ECB;
remoteInfo = DownSnapshotTests;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -186,6 +193,7 @@
children = (
D49980B51FA560F8004EE42E /* Down.framework */,
D49980B71FA560F8004EE42E /* DownTests.xctest */,
D4C77E07240EEB64004675B3 /* DownSnapshotTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -238,12 +246,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1000;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = Down;
TargetAttributes = {
14090A482185411800503C06 = {
CreatedOnToolsVersion = 10.0;
DevelopmentTeam = NWN7H36NTR;
DevelopmentTeam = 7V68668DJN;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
SystemCapabilities = {
Expand Down Expand Up @@ -298,6 +306,13 @@
remoteRef = D49980B61FA560F8004EE42E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D4C77E07240EEB64004675B3 /* DownSnapshotTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = DownSnapshotTests.xctest;
remoteRef = D4C77E06240EEB64004675B3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
Expand Down Expand Up @@ -398,7 +413,8 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = NWN7H36NTR;
DEVELOPMENT_TEAM = 7V68668DJN;
ENABLE_HARDENED_RUNTIME = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "macOS Demo/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
Expand All @@ -424,7 +440,8 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = NWN7H36NTR;
DEVELOPMENT_TEAM = 7V68668DJN;
ENABLE_HARDENED_RUNTIME = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "macOS Demo/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
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 = "1020"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:Down-Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:Down-Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
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 = "1020"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:Down-Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:Down-Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion Down.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Pod::Spec.new do |spec|
spec.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$(SRCROOT)/Down/Source/cmark/**' }
spec.ios.resource = 'Resources/DownView.bundle'
spec.osx.resource = 'Resources/DownView.bundle'
spec.swift_version = "5.0"
spec.swift_versions = ['5.0', '5.1']
end
12 changes: 0 additions & 12 deletions Down.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Source/cmark";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1100,7 +1099,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Source/cmark";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -1114,9 +1112,7 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = "Resources/DownTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
PRODUCT_BUNDLE_IDENTIFIER = com.downMarkdown.DownTests;
SWIFT_VERSION = 5.0;
"TARGETED_DEVICE_FAMILY[sdk=appletvos*]" = 3;
"TARGETED_DEVICE_FAMILY[sdk=appletvsimulator*]" = 3;
};
Expand All @@ -1132,9 +1128,7 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = "Resources/DownTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
PRODUCT_BUNDLE_IDENTIFIER = com.downMarkdown.DownTests;
SWIFT_VERSION = 5.0;
"TARGETED_DEVICE_FAMILY[sdk=appletvos*]" = 3;
"TARGETED_DEVICE_FAMILY[sdk=appletvsimulator*]" = 3;
};
Expand Down Expand Up @@ -1192,14 +1186,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.downMarkdown.$(TARGET_NAME:c99-identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1252,12 +1244,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.downMarkdown.$(TARGET_NAME:c99-identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -1286,7 +1276,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.downMarkdown.DownSnapshotTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -1312,7 +1301,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.downMarkdown.DownSnapshotTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion Down.xcodeproj/xcshareddata/xcschemes/Down.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1130"
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 = "1100"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.1

import PackageDescription

Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ Is your app using it? [Let us know!](mailto:rob@robphillips.me)

### Installation

Note: Swift 5 support is now on the `master` branch and any tag >= 0.8.1 (Swift 4 is >= 0.4.x, Swift 3 is 0.3.x)
Note: Swift support is summarized in the table below.

|Swift Version|Tag|
| --- | --- |
| Swift 5.1 | >= 0.9.2 |
| Swift 5.0 | >= 0.8.1 |
| Swift 4 | >= 0.4.x |
| Swift 3 | 0.3.x |

now on the `master` branch and any tag >= 0.8.1 (Swift 4 is >= 0.4.x, Swift 3 is 0.3.x)

Quickly install using [CocoaPods](https://cocoapods.org):

Expand Down
5 changes: 3 additions & 2 deletions Resources/Configurations/Deployment-Targets.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0
SWIFT_VERSION = 5.0

IPHONEOS_DEPLOYMENT_TARGET = 9.0
MACOSX_DEPLOYMENT_TARGET = 10.11
TVOS_DEPLOYMENT_TARGET = 9.0
WATCHOS_DEPLOYMENT_TARGET = 3.0
6 changes: 0 additions & 6 deletions Resources/Configurations/Universal-Framework-Target.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ TARGETED_DEVICE_FAMILY[sdk=iphone*] = 1,2
TARGETED_DEVICE_FAMILY[sdk=appletvsimulator*] = 3
TARGETED_DEVICE_FAMILY[sdk=appletv*] = 3

// Watch-specific default settings
TARGETED_DEVICE_FAMILY[sdk=watchsimulator*] = 4
TARGETED_DEVICE_FAMILY[sdk=watch*] = 4

ENABLE_BITCODE[sdk=macosx*] = NO
ENABLE_BITCODE[sdk=watchsimulator*] = YES
ENABLE_BITCODE[sdk=watch*] = YES
ENABLE_BITCODE[sdk=iphonesimulator*] = NO
ENABLE_BITCODE[sdk=iphone*] = YES
ENABLE_BITCODE[sdk=appletvsimulator*] = YES
Expand Down
7 changes: 1 addition & 6 deletions Resources/Configurations/Universal-Target-Base.xcconfig
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
SUPPORTED_PLATFORMS = macosx iphonesimulator iphoneos watchos watchsimulator appletvos appletvsimulator
SUPPORTED_PLATFORMS = macosx iphonesimulator iphoneos appletvos appletvsimulator
VALID_ARCHS[sdk=macosx*] = i386 x86_64
VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64
VALID_ARCHS[sdk=watchos*] = armv7k
VALID_ARCHS[sdk=watchsimulator*] = i386
VALID_ARCHS[sdk=appletv*] = arm64
VALID_ARCHS[sdk=appletvsimulator*] = x86_64

// Dynamic linking uses different default copy paths
LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks'
LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
LD_RUNPATH_SEARCH_PATHS[sdk=watchos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
LD_RUNPATH_SEARCH_PATHS[sdk=watchsimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'

0 comments on commit 69a006c

Please sign in to comment.