Skip to content

Commit 7abc703

Browse files
authored
Merge pull request #24 from ole/swift-4.2
Drop Swift 3 support and Swift 4.2 compatibility
2 parents 2e6ea06 + 985f21f commit 7abc703

12 files changed

Lines changed: 140 additions & 66 deletions

File tree

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ matrix:
33
- os: osx
44
language: generic
55
# Xcode version implicitly defines the Swift version to be used on macOS.
6-
osx_image: xcode8.3
6+
# Xcode 9.2: Swift 4.0.3
7+
osx_image: xcode9.2
78

89
- os: osx
910
language: generic
1011
# Xcode version implicitly defines the Swift version to be used on macOS.
11-
osx_image: xcode9.2
12+
# Xcode 9.4: Swift 4.1.2
13+
osx_image: xcode9.4
1214

1315
- os: linux
1416
language: generic
@@ -27,15 +29,15 @@ matrix:
2729
#
2830
# You can use tags to select a specific Swift version if the
2931
# image supports it, e.g. "swift:3.0.2" or "swift:latest".
30-
DOCKER_IMAGE="swift:3.1"
32+
DOCKER_IMAGE="swift:4.0"
3133

3234
- os: linux
3335
language: generic
3436
sudo: required
3537
services:
3638
- docker
3739
env:
38-
DOCKER_IMAGE="swift:4.0"
40+
DOCKER_IMAGE="swift:4.1"
3941

4042
script:
4143
- chmod ugo+x ./scripts/travis-build-script.sh

Package.swift

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:3.1
1+
// swift-tools-version:4.0
22
import PackageDescription
33

44
/// Provides the `SortedArray` type, an array that keeps its elements
@@ -10,5 +10,19 @@ import PackageDescription
1010
///
1111
let package = Package(
1212
name: "SortedArray",
13-
swiftLanguageVersions: [3, 4]
13+
products: [
14+
.library(
15+
name: "SortedArray",
16+
targets: ["SortedArray"]),
17+
],
18+
targets: [
19+
.target(
20+
name: "SortedArray",
21+
dependencies: [],
22+
path: "Sources"),
23+
.testTarget(
24+
name: "SortedArrayTests",
25+
dependencies: ["SortedArray"]),
26+
],
27+
swiftLanguageVersions: [4]
1428
)

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SortedArray
22

3-
A sorted array type for Swift 3.1+ and 4.0+.
3+
A sorted array type for Swift 4.0+.
44

55
Provides the `SortedArray` type, an array that keeps its elements sorted according to a given sort predicate.
66

@@ -14,7 +14,14 @@ For more info, see the [GitHub repo](https://github.com/ole/SortedArray) and my
1414

1515
## Supported Platforms
1616

17-
Supports Swift versions 3.1, 3.2, and 4.0. Not compatible with Swift 3.0. The last version compatible with Swift 3.0 is v0.4.
17+
The current release supports Swift 4.0 and up.
18+
19+
If you need support for older Swift version, here's a list of the latest releases that support specific Swift versions:
20+
21+
| Swift version | Latest SortedArray release |
22+
| 4.x | master |
23+
| 3.x | [0.6.0](https://github.com/ole/SortedArray/releases/tag/0.6.0) |
24+
| 3.0 | [0.4](https://github.com/ole/SortedArray/releases/tag/0.4.0) |
1825

1926
Since the code has no dependencies other than the Swift standard library (it doesn't even use Foundation), it should work on all platforms where Swift is available.
2027

@@ -43,7 +50,7 @@ let package = Package(
4350
Add this to your `Cartfile`:
4451

4552
```
46-
github "ole/SortedArray" ~> 0.3
53+
github "ole/SortedArray" ~> 0.7
4754
```
4855

4956
Integration via Carthage should work for macOS, iOS, tvOS, and watchOS targets.

SortedArray.xcodeproj/project.pbxproj

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
52D6D9F01BEFFFBE002C0205 /* SortedArray.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SortedArray.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5959
52D6DA0F1BF000BD002C0205 /* SortedArray.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SortedArray.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6060
5D6634242003E2C000364E93 /* PerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PerformanceTests.swift; path = Tests/SortedArrayTests/PerformanceTests.swift; sourceTree = "<group>"; };
61+
5D7AAFCC20D71F4200080885 /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
62+
5D7AAFCD20D71F4200080885 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
63+
5D7AAFCE20D71F4200080885 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
64+
5D7AAFD020D722B100080885 /* travis-build-script.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "travis-build-script.sh"; sourceTree = "<group>"; };
65+
5D7AAFD120D7231E00080885 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = "<group>"; };
6166
5DA058D11E8813F3006FA2B1 /* TestHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestHelpers.swift; path = Tests/SortedArrayTests/TestHelpers.swift; sourceTree = "<group>"; };
6267
AD2FAA261CD0B6D800659CF4 /* SortedArray.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SortedArray.plist; sourceTree = "<group>"; };
6368
AD2FAA281CD0B6E100659CF4 /* SortedArrayTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SortedArrayTests.plist; sourceTree = "<group>"; };
@@ -124,10 +129,12 @@
124129
52D6D9721BEFF229002C0205 = {
125130
isa = PBXGroup;
126131
children = (
132+
5D7AAFCB20D71F0800080885 /* Other files (not in any target) */,
127133
52D6D9961BEFF375002C0205 /* SortedArray.swift */,
128134
52D6D9971BEFF375002C0205 /* SortedArrayTests.swift */,
129135
5D6634242003E2C000364E93 /* PerformanceTests.swift */,
130136
5DA058D11E8813F3006FA2B1 /* TestHelpers.swift */,
137+
5D7AAFCF20D722B100080885 /* scripts */,
131138
52D6D99C1BEFF38C002C0205 /* Configs */,
132139
52D6D97D1BEFF229002C0205 /* Products */,
133140
);
@@ -156,6 +163,25 @@
156163
path = Configs;
157164
sourceTree = "<group>";
158165
};
166+
5D7AAFCB20D71F0800080885 /* Other files (not in any target) */ = {
167+
isa = PBXGroup;
168+
children = (
169+
5D7AAFCE20D71F4200080885 /* README.md */,
170+
5D7AAFCC20D71F4200080885 /* LICENSE.txt */,
171+
5D7AAFCD20D71F4200080885 /* Package.swift */,
172+
5D7AAFD120D7231E00080885 /* .travis.yml */,
173+
);
174+
name = "Other files (not in any target)";
175+
sourceTree = "<group>";
176+
};
177+
5D7AAFCF20D722B100080885 /* scripts */ = {
178+
isa = PBXGroup;
179+
children = (
180+
5D7AAFD020D722B100080885 /* travis-build-script.sh */,
181+
);
182+
path = scripts;
183+
sourceTree = "<group>";
184+
};
159185
DD7502721C68FC1B006590AF /* Frameworks */ = {
160186
isa = PBXGroup;
161187
children = (
@@ -339,7 +365,7 @@
339365
isa = PBXProject;
340366
attributes = {
341367
LastSwiftUpdateCheck = 0720;
342-
LastUpgradeCheck = 0900;
368+
LastUpgradeCheck = 1000;
343369
ORGANIZATIONNAME = SortedArray;
344370
TargetAttributes = {
345371
52D6D97B1BEFF229002C0205 = {
@@ -543,12 +569,14 @@
543569
CLANG_WARN_BOOL_CONVERSION = YES;
544570
CLANG_WARN_COMMA = YES;
545571
CLANG_WARN_CONSTANT_CONVERSION = YES;
572+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
546573
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
547574
CLANG_WARN_EMPTY_BODY = YES;
548575
CLANG_WARN_ENUM_CONVERSION = YES;
549576
CLANG_WARN_INFINITE_RECURSION = YES;
550577
CLANG_WARN_INT_CONVERSION = YES;
551578
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
579+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
552580
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
553581
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
554582
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -581,7 +609,7 @@
581609
ONLY_ACTIVE_ARCH = YES;
582610
SDKROOT = iphoneos;
583611
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
584-
SWIFT_VERSION = 3.0;
612+
SWIFT_VERSION = 4.0;
585613
TARGETED_DEVICE_FAMILY = "1,2";
586614
VERSIONING_SYSTEM = "apple-generic";
587615
VERSION_INFO_PREFIX = "";
@@ -600,12 +628,14 @@
600628
CLANG_WARN_BOOL_CONVERSION = YES;
601629
CLANG_WARN_COMMA = YES;
602630
CLANG_WARN_CONSTANT_CONVERSION = YES;
631+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
603632
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
604633
CLANG_WARN_EMPTY_BODY = YES;
605634
CLANG_WARN_ENUM_CONVERSION = YES;
606635
CLANG_WARN_INFINITE_RECURSION = YES;
607636
CLANG_WARN_INT_CONVERSION = YES;
608637
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
638+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
609639
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
610640
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
611641
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -631,7 +661,7 @@
631661
MTL_ENABLE_DEBUG_INFO = NO;
632662
SDKROOT = iphoneos;
633663
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
634-
SWIFT_VERSION = 3.0;
664+
SWIFT_VERSION = 4.0;
635665
TARGETED_DEVICE_FAMILY = "1,2";
636666
VALIDATE_PRODUCT = YES;
637667
VERSIONING_SYSTEM = "apple-generic";
@@ -657,7 +687,6 @@
657687
PRODUCT_BUNDLE_IDENTIFIER = "com.olebegemann.SortedArray-iOS";
658688
PRODUCT_NAME = SortedArray;
659689
SKIP_INSTALL = YES;
660-
SWIFT_VERSION = 3.0;
661690
};
662691
name = Debug;
663692
};
@@ -678,7 +707,6 @@
678707
PRODUCT_BUNDLE_IDENTIFIER = "com.olebegemann.SortedArray-iOS";
679708
PRODUCT_NAME = SortedArray;
680709
SKIP_INSTALL = YES;
681-
SWIFT_VERSION = 3.0;
682710
};
683711
name = Release;
684712
};
@@ -690,7 +718,6 @@
690718
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
691719
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-iOS-Tests";
692720
PRODUCT_NAME = "$(TARGET_NAME)";
693-
SWIFT_VERSION = 3.0;
694721
};
695722
name = Debug;
696723
};
@@ -702,7 +729,6 @@
702729
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
703730
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-iOS-Tests";
704731
PRODUCT_NAME = "$(TARGET_NAME)";
705-
SWIFT_VERSION = 3.0;
706732
};
707733
name = Release;
708734
};
@@ -722,7 +748,6 @@
722748
PRODUCT_NAME = SortedArray;
723749
SDKROOT = watchos;
724750
SKIP_INSTALL = YES;
725-
SWIFT_VERSION = 3.0;
726751
TARGETED_DEVICE_FAMILY = 4;
727752
WATCHOS_DEPLOYMENT_TARGET = 2.0;
728753
};
@@ -744,7 +769,6 @@
744769
PRODUCT_NAME = SortedArray;
745770
SDKROOT = watchos;
746771
SKIP_INSTALL = YES;
747-
SWIFT_VERSION = 3.0;
748772
TARGETED_DEVICE_FAMILY = 4;
749773
WATCHOS_DEPLOYMENT_TARGET = 2.0;
750774
};
@@ -766,7 +790,6 @@
766790
PRODUCT_NAME = SortedArray;
767791
SDKROOT = appletvos;
768792
SKIP_INSTALL = YES;
769-
SWIFT_VERSION = 3.0;
770793
TARGETED_DEVICE_FAMILY = 3;
771794
TVOS_DEPLOYMENT_TARGET = 9.0;
772795
};
@@ -788,7 +811,6 @@
788811
PRODUCT_NAME = SortedArray;
789812
SDKROOT = appletvos;
790813
SKIP_INSTALL = YES;
791-
SWIFT_VERSION = 3.0;
792814
TARGETED_DEVICE_FAMILY = 3;
793815
TVOS_DEPLOYMENT_TARGET = 9.0;
794816
};
@@ -813,7 +835,6 @@
813835
PRODUCT_NAME = SortedArray;
814836
SDKROOT = macosx;
815837
SKIP_INSTALL = YES;
816-
SWIFT_VERSION = 3.0;
817838
};
818839
name = Debug;
819840
};
@@ -836,7 +857,6 @@
836857
PRODUCT_NAME = SortedArray;
837858
SDKROOT = macosx;
838859
SKIP_INSTALL = YES;
839-
SWIFT_VERSION = 3.0;
840860
};
841861
name = Release;
842862
};
@@ -851,7 +871,6 @@
851871
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-macOS-Tests";
852872
PRODUCT_NAME = "$(TARGET_NAME)";
853873
SDKROOT = macosx;
854-
SWIFT_VERSION = 3.0;
855874
};
856875
name = Debug;
857876
};
@@ -866,7 +885,6 @@
866885
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-macOS-Tests";
867886
PRODUCT_NAME = "$(TARGET_NAME)";
868887
SDKROOT = macosx;
869-
SWIFT_VERSION = 3.0;
870888
};
871889
name = Release;
872890
};
@@ -878,7 +896,6 @@
878896
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-tvOS-Tests";
879897
PRODUCT_NAME = "$(TARGET_NAME)";
880898
SDKROOT = appletvos;
881-
SWIFT_VERSION = 3.0;
882899
TVOS_DEPLOYMENT_TARGET = 9.1;
883900
};
884901
name = Debug;
@@ -891,7 +908,6 @@
891908
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-tvOS-Tests";
892909
PRODUCT_NAME = "$(TARGET_NAME)";
893910
SDKROOT = appletvos;
894-
SWIFT_VERSION = 3.0;
895911
TVOS_DEPLOYMENT_TARGET = 9.1;
896912
};
897913
name = Release;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

SortedArray.xcodeproj/xcshareddata/xcschemes/Performance-Tests-macOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -27,7 +27,6 @@
2727
selectedDebuggerIdentifier = ""
2828
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
2929
disableMainThreadChecker = "YES"
30-
language = ""
3130
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
@@ -62,7 +61,6 @@
6261
buildConfiguration = "Release"
6362
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6463
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
65-
language = ""
6664
launchStyle = "0"
6765
useCustomWorkingDirectory = "NO"
6866
ignoresPersistentStateOnLaunch = "NO"

SortedArray.xcodeproj/xcshareddata/xcschemes/SortedArray-iOS.xcscheme

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

0 commit comments

Comments
 (0)