Skip to content

Commit 7543b76

Browse files
authored
Merge pull request #12 from ole/swift3.2
Swift 3.2 and 4.0 compatibility
2 parents 83497d8 + 1cc41e4 commit 7543b76

File tree

12 files changed

+72
-33
lines changed

12 files changed

+72
-33
lines changed

.travis.yml

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

813
- os: linux
914
language: generic
@@ -22,7 +27,7 @@ matrix:
2227
#
2328
# You can use tags to select a specific Swift version if the
2429
# image supports it, e.g. "swift:3.0.2" or "swift:latest".
25-
DOCKER_IMAGE="swift:3.0.2"
30+
DOCKER_IMAGE="swift:3.1"
2631

2732
script:
2833
- chmod ugo+x ./scripts/travis-build-script.sh

Configs/SortedArray.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.3</string>
18+
<string>0.5</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
// swift-tools-version:3.1
12
import PackageDescription
23

34
/// Provides the `SortedArray` type, an array that keeps its elements
45
/// sorted according to a given sort predicate.
56
///
67
/// - Author: Ole Begemann
8+
/// - Seealso: https://github.com/ole/SortedArray
79
/// - Seealso: https://blog/2017/02/sorted-array/
810
///
911
let package = Package(
10-
name: "SortedArray"
12+
name: "SortedArray",
13+
swiftLanguageVersions: [3, 4]
1114
)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# SortedArray
22

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

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

77
Written by Ole Begemann, February 2017.
88

9-
For more info, see my accompanying [blog article](https://oleb.net/blog/2017/02/sorted-array/).
9+
For more info, see the [GitHub repo](https://github.com/ole/SortedArray) and my accompanying [blog article](https://oleb.net/blog/2017/02/sorted-array/).
1010

1111
## Status
1212

1313
[![Build Status](https://travis-ci.org/ole/SortedArray.svg?branch=master)](https://travis-ci.org/ole/SortedArray)
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.
18+
1719
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.
1820

1921
I tested it on macOS, iOS, tvOS, and Linux.

SortedArray.xcodeproj/project.pbxproj

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -334,36 +334,36 @@
334334
isa = PBXProject;
335335
attributes = {
336336
LastSwiftUpdateCheck = 0720;
337-
LastUpgradeCheck = 0810;
337+
LastUpgradeCheck = 0900;
338338
ORGANIZATIONNAME = SortedArray;
339339
TargetAttributes = {
340340
52D6D97B1BEFF229002C0205 = {
341341
CreatedOnToolsVersion = 7.1;
342-
LastSwiftMigration = 0800;
342+
LastSwiftMigration = 0900;
343343
};
344344
52D6D9851BEFF229002C0205 = {
345345
CreatedOnToolsVersion = 7.1;
346-
LastSwiftMigration = 0800;
346+
LastSwiftMigration = 0900;
347347
};
348348
52D6D9E11BEFFF6E002C0205 = {
349349
CreatedOnToolsVersion = 7.1;
350-
LastSwiftMigration = 0800;
350+
LastSwiftMigration = 0900;
351351
};
352352
52D6D9EF1BEFFFBE002C0205 = {
353353
CreatedOnToolsVersion = 7.1;
354-
LastSwiftMigration = 0800;
354+
LastSwiftMigration = 0900;
355355
};
356356
52D6DA0E1BF000BD002C0205 = {
357357
CreatedOnToolsVersion = 7.1;
358-
LastSwiftMigration = 0800;
358+
LastSwiftMigration = 0900;
359359
};
360360
DD7502791C68FCFC006590AF = {
361361
CreatedOnToolsVersion = 7.2.1;
362-
LastSwiftMigration = 0800;
362+
LastSwiftMigration = 0900;
363363
};
364364
DD75028C1C690C7A006590AF = {
365365
CreatedOnToolsVersion = 7.2.1;
366-
LastSwiftMigration = 0800;
366+
LastSwiftMigration = 0900;
367367
};
368368
};
369369
};
@@ -531,14 +531,20 @@
531531
CLANG_CXX_LIBRARY = "libc++";
532532
CLANG_ENABLE_MODULES = YES;
533533
CLANG_ENABLE_OBJC_ARC = YES;
534+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
534535
CLANG_WARN_BOOL_CONVERSION = YES;
536+
CLANG_WARN_COMMA = YES;
535537
CLANG_WARN_CONSTANT_CONVERSION = YES;
536538
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
537539
CLANG_WARN_EMPTY_BODY = YES;
538540
CLANG_WARN_ENUM_CONVERSION = YES;
539541
CLANG_WARN_INFINITE_RECURSION = YES;
540542
CLANG_WARN_INT_CONVERSION = YES;
543+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
544+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
541545
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
546+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
547+
CLANG_WARN_STRICT_PROTOTYPES = YES;
542548
CLANG_WARN_SUSPICIOUS_MOVE = YES;
543549
CLANG_WARN_UNREACHABLE_CODE = YES;
544550
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -582,14 +588,20 @@
582588
CLANG_CXX_LIBRARY = "libc++";
583589
CLANG_ENABLE_MODULES = YES;
584590
CLANG_ENABLE_OBJC_ARC = YES;
591+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
585592
CLANG_WARN_BOOL_CONVERSION = YES;
593+
CLANG_WARN_COMMA = YES;
586594
CLANG_WARN_CONSTANT_CONVERSION = YES;
587595
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
588596
CLANG_WARN_EMPTY_BODY = YES;
589597
CLANG_WARN_ENUM_CONVERSION = YES;
590598
CLANG_WARN_INFINITE_RECURSION = YES;
591599
CLANG_WARN_INT_CONVERSION = YES;
600+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
601+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
592602
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
603+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
604+
CLANG_WARN_STRICT_PROTOTYPES = YES;
593605
CLANG_WARN_SUSPICIOUS_MOVE = YES;
594606
CLANG_WARN_UNREACHABLE_CODE = YES;
595607
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -610,6 +622,7 @@
610622
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
611623
MTL_ENABLE_DEBUG_INFO = NO;
612624
SDKROOT = iphoneos;
625+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
613626
SWIFT_VERSION = 3.0;
614627
TARGETED_DEVICE_FAMILY = "1,2";
615628
VALIDATE_PRODUCT = YES;
@@ -636,7 +649,6 @@
636649
PRODUCT_BUNDLE_IDENTIFIER = "com.olebegemann.SortedArray-iOS";
637650
PRODUCT_NAME = SortedArray;
638651
SKIP_INSTALL = YES;
639-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
640652
SWIFT_VERSION = 3.0;
641653
};
642654
name = Debug;
@@ -658,7 +670,6 @@
658670
PRODUCT_BUNDLE_IDENTIFIER = "com.olebegemann.SortedArray-iOS";
659671
PRODUCT_NAME = SortedArray;
660672
SKIP_INSTALL = YES;
661-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
662673
SWIFT_VERSION = 3.0;
663674
};
664675
name = Release;
@@ -671,7 +682,6 @@
671682
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
672683
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-iOS-Tests";
673684
PRODUCT_NAME = "$(TARGET_NAME)";
674-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
675685
SWIFT_VERSION = 3.0;
676686
};
677687
name = Debug;
@@ -684,7 +694,6 @@
684694
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
685695
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-iOS-Tests";
686696
PRODUCT_NAME = "$(TARGET_NAME)";
687-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
688697
SWIFT_VERSION = 3.0;
689698
};
690699
name = Release;
@@ -727,7 +736,6 @@
727736
PRODUCT_NAME = SortedArray;
728737
SDKROOT = watchos;
729738
SKIP_INSTALL = YES;
730-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
731739
SWIFT_VERSION = 3.0;
732740
TARGETED_DEVICE_FAMILY = 4;
733741
WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -772,7 +780,6 @@
772780
PRODUCT_NAME = SortedArray;
773781
SDKROOT = appletvos;
774782
SKIP_INSTALL = YES;
775-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
776783
SWIFT_VERSION = 3.0;
777784
TARGETED_DEVICE_FAMILY = 3;
778785
TVOS_DEPLOYMENT_TARGET = 9.0;
@@ -821,7 +828,6 @@
821828
PRODUCT_NAME = SortedArray;
822829
SDKROOT = macosx;
823830
SKIP_INSTALL = YES;
824-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
825831
SWIFT_VERSION = 3.0;
826832
};
827833
name = Release;
@@ -852,7 +858,6 @@
852858
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-macOS-Tests";
853859
PRODUCT_NAME = "$(TARGET_NAME)";
854860
SDKROOT = macosx;
855-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
856861
SWIFT_VERSION = 3.0;
857862
};
858863
name = Release;
@@ -878,7 +883,6 @@
878883
PRODUCT_BUNDLE_IDENTIFIER = "com.SortedArray.SortedArray-tvOS-Tests";
879884
PRODUCT_NAME = "$(TARGET_NAME)";
880885
SDKROOT = appletvos;
881-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
882886
SWIFT_VERSION = 3.0;
883887
TVOS_DEPLOYMENT_TARGET = 9.1;
884888
};
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>BuildSystemType</key>
6+
<string>Latest</string>
7+
</dict>
8+
</plist>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES"
3031
codeCoverageEnabled = "YES">
3132
<Testables>
@@ -56,6 +57,7 @@
5657
buildConfiguration = "Debug"
5758
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5859
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60+
language = ""
5961
launchStyle = "0"
6062
useCustomWorkingDirectory = "NO"
6163
ignoresPersistentStateOnLaunch = "NO"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES"
3031
codeCoverageEnabled = "YES">
3132
<Testables>
@@ -56,6 +57,7 @@
5657
buildConfiguration = "Debug"
5758
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5859
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60+
language = ""
5961
launchStyle = "0"
6062
useCustomWorkingDirectory = "NO"
6163
ignoresPersistentStateOnLaunch = "NO"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES"
3031
codeCoverageEnabled = "YES">
3132
<Testables>
@@ -56,6 +57,7 @@
5657
buildConfiguration = "Debug"
5758
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5859
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60+
language = ""
5961
launchStyle = "0"
6062
useCustomWorkingDirectory = "NO"
6163
ignoresPersistentStateOnLaunch = "NO"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES"
3031
codeCoverageEnabled = "YES">
3132
<Testables>
@@ -37,6 +38,7 @@
3738
buildConfiguration = "Debug"
3839
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3940
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
41+
language = ""
4042
launchStyle = "0"
4143
useCustomWorkingDirectory = "NO"
4244
ignoresPersistentStateOnLaunch = "NO"

0 commit comments

Comments
 (0)