Skip to content

Commit ad61278

Browse files
committed
Update to Swift 4.1
1 parent 4e2164e commit ad61278

File tree

9 files changed

+74
-26
lines changed

9 files changed

+74
-26
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.1

Example/Podfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ target 'SwiftCronExampleTests' do
88
pod 'SwiftCron', :path => '../'
99
end
1010

11+
pre_install do |installer|
12+
def installer.verify_no_static_framework_transitive_dependencies; end
13+
end

Example/SwiftCronExample.xcodeproj/project.pbxproj

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,16 @@
242242
isa = PBXProject;
243243
attributes = {
244244
LastSwiftUpdateCheck = 0730;
245-
LastUpgradeCheck = 0800;
245+
LastUpgradeCheck = 0930;
246246
ORGANIZATIONNAME = Rush42;
247247
TargetAttributes = {
248248
8679D2701CE1F4730071D783 = {
249249
CreatedOnToolsVersion = 7.3;
250-
LastSwiftMigration = 0800;
250+
LastSwiftMigration = 0930;
251251
};
252252
8679D2841CE1F4740071D783 = {
253253
CreatedOnToolsVersion = 7.3;
254-
LastSwiftMigration = 0800;
254+
LastSwiftMigration = 0930;
255255
TestTargetID = 8679D2701CE1F4730071D783;
256256
};
257257
};
@@ -332,9 +332,12 @@
332332
files = (
333333
);
334334
inputPaths = (
335+
"${SRCROOT}/Pods/Target Support Files/Pods-SwiftCronExample/Pods-SwiftCronExample-frameworks.sh",
336+
"${BUILT_PRODUCTS_DIR}/SwiftCron/SwiftCron.framework",
335337
);
336338
name = "[CP] Embed Pods Frameworks";
337339
outputPaths = (
340+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftCron.framework",
338341
);
339342
runOnlyForDeploymentPostprocessing = 0;
340343
shellPath = /bin/sh;
@@ -347,13 +350,16 @@
347350
files = (
348351
);
349352
inputPaths = (
353+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
354+
"${PODS_ROOT}/Manifest.lock",
350355
);
351356
name = "[CP] Check Pods Manifest.lock";
352357
outputPaths = (
358+
"$(DERIVED_FILE_DIR)/Pods-SwiftCronExampleTests-checkManifestLockResult.txt",
353359
);
354360
runOnlyForDeploymentPostprocessing = 0;
355361
shellPath = /bin/sh;
356-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
362+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
357363
showEnvVarsInLog = 0;
358364
};
359365
E87025957E0569C2E0F11DA7 /* [CP] Check Pods Manifest.lock */ = {
@@ -362,13 +368,16 @@
362368
files = (
363369
);
364370
inputPaths = (
371+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
372+
"${PODS_ROOT}/Manifest.lock",
365373
);
366374
name = "[CP] Check Pods Manifest.lock";
367375
outputPaths = (
376+
"$(DERIVED_FILE_DIR)/Pods-SwiftCronExample-checkManifestLockResult.txt",
368377
);
369378
runOnlyForDeploymentPostprocessing = 0;
370379
shellPath = /bin/sh;
371-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
380+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
372381
showEnvVarsInLog = 0;
373382
};
374383
FB1006182B176A61E545DAAD /* [CP] Embed Pods Frameworks */ = {
@@ -377,9 +386,12 @@
377386
files = (
378387
);
379388
inputPaths = (
389+
"${SRCROOT}/Pods/Target Support Files/Pods-SwiftCronExampleTests/Pods-SwiftCronExampleTests-frameworks.sh",
390+
"${BUILT_PRODUCTS_DIR}/SwiftCron/SwiftCron.framework",
380391
);
381392
name = "[CP] Embed Pods Frameworks";
382393
outputPaths = (
394+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftCron.framework",
383395
);
384396
runOnlyForDeploymentPostprocessing = 0;
385397
shellPath = /bin/sh;
@@ -456,14 +468,22 @@
456468
CLANG_CXX_LIBRARY = "libc++";
457469
CLANG_ENABLE_MODULES = YES;
458470
CLANG_ENABLE_OBJC_ARC = YES;
471+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
459472
CLANG_WARN_BOOL_CONVERSION = YES;
473+
CLANG_WARN_COMMA = YES;
460474
CLANG_WARN_CONSTANT_CONVERSION = YES;
475+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
461476
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
462477
CLANG_WARN_EMPTY_BODY = YES;
463478
CLANG_WARN_ENUM_CONVERSION = YES;
464479
CLANG_WARN_INFINITE_RECURSION = YES;
465480
CLANG_WARN_INT_CONVERSION = YES;
481+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
482+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
483+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
466484
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
485+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
486+
CLANG_WARN_STRICT_PROTOTYPES = YES;
467487
CLANG_WARN_SUSPICIOUS_MOVE = YES;
468488
CLANG_WARN_UNREACHABLE_CODE = YES;
469489
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -503,14 +523,22 @@
503523
CLANG_CXX_LIBRARY = "libc++";
504524
CLANG_ENABLE_MODULES = YES;
505525
CLANG_ENABLE_OBJC_ARC = YES;
526+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
506527
CLANG_WARN_BOOL_CONVERSION = YES;
528+
CLANG_WARN_COMMA = YES;
507529
CLANG_WARN_CONSTANT_CONVERSION = YES;
530+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
508531
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
509532
CLANG_WARN_EMPTY_BODY = YES;
510533
CLANG_WARN_ENUM_CONVERSION = YES;
511534
CLANG_WARN_INFINITE_RECURSION = YES;
512535
CLANG_WARN_INT_CONVERSION = YES;
536+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
537+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
538+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
513539
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
540+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
541+
CLANG_WARN_STRICT_PROTOTYPES = YES;
514542
CLANG_WARN_SUSPICIOUS_MOVE = YES;
515543
CLANG_WARN_UNREACHABLE_CODE = YES;
516544
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -545,7 +573,8 @@
545573
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
546574
PRODUCT_BUNDLE_IDENTIFIER = com.Rush42.SwiftCronExample;
547575
PRODUCT_NAME = "$(TARGET_NAME)";
548-
SWIFT_VERSION = 3.0;
576+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
577+
SWIFT_VERSION = 4.0;
549578
};
550579
name = Debug;
551580
};
@@ -559,7 +588,8 @@
559588
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
560589
PRODUCT_BUNDLE_IDENTIFIER = com.Rush42.SwiftCronExample;
561590
PRODUCT_NAME = "$(TARGET_NAME)";
562-
SWIFT_VERSION = 3.0;
591+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
592+
SWIFT_VERSION = 4.0;
563593
};
564594
name = Release;
565595
};
@@ -576,7 +606,8 @@
576606
PRODUCT_NAME = "$(TARGET_NAME)";
577607
SWIFT_OBJC_BRIDGING_HEADER = "SwiftCronExampleTests/SwiftCronExampleTests-Bridging-Header.h";
578608
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
579-
SWIFT_VERSION = 3.0;
609+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
610+
SWIFT_VERSION = 4.0;
580611
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftCronExample.app/SwiftCronExample";
581612
};
582613
name = Debug;
@@ -593,7 +624,8 @@
593624
PRODUCT_BUNDLE_IDENTIFIER = com.Rush42.SwiftCronExampleTests;
594625
PRODUCT_NAME = "$(TARGET_NAME)";
595626
SWIFT_OBJC_BRIDGING_HEADER = "SwiftCronExampleTests/SwiftCronExampleTests-Bridging-Header.h";
596-
SWIFT_VERSION = 3.0;
627+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
628+
SWIFT_VERSION = 4.0;
597629
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftCronExample.app/SwiftCronExample";
598630
};
599631
name = Release;

Example/SwiftCronExample.xcodeproj/xcshareddata/xcschemes/SwiftCronExample.xcscheme

Lines changed: 3 additions & 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 = "0800"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,8 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES"
30-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<Testables>
3232
<TestableReference
3333
skipped = "NO">

Example/SwiftCronExample.xcodeproj/xcshareddata/xcschemes/SwiftCronTests.xcscheme

Lines changed: 3 additions & 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 = "0800"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,8 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES"
30-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<Testables>
3232
<TestableReference
3333
skipped = "NO">
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>

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ A cron expression parser that can take a cron string and give you the next run d
1212
Podfile:
1313

1414
```ruby
15-
source 'https://github.com/CocoaPods/Specs.git'
16-
platform :ios, '9.0'
17-
use_frameworks!
18-
1915
pod 'SwiftCron'
2016
```
2117

@@ -35,6 +31,12 @@ Package.swift:
3531
.Package(url: "https://github.com/TheCodedSelf/SwiftCron.git", majorVersion: 0)
3632
```
3733

34+
## Requirements
35+
36+
- iOS 9.0 or greater
37+
- Xcode 8.0 or greater
38+
- Swift 3 or greater
39+
3840
Usage
3941
--------
4042
##### Create a Cron Expression
@@ -87,8 +89,3 @@ let nextRunDate = myCronExpression.getNextRunDate(dateToStartSearchOn)
8789
- Pull requests for bug fixes and new features are most welcome.
8890
- Pull requests will only be merged once the Travis CI build passes.
8991

90-
## Requirements
91-
92-
- iOS 9.0 or greater
93-
- Xcode 8.0 or greater
94-
- Swift 3 or greater

Sources/StringValidator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ struct StringValidator {
3030
#endif
3131

3232
let regex = try! Regex(pattern: regex, options: [])
33-
return regex.numberOfMatches(in: value, options: [], range: NSMakeRange(0, value.characters.count)) > 0
33+
return regex.numberOfMatches(in: value, options: [], range: NSMakeRange(0, value.count)) > 0
3434
}
3535
}
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>

0 commit comments

Comments
 (0)