Skip to content

Commit bd87529

Browse files
committed
update to Swift 5 and fix resulting errors and warnings
1 parent 483e653 commit bd87529

7 files changed

Lines changed: 39 additions & 27 deletions

File tree

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "roddi/FURRExtensions" "0.4.0"
1+
github "roddi/FURRExtensions" "0.5.0"

Diff/DiffArray.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ private struct CommonPathParameters<T: Equatable> {
247247
let vLength: Int
248248
}
249249

250+
// swiftlint:disable identifier_name
250251
private func walkFrontPath<T: Equatable>(
251252
commonParameters: CommonPathParameters<T>,
252253
currentD: Int,
@@ -353,6 +354,7 @@ private func walkReversePath<T: Equatable>(
353354
}
354355
return []
355356
}
357+
// swiftlint:enable identifier_name
356358

357359
// yes this method is way too long. Pull requests welcome!
358360
func diff_bisectOfArrays<T: Equatable>(arrayA inArrayA: [T], arrayB inArrayB: [T]) -> [Diff<T>] {

Diff/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.2</string>
18+
<string>0.5.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

DiffTests/DiffTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ class DiffTests: XCTestCase {
297297
}
298298

299299
func test011_prettySimpleCaseWithCharacters() {
300-
let arrayA = Array(String("helge").characters)
301-
let arrayB = Array(String("anna").characters)
300+
let arrayA = Array(String("helge"))
301+
let arrayB = Array(String("anna"))
302302

303303
let shouldBe = [
304-
Diff(operation: .delete, array: Array(String("helge").characters)),
305-
Diff(operation: .insert, array: Array(String("anna").characters))
304+
Diff(operation: .delete, array: Array(String("helge"))),
305+
Diff(operation: .insert, array: Array(String("anna")))
306306
]
307307

308308
let isActually = diffBetweenArrays(arrayA: arrayA, arrayB: arrayB)
@@ -315,8 +315,8 @@ class DiffTests: XCTestCase {
315315
let aText = "dfhgvsrktzblzbasvfkugkbfgarzkulbdzsasrzlruoiunouizubsvtzkbnuhjmluinsbrtzstbusrxdzsdztkbnsrtztinlukdbzjrthsrtubulz"
316316
let bText = "dfhgvsrkblzbasvfkugkfzbjdbfgarzkulbdzsasrzlruoiunouizubruwsvtznuhjmluinsbrtzstbusrxdzbkzwksdztkbnsrtztinlukdbzjrthsrtubulz"
317317

318-
let arrayA = Array(aText.characters)
319-
let arrayB = Array(bText.characters)
318+
let arrayA = Array(aText)
319+
let arrayB = Array(bText)
320320

321321
let isActually = diffBetweenArrays(arrayA: arrayA, arrayB: arrayB)
322322

FURRDiff.xcodeproj/project.pbxproj

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,27 @@
157157
isa = PBXProject;
158158
attributes = {
159159
LastSwiftUpdateCheck = 0700;
160-
LastUpgradeCheck = 0930;
160+
LastUpgradeCheck = 1020;
161161
ORGANIZATIONNAME = "Ruotger Deecke";
162162
TargetAttributes = {
163163
5698BA611B8DD18E008805E2 = {
164164
CreatedOnToolsVersion = 7.0;
165-
LastSwiftMigration = 0930;
165+
LastSwiftMigration = 1020;
166+
ProvisioningStyle = Automatic;
166167
};
167168
5698BA6B1B8DD18E008805E2 = {
168169
CreatedOnToolsVersion = 7.0;
169-
LastSwiftMigration = 0930;
170+
LastSwiftMigration = 1020;
170171
};
171172
};
172173
};
173174
buildConfigurationList = 5698BA5C1B8DD18E008805E2 /* Build configuration list for PBXProject "FURRDiff" */;
174175
compatibilityVersion = "Xcode 6.3";
175-
developmentRegion = English;
176+
developmentRegion = en;
176177
hasScannedForEncodings = 0;
177178
knownRegions = (
178179
en,
180+
Base,
179181
);
180182
mainGroup = 5698BA581B8DD18E008805E2;
181183
productRefGroup = 5698BA631B8DD18E008805E2 /* Products */;
@@ -283,8 +285,7 @@
283285
isa = XCBuildConfiguration;
284286
buildSettings = {
285287
ALWAYS_SEARCH_USER_PATHS = NO;
286-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
287-
CLANG_CXX_LIBRARY = "libc++";
288+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
288289
CLANG_ENABLE_MODULES = YES;
289290
CLANG_ENABLE_OBJC_ARC = YES;
290291
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
@@ -312,7 +313,6 @@
312313
DEBUG_INFORMATION_FORMAT = dwarf;
313314
ENABLE_STRICT_OBJC_MSGSEND = YES;
314315
ENABLE_TESTABILITY = YES;
315-
GCC_C_LANGUAGE_STANDARD = gnu99;
316316
GCC_DYNAMIC_NO_PIC = NO;
317317
GCC_NO_COMMON_BLOCKS = YES;
318318
GCC_OPTIMIZATION_LEVEL = 0;
@@ -326,12 +326,10 @@
326326
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
327327
GCC_WARN_UNUSED_FUNCTION = YES;
328328
GCC_WARN_UNUSED_VARIABLE = YES;
329-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
330329
MTL_ENABLE_DEBUG_INFO = YES;
331330
ONLY_ACTIVE_ARCH = YES;
332331
SDKROOT = iphoneos;
333332
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
334-
SWIFT_VERSION = 3.0.1;
335333
TARGETED_DEVICE_FAMILY = "1,2";
336334
VERSIONING_SYSTEM = "apple-generic";
337335
VERSION_INFO_PREFIX = "";
@@ -342,8 +340,7 @@
342340
isa = XCBuildConfiguration;
343341
buildSettings = {
344342
ALWAYS_SEARCH_USER_PATHS = NO;
345-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
346-
CLANG_CXX_LIBRARY = "libc++";
343+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
347344
CLANG_ENABLE_MODULES = YES;
348345
CLANG_ENABLE_OBJC_ARC = YES;
349346
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
@@ -371,18 +368,15 @@
371368
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
372369
ENABLE_NS_ASSERTIONS = NO;
373370
ENABLE_STRICT_OBJC_MSGSEND = YES;
374-
GCC_C_LANGUAGE_STANDARD = gnu99;
375371
GCC_NO_COMMON_BLOCKS = YES;
376372
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
377373
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
378374
GCC_WARN_UNDECLARED_SELECTOR = YES;
379375
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
380376
GCC_WARN_UNUSED_FUNCTION = YES;
381377
GCC_WARN_UNUSED_VARIABLE = YES;
382-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
383378
MTL_ENABLE_DEBUG_INFO = NO;
384379
SDKROOT = iphoneos;
385-
SWIFT_VERSION = 3.0.1;
386380
TARGETED_DEVICE_FAMILY = "1,2";
387381
VALIDATE_PRODUCT = YES;
388382
VERSIONING_SYSTEM = "apple-generic";
@@ -395,8 +389,11 @@
395389
buildSettings = {
396390
APPLICATION_EXTENSION_API_ONLY = YES;
397391
CLANG_ENABLE_MODULES = YES;
392+
CODE_SIGN_IDENTITY = "Mac Developer";
398393
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
394+
CODE_SIGN_STYLE = Automatic;
399395
DEFINES_MODULE = YES;
396+
DEVELOPMENT_TEAM = "";
400397
DYLIB_COMPATIBILITY_VERSION = 1;
401398
DYLIB_CURRENT_VERSION = 1;
402399
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -409,9 +406,10 @@
409406
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
410407
PRODUCT_BUNDLE_IDENTIFIER = com.RuotgerSkupin.Diff;
411408
PRODUCT_NAME = FURRDiff;
409+
PROVISIONING_PROFILE_SPECIFIER = "";
412410
SKIP_INSTALL = YES;
413411
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
414-
SWIFT_VERSION = 4.0;
412+
SWIFT_VERSION = 5.0;
415413
};
416414
name = Debug;
417415
};
@@ -420,8 +418,11 @@
420418
buildSettings = {
421419
APPLICATION_EXTENSION_API_ONLY = YES;
422420
CLANG_ENABLE_MODULES = YES;
421+
CODE_SIGN_IDENTITY = "Mac Developer";
423422
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
423+
CODE_SIGN_STYLE = Automatic;
424424
DEFINES_MODULE = YES;
425+
DEVELOPMENT_TEAM = "";
425426
DYLIB_COMPATIBILITY_VERSION = 1;
426427
DYLIB_CURRENT_VERSION = 1;
427428
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -434,10 +435,11 @@
434435
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
435436
PRODUCT_BUNDLE_IDENTIFIER = com.RuotgerSkupin.Diff;
436437
PRODUCT_NAME = FURRDiff;
438+
PROVISIONING_PROFILE_SPECIFIER = "";
437439
SKIP_INSTALL = YES;
438440
SWIFT_COMPILATION_MODE = wholemodule;
439441
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
440-
SWIFT_VERSION = 4.0;
442+
SWIFT_VERSION = 5.0;
441443
};
442444
name = Release;
443445
};
@@ -454,7 +456,7 @@
454456
PRODUCT_BUNDLE_IDENTIFIER = com.RuotgerSkupin.DiffTests;
455457
PRODUCT_MODULE_NAME = FURRDiffTests;
456458
PRODUCT_NAME = FURRDiff;
457-
SWIFT_VERSION = 4.0;
459+
SWIFT_VERSION = 5.0;
458460
};
459461
name = Debug;
460462
};
@@ -473,7 +475,7 @@
473475
PRODUCT_NAME = FURRDiff;
474476
SWIFT_COMPILATION_MODE = wholemodule;
475477
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
476-
SWIFT_VERSION = 4.0;
478+
SWIFT_VERSION = 5.0;
477479
};
478480
name = Release;
479481
};
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>

FURRDiff.xcodeproj/xcshareddata/xcschemes/FURRDiff.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 = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)