From 27a2aa25a784c4209f8cf1ce1d8375d5e67fb4fb Mon Sep 17 00:00:00 2001 From: Michael Nisi Date: Mon, 24 Sep 2018 09:49:18 +0200 Subject: [PATCH] Use Xcode 10 --- .gitignore | 1 + .travis.yml | 2 +- HTMLAttributor.xcodeproj/project.pbxproj | 17 +++++++----- .../xcschemes/HTMLAttributor.xcscheme | 4 +-- HTMLAttributor/HTMLAttributor.swift | 26 +++++++++---------- HTMLAttributor/Info.plist | 2 +- HTMLAttributorTests/Info.plist | 2 +- 7 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index c51c7bd..899c862 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ *.perspectivev3 *.xccheckout *.xcuserstate +*.xcworkspace DerivedData build/ xcuserdata diff --git a/.travis.yml b/.travis.yml index e56b747..68e8867 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ sudo: false language: objective-c -osx_image: xcode9 +osx_image: xcode10 script: "travis_retry make test" after_success: - bash <(curl -s https://codecov.io/bash) -J 'HTMLAttributor' diff --git a/HTMLAttributor.xcodeproj/project.pbxproj b/HTMLAttributor.xcodeproj/project.pbxproj index d4d6cd6..53cd609 100644 --- a/HTMLAttributor.xcodeproj/project.pbxproj +++ b/HTMLAttributor.xcodeproj/project.pbxproj @@ -146,16 +146,17 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "Michael Nisi"; TargetAttributes = { 4EEB54851F73760900D685EE = { CreatedOnToolsVersion = 9.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; 4EEB548E1F73760900D685EE = { CreatedOnToolsVersion = 9.0; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; }; @@ -237,6 +238,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -244,6 +246,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -297,6 +300,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -304,6 +308,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -353,7 +358,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -374,7 +379,7 @@ PRODUCT_BUNDLE_IDENTIFIER = ink.codes.HTMLAttributor; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -388,7 +393,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = ink.codes.HTMLAttributorTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -402,7 +407,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = ink.codes.HTMLAttributorTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/HTMLAttributor.xcodeproj/xcshareddata/xcschemes/HTMLAttributor.xcscheme b/HTMLAttributor.xcodeproj/xcshareddata/xcschemes/HTMLAttributor.xcscheme index 7556411..f0a3a74 100644 --- a/HTMLAttributor.xcodeproj/xcshareddata/xcschemes/HTMLAttributor.xcscheme +++ b/HTMLAttributor.xcodeproj/xcshareddata/xcschemes/HTMLAttributor.xcscheme @@ -1,6 +1,6 @@ NSAttributedString } @@ -395,21 +395,21 @@ public final class HTMLAttributor { return (result, ranges) } - public static let defaultStyles: [String: [NSAttributedStringKey : Any]] = [ + public static let defaultStyles: [String: [NSAttributedString.Key : Any]] = [ "root": [ - NSAttributedStringKey.font: UIFont.preferredFont( - forTextStyle: UIFontTextStyle.body), - NSAttributedStringKey.foregroundColor: UIColor.darkText + NSAttributedString.Key.font: UIFont.preferredFont( + forTextStyle: UIFont.TextStyle.body), + NSAttributedString.Key.foregroundColor: UIColor.darkText ], "h1": [ - NSAttributedStringKey.font: UIFont.preferredFont( - forTextStyle: UIFontTextStyle.headline), - NSAttributedStringKey.foregroundColor: UIColor.darkText + NSAttributedString.Key.font: UIFont.preferredFont( + forTextStyle: UIFont.TextStyle.headline), + NSAttributedString.Key.foregroundColor: UIColor.darkText ], "a": [ - NSAttributedStringKey.font: UIFont.preferredFont( - forTextStyle: UIFontTextStyle.body), - NSAttributedStringKey.foregroundColor: UIColor.blue + NSAttributedString.Key.font: UIFont.preferredFont( + forTextStyle: UIFont.TextStyle.body), + NSAttributedString.Key.foregroundColor: UIColor.blue ] ] @@ -446,7 +446,7 @@ extension HTMLAttributor: NodeTreeTransforming { public func attributedString( _ tree: Node, - styles: [String: [NSAttributedStringKey : Any]] = HTMLAttributor.defaultStyles + styles: [String: [NSAttributedString.Key : Any]] = HTMLAttributor.defaultStyles ) throws -> NSAttributedString { let (str, trs) = try taggedString(tree) @@ -465,7 +465,7 @@ extension HTMLAttributor: NodeTreeTransforming { if tag == "a" { if let href = tr.attributes?["href"] { if let url = URL(string: href) { - attrs[NSAttributedStringKey.link] = url as AnyObject? + attrs[NSAttributedString.Key.link] = url as AnyObject? } } } diff --git a/HTMLAttributor/Info.plist b/HTMLAttributor/Info.plist index 0e8b818..f936f8d 100644 --- a/HTMLAttributor/Info.plist +++ b/HTMLAttributor/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.2 + 2.0.3 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/HTMLAttributorTests/Info.plist b/HTMLAttributorTests/Info.plist index 83957c2..12db38e 100644 --- a/HTMLAttributorTests/Info.plist +++ b/HTMLAttributorTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 2.0.2 + 2.0.3 CFBundleVersion 1