Skip to content

Commit fd20ff2

Browse files
committed
Update to Swift 5
1 parent c1c0595 commit fd20ff2

File tree

11 files changed

+73
-34
lines changed

11 files changed

+73
-34
lines changed

.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode10.1
2+
osx_image: xcode10.2
33
before_install:
44
- gem install xcpretty -N
55
script:

Package.swift

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1+
// swift-tools-version:5.0
12
import PackageDescription
23

34
let package = Package(
4-
name: "Timepiece"
5+
name: "Timepiece",
6+
platforms: [
7+
.macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v2)
8+
],
9+
products: [
10+
.library(name: "Timepiece", targets: ["Timepiece"]),
11+
],
12+
dependencies: [],
13+
targets: [
14+
.target(
15+
name: "Timepiece",
16+
dependencies: [],
17+
path: "Sources"
18+
),
19+
.testTarget(
20+
name: "TimepieceTests",
21+
dependencies: ["Timepiece"]
22+
),
23+
],
24+
swiftLanguageVersions: [.v5]
525
)

Sources/DateComponents+Timepiece.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public extension DateComponents {
112112
///
113113
/// - returns: The created a `String` instance.
114114
@available(OSX 10.10, *)
115-
public func string(in unitsStyle: DateComponentsFormatter.UnitsStyle) -> String? {
115+
func string(in unitsStyle: DateComponentsFormatter.UnitsStyle) -> String? {
116116
let dateComponentsFormatter = DateComponentsFormatter()
117117
dateComponentsFormatter.unitsStyle = unitsStyle
118118
dateComponentsFormatter.allowedUnits = [.year, .month, .weekOfMonth, .day, .hour, .minute, .second]

Timepiece.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ Pod::Spec.new do |s|
1414
s.source = { :git => "https://github.com/naoty/Timepiece.git", :tag => s.version }
1515
s.source_files = "Sources/**/*.swift"
1616
s.requires_arc = true
17+
s.swift_version = '5.0'
1718
end
1819

Timepiece.xcodeproj/project.pbxproj

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
3DE7CFC01B27126F00E0F331 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7777
3DE7CFC11B27126F00E0F331 /* Timepiece_OSXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Timepiece_OSXTests.swift; sourceTree = "<group>"; };
7878
43D08A781E4F85FE00BE400A /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
79-
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Date+TimepieceTests.swift"; path = "TimepieceTests/Date+TimepieceTests.swift"; sourceTree = "<group>"; };
80-
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "DateComponents+TimepieceTests.swift"; path = "TimepieceTests/DateComponents+TimepieceTests.swift"; sourceTree = "<group>"; };
81-
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Int+TimepieceTests.swift"; path = "TimepieceTests/Int+TimepieceTests.swift"; sourceTree = "<group>"; };
82-
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+TimepieceTests.swift"; path = "TimepieceTests/String+TimepieceTests.swift"; sourceTree = "<group>"; };
79+
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Date+TimepieceTests.swift"; sourceTree = "<group>"; };
80+
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DateComponents+TimepieceTests.swift"; sourceTree = "<group>"; };
81+
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Int+TimepieceTests.swift"; sourceTree = "<group>"; };
82+
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+TimepieceTests.swift"; sourceTree = "<group>"; };
8383
8015E2121BB9B41400545DF5 /* Timepiece.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Timepiece.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8484
8061C29A1BB9B62200F0494D /* Timepiece.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Timepiece.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8585
8061C2A31BB9B62200F0494D /* Timepiece tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Timepiece tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -179,10 +179,7 @@
179179
3DC61829199E204800FB7AAC /* Tests */ = {
180180
isa = PBXGroup;
181181
children = (
182-
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */,
183-
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */,
184-
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */,
185-
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */,
182+
4351806A22736A5E008BD0C4 /* TimepieceTests */,
186183
);
187184
path = Tests;
188185
sourceTree = "<group>";
@@ -221,6 +218,17 @@
221218
name = "Supporting Files";
222219
sourceTree = "<group>";
223220
};
221+
4351806A22736A5E008BD0C4 /* TimepieceTests */ = {
222+
isa = PBXGroup;
223+
children = (
224+
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */,
225+
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */,
226+
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */,
227+
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */,
228+
);
229+
path = TimepieceTests;
230+
sourceTree = "<group>";
231+
};
224232
/* End PBXGroup section */
225233

226234
/* Begin PBXHeadersBuildPhase section */
@@ -389,7 +397,7 @@
389397
attributes = {
390398
LastSwiftMigration = 0700;
391399
LastSwiftUpdateCheck = 0700;
392-
LastUpgradeCheck = 1010;
400+
LastUpgradeCheck = 1020;
393401
ORGANIZATIONNAME = "Naoto Kaneko";
394402
TargetAttributes = {
395403
3DC6180E199E1F8400FB7AAC = {
@@ -425,10 +433,11 @@
425433
};
426434
buildConfigurationList = 3DC61809199E1F8400FB7AAC /* Build configuration list for PBXProject "Timepiece" */;
427435
compatibilityVersion = "Xcode 3.2";
428-
developmentRegion = English;
436+
developmentRegion = en;
429437
hasScannedForEncodings = 0;
430438
knownRegions = (
431439
en,
440+
Base,
432441
);
433442
mainGroup = 3DC61805199E1F8400FB7AAC;
434443
productRefGroup = 3DC61810199E1F8400FB7AAC /* Products */;
@@ -601,6 +610,7 @@
601610
isa = XCBuildConfiguration;
602611
buildSettings = {
603612
ALWAYS_SEARCH_USER_PATHS = NO;
613+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
604614
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
605615
CLANG_CXX_LIBRARY = "libc++";
606616
CLANG_ENABLE_MODULES = YES;
@@ -650,7 +660,7 @@
650660
ONLY_ACTIVE_ARCH = YES;
651661
SDKROOT = iphoneos;
652662
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
653-
SWIFT_VERSION = 4.2;
663+
SWIFT_VERSION = 5.0;
654664
TARGETED_DEVICE_FAMILY = "1,2";
655665
VERSIONING_SYSTEM = "apple-generic";
656666
VERSION_INFO_PREFIX = "";
@@ -661,6 +671,7 @@
661671
isa = XCBuildConfiguration;
662672
buildSettings = {
663673
ALWAYS_SEARCH_USER_PATHS = NO;
674+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
664675
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
665676
CLANG_CXX_LIBRARY = "libc++";
666677
CLANG_ENABLE_MODULES = YES;
@@ -702,7 +713,7 @@
702713
MTL_ENABLE_DEBUG_INFO = NO;
703714
SDKROOT = iphoneos;
704715
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
705-
SWIFT_VERSION = 4.2;
716+
SWIFT_VERSION = 5.0;
706717
TARGETED_DEVICE_FAMILY = "1,2";
707718
VALIDATE_PRODUCT = YES;
708719
VERSIONING_SYSTEM = "apple-generic";
@@ -728,7 +739,7 @@
728739
SKIP_INSTALL = YES;
729740
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
730741
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
731-
SWIFT_VERSION = 4.2;
742+
SWIFT_VERSION = 5.0;
732743
};
733744
name = Debug;
734745
};
@@ -749,7 +760,7 @@
749760
PRODUCT_NAME = Timepiece;
750761
SKIP_INSTALL = YES;
751762
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
752-
SWIFT_VERSION = 4.2;
763+
SWIFT_VERSION = 5.0;
753764
};
754765
name = Release;
755766
};
@@ -767,7 +778,7 @@
767778
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
768779
PRODUCT_NAME = "$(TARGET_NAME)";
769780
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
770-
SWIFT_VERSION = 4.2;
781+
SWIFT_VERSION = 5.0;
771782
};
772783
name = Debug;
773784
};
@@ -781,7 +792,7 @@
781792
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
782793
PRODUCT_NAME = "$(TARGET_NAME)";
783794
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
784-
SWIFT_VERSION = 4.2;
795+
SWIFT_VERSION = 5.0;
785796
};
786797
name = Release;
787798
};
@@ -809,7 +820,7 @@
809820
PRODUCT_NAME = Timepiece;
810821
SDKROOT = macosx;
811822
SKIP_INSTALL = YES;
812-
SWIFT_VERSION = 4.2;
823+
SWIFT_VERSION = 5.0;
813824
};
814825
name = Debug;
815826
};
@@ -834,7 +845,7 @@
834845
PRODUCT_NAME = Timepiece;
835846
SDKROOT = macosx;
836847
SKIP_INSTALL = YES;
837-
SWIFT_VERSION = 4.2;
848+
SWIFT_VERSION = 5.0;
838849
};
839850
name = Release;
840851
};
@@ -859,7 +870,7 @@
859870
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
860871
PRODUCT_NAME = "$(TARGET_NAME)";
861872
SDKROOT = macosx;
862-
SWIFT_VERSION = 4.2;
873+
SWIFT_VERSION = 5.0;
863874
};
864875
name = Debug;
865876
};
@@ -881,7 +892,7 @@
881892
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
882893
PRODUCT_NAME = "$(TARGET_NAME)";
883894
SDKROOT = macosx;
884-
SWIFT_VERSION = 4.2;
895+
SWIFT_VERSION = 5.0;
885896
};
886897
name = Release;
887898
};
@@ -902,7 +913,7 @@
902913
PRODUCT_NAME = Timepiece;
903914
SDKROOT = watchos;
904915
SKIP_INSTALL = YES;
905-
SWIFT_VERSION = 4.2;
916+
SWIFT_VERSION = 5.0;
906917
TARGETED_DEVICE_FAMILY = 4;
907918
WATCHOS_DEPLOYMENT_TARGET = 2.0;
908919
};
@@ -926,7 +937,7 @@
926937
PRODUCT_NAME = Timepiece;
927938
SDKROOT = watchos;
928939
SKIP_INSTALL = YES;
929-
SWIFT_VERSION = 4.2;
940+
SWIFT_VERSION = 5.0;
930941
TARGETED_DEVICE_FAMILY = 4;
931942
WATCHOS_DEPLOYMENT_TARGET = 2.0;
932943
};
@@ -950,7 +961,7 @@
950961
PRODUCT_NAME = Timepiece;
951962
SDKROOT = appletvos;
952963
SKIP_INSTALL = YES;
953-
SWIFT_VERSION = 4.2;
964+
SWIFT_VERSION = 5.0;
954965
TARGETED_DEVICE_FAMILY = 3;
955966
TVOS_DEPLOYMENT_TARGET = 9.0;
956967
};
@@ -975,7 +986,7 @@
975986
PRODUCT_NAME = Timepiece;
976987
SDKROOT = appletvos;
977988
SKIP_INSTALL = YES;
978-
SWIFT_VERSION = 4.2;
989+
SWIFT_VERSION = 5.0;
979990
TARGETED_DEVICE_FAMILY = 3;
980991
TVOS_DEPLOYMENT_TARGET = 9.0;
981992
};
@@ -992,7 +1003,7 @@
9921003
PRODUCT_BUNDLE_IDENTIFIER = "naoty.Timepiece-tvOS-Tests";
9931004
PRODUCT_NAME = "$(TARGET_NAME)";
9941005
SDKROOT = appletvos;
995-
SWIFT_VERSION = 4.2;
1006+
SWIFT_VERSION = 5.0;
9961007
TVOS_DEPLOYMENT_TARGET = 9.0;
9971008
};
9981009
name = Debug;
@@ -1009,7 +1020,7 @@
10091020
PRODUCT_BUNDLE_IDENTIFIER = "naoty.Timepiece-tvOS-Tests";
10101021
PRODUCT_NAME = "$(TARGET_NAME)";
10111022
SDKROOT = appletvos;
1012-
SWIFT_VERSION = 4.2;
1023+
SWIFT_VERSION = 5.0;
10131024
TVOS_DEPLOYMENT_TARGET = 9.0;
10141025
};
10151026
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>

Timepiece.xcodeproj/xcshareddata/xcschemes/Timepiece OSX.xcscheme

Lines changed: 1 addition & 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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Timepiece.xcodeproj/xcshareddata/xcschemes/Timepiece iOS.xcscheme

Lines changed: 1 addition & 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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Timepiece.xcodeproj/xcshareddata/xcschemes/Timepiece tvOS.xcscheme

Lines changed: 1 addition & 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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Timepiece.xcodeproj/xcshareddata/xcschemes/Timepiece watchOS.xcscheme

Lines changed: 1 addition & 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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)