Skip to content

Commit ec952e3

Browse files
committed
Upgrade to Swift 4.2
1 parent af3831e commit ec952e3

File tree

125 files changed

+39
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+39
-376
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
os: osx
22
language: objective-c
3-
osx_image: xcode9.2
3+
osx_image: xcode10
44

55
env:
66
global:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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>FILEHEADER</key>
6+
<string>
7+
// Copyright © 2017-present JamfKit. All rights reserved.
8+
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
9+
//</string>
10+
</dict>
11+
</plist>
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>

JamfKit/JamfKit.xcodeproj/project.pbxproj

+7-3
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@
11991199
isa = PBXProject;
12001200
attributes = {
12011201
LastSwiftUpdateCheck = 0920;
1202-
LastUpgradeCheck = 0900;
1202+
LastUpgradeCheck = 1000;
12031203
ORGANIZATIONNAME = JamfKit;
12041204
TargetAttributes = {
12051205
52D6D97B1BEFF229002C0205 = {
@@ -1768,12 +1768,14 @@
17681768
CLANG_WARN_BOOL_CONVERSION = YES;
17691769
CLANG_WARN_COMMA = YES;
17701770
CLANG_WARN_CONSTANT_CONVERSION = YES;
1771+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
17711772
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
17721773
CLANG_WARN_EMPTY_BODY = YES;
17731774
CLANG_WARN_ENUM_CONVERSION = YES;
17741775
CLANG_WARN_INFINITE_RECURSION = YES;
17751776
CLANG_WARN_INT_CONVERSION = YES;
17761777
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
1778+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
17771779
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
17781780
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
17791781
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -1807,7 +1809,7 @@
18071809
ONLY_ACTIVE_ARCH = YES;
18081810
SDKROOT = iphoneos;
18091811
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1810-
SWIFT_VERSION = 4.0;
1812+
SWIFT_VERSION = 4.2;
18111813
TARGETED_DEVICE_FAMILY = "1,2";
18121814
VERSIONING_SYSTEM = "apple-generic";
18131815
VERSION_INFO_PREFIX = "";
@@ -1826,12 +1828,14 @@
18261828
CLANG_WARN_BOOL_CONVERSION = YES;
18271829
CLANG_WARN_COMMA = YES;
18281830
CLANG_WARN_CONSTANT_CONVERSION = YES;
1831+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
18291832
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
18301833
CLANG_WARN_EMPTY_BODY = YES;
18311834
CLANG_WARN_ENUM_CONVERSION = YES;
18321835
CLANG_WARN_INFINITE_RECURSION = YES;
18331836
CLANG_WARN_INT_CONVERSION = YES;
18341837
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
1838+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
18351839
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
18361840
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
18371841
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -1857,7 +1861,7 @@
18571861
MACOSX_DEPLOYMENT_TARGET = 10.10;
18581862
MTL_ENABLE_DEBUG_INFO = NO;
18591863
SDKROOT = iphoneos;
1860-
SWIFT_VERSION = 4.0;
1864+
SWIFT_VERSION = 4.2;
18611865
TARGETED_DEVICE_FAMILY = "1,2";
18621866
VALIDATE_PRODUCT = YES;
18631867
VERSIONING_SYSTEM = "apple-generic";

JamfKit/JamfKit.xcodeproj/xcshareddata/xcschemes/JamfKit iOS.xcscheme

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

JamfKit/JamfKit.xcodeproj/xcshareddata/xcschemes/JamfKit macOS.xcscheme

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

JamfKit/JamfKit.xcodeproj/xcshareddata/xcschemes/JamfKit tvOS.xcscheme

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

JamfKit/Sources/Constants.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// Constants.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Extensions/StringExtension.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// StringExtension.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/JamfKit.h

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// JamfKit.h
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/BaseObject.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// BaseObject.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//
@@ -83,7 +80,7 @@ public class BaseObject: NSObject, Requestable, Identifiable {
8380
return elements
8481
}
8582

86-
let newElements = elementsNode.map { $0[singleNodeKey] }.flatMap { rawElementNode -> Element? in
83+
let newElements = elementsNode.map { $0[singleNodeKey] }.compactMap { rawElementNode -> Element? in
8784
guard let rawElement = rawElementNode else {
8885
return nil
8986
}

JamfKit/Sources/Models/Building.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// Building.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/Category.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// PolicyCategory.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/Computer/Computer.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// Computer.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/Computer/ComputerGeneral.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerGeneral.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/Computer/ComputerLocation.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// Location.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/Computer/ComputerPurchasing.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// Purchasing.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/Computer/ComputerRemoteManagement.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerRemoteManagement.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ComputerCommand/ComputerCommand.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerCommand.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//
@@ -41,7 +38,7 @@ public final class ComputerCommand: NSObject, Requestable, Endpoint, Subset {
4138
self.general = general
4239

4340
if let computersNode = json[ComputerCommand.ComputersKey] as? [String: [String: UInt]] {
44-
computers = computersNode.flatMap { $0.value }.flatMap { $1 }
41+
computers = computersNode.flatMap { $0.value }.compactMap { $1 }
4542
} else {
4643
computers = [UInt]()
4744
}

JamfKit/Sources/Models/ComputerCommand/ComputerCommandGeneral.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerCommandGeneral.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ComputerConfiguration/ComputerConfiguration.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerConfiguration.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ComputerConfiguration/ComputerConfigurationGeneral.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerConfigurationGeneral.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ComputerConfiguration/ComputerConfigurationManagement.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerConfigurationManagement.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ConfigurationProfile/ComputerConfigurationProfile/ComputerConfigurationProfile.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerConfigurationProfile.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ConfigurationProfile/ComputerConfigurationProfile/ComputerConfigurationProfileGeneral.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerConfigurationProfileGeneral.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ConfigurationProfile/ConfigurationProfileGeneral.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ConfigurationProfileGeneral.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ConfigurationProfile/MobileDeviceConfigurationProfile/MobileDeviceConfigurationProfile.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// MobileDeviceConfigurationProfile.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/ConfigurationProfile/MobileDeviceConfigurationProfile/MobileDeviceConfigurationProfileGeneral.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// MobileDeviceConfigurationProfileGeneral.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/Department.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// Department.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/DirectoryBinding.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// DirectoryBinding.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/HardwareGroup/ComputerGroup.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// ComputerGroup.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/HardwareGroup/HardwareGroup.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// HardwareGroup.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

JamfKit/Sources/Models/HardwareGroup/HardwareGroupCriterion.swift

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//
2-
// HardwareGroupCriterion.swift
3-
// JamfKit
4-
//
52
// Copyright © 2017-present JamfKit. All rights reserved.
63
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
74
//

0 commit comments

Comments
 (0)