Skip to content

Commit 73b86c7

Browse files
committed
Convert to swift 4
Add an underlying error cause to FileKitError if any
1 parent 8599917 commit 73b86c7

33 files changed

+419
-264
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.0

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: objective-c
2+
osx_image: xcode9
3+
env:
4+
global:
5+
- LC_CTYPE=en_US.UTF-8
6+
- LANG=en_US.UTF-8
7+
- PROJECT=FileKit.xcodeproj
8+
- IOS_FRAMEWORK_SCHEME="FileKit-iOS"
9+
- MACOS_FRAMEWORK_SCHEME="FileKit-OSX"
10+
- IOS_SDK=iphonesimulator11.0
11+
- MACOS_SDK=macosx10.13
12+
matrix:
13+
- DESTINATION="OS=11.0,name=iPhone 8" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES"
14+
- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK=macosx10.13 RUN_TESTS="NO"
15+
before_install:
16+
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
17+
script:
18+
- set -o pipefail
19+
- xcodebuild -version
20+
- xcodebuild -showsdks
21+
22+
- if [ $RUN_TESTS == "YES" ]; then
23+
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
24+
else
25+
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
26+
fi
27+
after_success:
28+
- bash <(curl -s https://codecov.io/bash)
29+
30+
branches:
31+
only:
32+
- master

FileKit.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Pod::Spec.new do |s|
22
s.name = "FileKit"
3-
s.version = "4.0.1"
3+
s.version = "5.0.0"
44
s.summary = "Simple and expressive file management in Swift."
55
s.homepage = "https://github.com/nvzqz/FileKit"
66
s.license = { :type => "MIT", :file => "LICENSE.md" }
77
s.author = "Nikolai Vazquez"
8-
s.ios.deployment_target = "8.0"
9-
s.osx.deployment_target = "10.9"
8+
s.ios.deployment_target = "9.0"
9+
s.osx.deployment_target = "10.11"
1010
s.osx.exclude_files = "FileKit/*/FileProtection.swift"
11-
s.watchos.deployment_target = '2.0'
11+
s.watchos.deployment_target = '3.0'
1212
s.tvos.deployment_target = '9.0'
1313
s.source = { :git => "https://github.com/nvzqz/FileKit.git", :tag => "v#{s.version}" }
1414
s.source_files = "Sources/*.swift"

FileKit.xcodeproj/project.pbxproj

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -475,20 +475,20 @@
475475
isa = PBXProject;
476476
attributes = {
477477
LastSwiftUpdateCheck = 0700;
478-
LastUpgradeCheck = 0820;
478+
LastUpgradeCheck = 0900;
479479
ORGANIZATIONNAME = "Nikolai Vazquez";
480480
TargetAttributes = {
481481
5204B84A1B96B83800AA473F = {
482482
CreatedOnToolsVersion = 7.0;
483-
LastSwiftMigration = 0800;
483+
LastSwiftMigration = 0900;
484484
};
485485
5204B8571B96B85E00AA473F = {
486486
CreatedOnToolsVersion = 7.0;
487487
LastSwiftMigration = 0800;
488488
};
489489
5263A9031B96BA3D00635A93 = {
490490
CreatedOnToolsVersion = 7.0;
491-
LastSwiftMigration = 0800;
491+
LastSwiftMigration = 0900;
492492
};
493493
527612411BAEA3EE00503D0A = {
494494
CreatedOnToolsVersion = 7.0;
@@ -794,14 +794,20 @@
794794
CLANG_CXX_LIBRARY = "libc++";
795795
CLANG_ENABLE_MODULES = YES;
796796
CLANG_ENABLE_OBJC_ARC = YES;
797+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
797798
CLANG_WARN_BOOL_CONVERSION = YES;
799+
CLANG_WARN_COMMA = YES;
798800
CLANG_WARN_CONSTANT_CONVERSION = YES;
799801
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
800802
CLANG_WARN_EMPTY_BODY = YES;
801803
CLANG_WARN_ENUM_CONVERSION = YES;
802804
CLANG_WARN_INFINITE_RECURSION = YES;
803805
CLANG_WARN_INT_CONVERSION = YES;
806+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
807+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
804808
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
809+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
810+
CLANG_WARN_STRICT_PROTOTYPES = YES;
805811
CLANG_WARN_SUSPICIOUS_MOVE = YES;
806812
CLANG_WARN_UNREACHABLE_CODE = YES;
807813
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -846,14 +852,20 @@
846852
CLANG_CXX_LIBRARY = "libc++";
847853
CLANG_ENABLE_MODULES = YES;
848854
CLANG_ENABLE_OBJC_ARC = YES;
855+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
849856
CLANG_WARN_BOOL_CONVERSION = YES;
857+
CLANG_WARN_COMMA = YES;
850858
CLANG_WARN_CONSTANT_CONVERSION = YES;
851859
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
852860
CLANG_WARN_EMPTY_BODY = YES;
853861
CLANG_WARN_ENUM_CONVERSION = YES;
854862
CLANG_WARN_INFINITE_RECURSION = YES;
855863
CLANG_WARN_INT_CONVERSION = YES;
864+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
865+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
856866
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
867+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
868+
CLANG_WARN_STRICT_PROTOTYPES = YES;
857869
CLANG_WARN_SUSPICIOUS_MOVE = YES;
858870
CLANG_WARN_UNREACHABLE_CODE = YES;
859871
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -897,7 +909,8 @@
897909
PRODUCT_BUNDLE_IDENTIFIER = "com.nikolaivazquez.$(PROJECT_NAME)";
898910
PRODUCT_NAME = "$(PROJECT_NAME)";
899911
SKIP_INSTALL = YES;
900-
SWIFT_VERSION = 3.0;
912+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
913+
SWIFT_VERSION = 4.0;
901914
};
902915
name = Debug;
903916
};
@@ -917,7 +930,8 @@
917930
PRODUCT_NAME = "$(PROJECT_NAME)";
918931
SKIP_INSTALL = YES;
919932
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
920-
SWIFT_VERSION = 3.0;
933+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
934+
SWIFT_VERSION = 4.0;
921935
};
922936
name = Release;
923937
};
@@ -936,7 +950,7 @@
936950
PRODUCT_NAME = "$(PROJECT_NAME)";
937951
SDKROOT = iphoneos;
938952
SKIP_INSTALL = YES;
939-
SWIFT_VERSION = 3.0;
953+
SWIFT_VERSION = 4.0;
940954
TARGETED_DEVICE_FAMILY = "1,2";
941955
};
942956
name = Debug;
@@ -957,7 +971,7 @@
957971
SDKROOT = iphoneos;
958972
SKIP_INSTALL = YES;
959973
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
960-
SWIFT_VERSION = 3.0;
974+
SWIFT_VERSION = 4.0;
961975
TARGETED_DEVICE_FAMILY = "1,2";
962976
VALIDATE_PRODUCT = YES;
963977
};
@@ -971,7 +985,8 @@
971985
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
972986
PRODUCT_BUNDLE_IDENTIFIER = com.nikolaivazquez.FileKitTests;
973987
PRODUCT_NAME = "$(TARGET_NAME)";
974-
SWIFT_VERSION = 3.0;
988+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
989+
SWIFT_VERSION = 4.0;
975990
};
976991
name = Debug;
977992
};
@@ -984,7 +999,8 @@
984999
PRODUCT_BUNDLE_IDENTIFIER = com.nikolaivazquez.FileKitTests;
9851000
PRODUCT_NAME = "$(TARGET_NAME)";
9861001
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
987-
SWIFT_VERSION = 3.0;
1002+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
1003+
SWIFT_VERSION = 4.0;
9881004
};
9891005
name = Release;
9901006
};
@@ -1003,6 +1019,7 @@
10031019
PRODUCT_NAME = "$(PROJECT_NAME)";
10041020
SDKROOT = watchos;
10051021
SKIP_INSTALL = YES;
1022+
SWIFT_VERSION = 4.0;
10061023
TARGETED_DEVICE_FAMILY = 4;
10071024
WATCHOS_DEPLOYMENT_TARGET = 2.0;
10081025
};
@@ -1024,6 +1041,7 @@
10241041
SDKROOT = watchos;
10251042
SKIP_INSTALL = YES;
10261043
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1044+
SWIFT_VERSION = 4.0;
10271045
TARGETED_DEVICE_FAMILY = 4;
10281046
VALIDATE_PRODUCT = YES;
10291047
WATCHOS_DEPLOYMENT_TARGET = 2.0;
@@ -1045,6 +1063,7 @@
10451063
PRODUCT_NAME = "$(PROJECT_NAME)";
10461064
SDKROOT = appletvos;
10471065
SKIP_INSTALL = YES;
1066+
SWIFT_VERSION = 4.0;
10481067
TARGETED_DEVICE_FAMILY = 3;
10491068
TVOS_DEPLOYMENT_TARGET = 9.0;
10501069
};
@@ -1066,6 +1085,7 @@
10661085
SDKROOT = appletvos;
10671086
SKIP_INSTALL = YES;
10681087
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1088+
SWIFT_VERSION = 4.0;
10691089
TARGETED_DEVICE_FAMILY = 3;
10701090
TVOS_DEPLOYMENT_TARGET = 9.0;
10711091
VALIDATE_PRODUCT = YES;

FileKit.xcodeproj/xcshareddata/xcschemes/FileKit-OSX.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 = "0820"
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
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Release"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

FileKit.xcodeproj/xcshareddata/xcschemes/FileKit-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 = "0820"
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
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Release"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

FileKit.xcodeproj/xcshareddata/xcschemes/FileKit-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 = "0820"
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
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Release"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

FileKit.xcodeproj/xcshareddata/xcschemes/FileKit-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 = "0820"
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
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Release"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

FileKit.xcodeproj/xcshareddata/xcschemes/FileKitTests.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 = "0820"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -10,6 +10,7 @@
1010
buildConfiguration = "Debug"
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
language = ""
1314
shouldUseLaunchSchemeArgsEnv = "YES"
1415
codeCoverageEnabled = "YES">
1516
<Testables>
@@ -31,6 +32,7 @@
3132
buildConfiguration = "Debug"
3233
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3334
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
35+
language = ""
3436
launchStyle = "0"
3537
useCustomWorkingDirectory = "NO"
3638
ignoresPersistentStateOnLaunch = "NO"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ to learn more.
6161
```ruby
6262
use_frameworks!
6363

64-
pod 'FileKit', '~> 4.0.1'
64+
pod 'FileKit', '~> 5.0.0'
6565
```
6666

6767
2. Run `pod install` and open the `.xcworkspace` file to launch Xcode.

0 commit comments

Comments
 (0)