Skip to content

Commit

Permalink
Update to Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
woxtu committed Apr 27, 2019
1 parent c1c0595 commit fd20ff2
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 34 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode10.1
osx_image: xcode10.2
before_install:
- gem install xcpretty -N
script:
Expand Down
22 changes: 21 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
// swift-tools-version:5.0
import PackageDescription

let package = Package(
name: "Timepiece"
name: "Timepiece",
platforms: [
.macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v2)
],
products: [
.library(name: "Timepiece", targets: ["Timepiece"]),
],
dependencies: [],
targets: [
.target(
name: "Timepiece",
dependencies: [],
path: "Sources"
),
.testTarget(
name: "TimepieceTests",
dependencies: ["Timepiece"]
),
],
swiftLanguageVersions: [.v5]
)
2 changes: 1 addition & 1 deletion Sources/DateComponents+Timepiece.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public extension DateComponents {
///
/// - returns: The created a `String` instance.
@available(OSX 10.10, *)
public func string(in unitsStyle: DateComponentsFormatter.UnitsStyle) -> String? {
func string(in unitsStyle: DateComponentsFormatter.UnitsStyle) -> String? {
let dateComponentsFormatter = DateComponentsFormatter()
dateComponentsFormatter.unitsStyle = unitsStyle
dateComponentsFormatter.allowedUnits = [.year, .month, .weekOfMonth, .day, .hour, .minute, .second]
Expand Down
1 change: 1 addition & 0 deletions Timepiece.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/naoty/Timepiece.git", :tag => s.version }
s.source_files = "Sources/**/*.swift"
s.requires_arc = true
s.swift_version = '5.0'
end

63 changes: 37 additions & 26 deletions Timepiece.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
3DE7CFC01B27126F00E0F331 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3DE7CFC11B27126F00E0F331 /* Timepiece_OSXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Timepiece_OSXTests.swift; sourceTree = "<group>"; };
43D08A781E4F85FE00BE400A /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Date+TimepieceTests.swift"; path = "TimepieceTests/Date+TimepieceTests.swift"; sourceTree = "<group>"; };
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "DateComponents+TimepieceTests.swift"; path = "TimepieceTests/DateComponents+TimepieceTests.swift"; sourceTree = "<group>"; };
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Int+TimepieceTests.swift"; path = "TimepieceTests/Int+TimepieceTests.swift"; sourceTree = "<group>"; };
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+TimepieceTests.swift"; path = "TimepieceTests/String+TimepieceTests.swift"; sourceTree = "<group>"; };
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Date+TimepieceTests.swift"; sourceTree = "<group>"; };
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DateComponents+TimepieceTests.swift"; sourceTree = "<group>"; };
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Int+TimepieceTests.swift"; sourceTree = "<group>"; };
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+TimepieceTests.swift"; sourceTree = "<group>"; };
8015E2121BB9B41400545DF5 /* Timepiece.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Timepiece.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8061C29A1BB9B62200F0494D /* Timepiece.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Timepiece.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8061C2A31BB9B62200F0494D /* Timepiece tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Timepiece tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -179,10 +179,7 @@
3DC61829199E204800FB7AAC /* Tests */ = {
isa = PBXGroup;
children = (
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */,
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */,
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */,
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */,
4351806A22736A5E008BD0C4 /* TimepieceTests */,
);
path = Tests;
sourceTree = "<group>";
Expand Down Expand Up @@ -221,6 +218,17 @@
name = "Supporting Files";
sourceTree = "<group>";
};
4351806A22736A5E008BD0C4 /* TimepieceTests */ = {
isa = PBXGroup;
children = (
43D08A7A1E4F877700BE400A /* Date+TimepieceTests.swift */,
43D08A7B1E4F877700BE400A /* DateComponents+TimepieceTests.swift */,
43D08A7C1E4F877700BE400A /* Int+TimepieceTests.swift */,
43D08A7D1E4F877700BE400A /* String+TimepieceTests.swift */,
);
path = TimepieceTests;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -389,7 +397,7 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 1010;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Naoto Kaneko";
TargetAttributes = {
3DC6180E199E1F8400FB7AAC = {
Expand Down Expand Up @@ -425,10 +433,11 @@
};
buildConfigurationList = 3DC61809199E1F8400FB7AAC /* Build configuration list for PBXProject "Timepiece" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 3DC61805199E1F8400FB7AAC;
productRefGroup = 3DC61810199E1F8400FB7AAC /* Products */;
Expand Down Expand Up @@ -601,6 +610,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -650,7 +660,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -661,6 +671,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -702,7 +713,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -728,7 +739,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -749,7 +760,7 @@
PRODUCT_NAME = Timepiece;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -767,7 +778,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -781,7 +792,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down Expand Up @@ -809,7 +820,7 @@
PRODUCT_NAME = Timepiece;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -834,7 +845,7 @@
PRODUCT_NAME = Timepiece;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -859,7 +870,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -881,7 +892,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "naoty.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -902,7 +913,7 @@
PRODUCT_NAME = Timepiece;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
Expand All @@ -926,7 +937,7 @@
PRODUCT_NAME = Timepiece;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
Expand All @@ -950,7 +961,7 @@
PRODUCT_NAME = Timepiece;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -975,7 +986,7 @@
PRODUCT_NAME = Timepiece;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -992,7 +1003,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "naoty.Timepiece-tvOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
Expand All @@ -1009,7 +1020,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "naoty.Timepiece-tvOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
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 = "1010"
LastUpgradeVersion = "1020"
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 = "1010"
LastUpgradeVersion = "1020"
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 = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit fd20ff2

Please sign in to comment.