Skip to content

Commit

Permalink
Update to swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
phimage committed Jun 7, 2019
1 parent 81dab7c commit 5a79be4
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2
5.0
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
language: objective-c
osx_image: xcode10
osx_image: xcode10.2
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- WORKSPACE=Erik.xcworkspace
- IOS_FRAMEWORK_SCHEME="Erik"
- MACOS_FRAMEWORK_SCHEME="ErikOSX"
- IOS_SDK=iphonesimulator12.0
- IOS_SDK=iphonesimulator12.2
- MACOS_SDK=macosx10.14
env:
- DESTINATION="OS=12.0,name=iPhone 8" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
before_install:
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --no-document --quiet
- brew update
- brew outdated carthage || brew upgrade carthage
script:
Expand Down
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "tid-kijyun/Kanna" ~> 4.0.2
github "Thomvis/BrightFutures" ~> 7.0.0
github "tid-kijyun/Kanna" ~> 5.0.0
github "Thomvis/BrightFutures" ~> 8.0.0
7 changes: 3 additions & 4 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github "Thomvis/BrightFutures" "7.0.0"
github "antitypical/Result" "4.0.0"
github "nvzqz/FileKit" "cb1a5285ca780d66264a3e70862f9845ff1cfb18"
github "tid-kijyun/Kanna" "4.0.2"
github "Thomvis/BrightFutures" "8.0.1"
github "nvzqz/FileKit" "48b5ddb287f131a5c628badc819b880453f94449"
github "tid-kijyun/Kanna" "5.0.0"
2 changes: 1 addition & 1 deletion Erik.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |s|

# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "Erik"
s.version = "4.2.0"
s.version = "5.0.0"
s.summary = "A headless browser written in Swift"
s.description = <<-DESC
Erik is an headless browser based on WebKit and HTML parser Kanna.
Expand Down
47 changes: 17 additions & 30 deletions Erik.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,18 @@
C46F2E171DACF200006A036D /* FileKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E111DACF200006A036D /* FileKit.framework */; };
C46F2E181DACF200006A036D /* Kanna.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E121DACF200006A036D /* Kanna.framework */; };
C46F2E191DACF200006A036D /* Kanna.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E121DACF200006A036D /* Kanna.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
C46F2E1A1DACF200006A036D /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E131DACF200006A036D /* Result.framework */; };
C46F2E1B1DACF200006A036D /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E131DACF200006A036D /* Result.framework */; };
C46F2E201DACF210006A036D /* BrightFutures.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E1C1DACF210006A036D /* BrightFutures.framework */; };
C46F2E211DACF210006A036D /* BrightFutures.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E1C1DACF210006A036D /* BrightFutures.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
C46F2E231DACF210006A036D /* FileKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E1D1DACF210006A036D /* FileKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
C46F2E241DACF210006A036D /* Kanna.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E1E1DACF210006A036D /* Kanna.framework */; };
C46F2E251DACF210006A036D /* Kanna.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E1E1DACF210006A036D /* Kanna.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
C46F2E261DACF210006A036D /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E1F1DACF210006A036D /* Result.framework */; };
C46F2E271DACF210006A036D /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C46F2E1F1DACF210006A036D /* Result.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
C48B18ED1E525BAB000ED799 /* Erik.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C431787F1BFA3E1A00C04250 /* Erik.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
C48B18F81E5266B4000ED799 /* BrightFutures.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E1C1DACF210006A036D /* BrightFutures.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C48B18F91E5266B4000ED799 /* FileKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E1D1DACF210006A036D /* FileKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C48B18FA1E5266B4000ED799 /* Kanna.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E1E1DACF210006A036D /* Kanna.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C48B18FB1E5266B4000ED799 /* Result.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E1F1DACF210006A036D /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C48B18FD1E5266D1000ED799 /* BrightFutures.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E101DACF200006A036D /* BrightFutures.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C48B18FE1E5266D1000ED799 /* FileKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E111DACF200006A036D /* FileKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C48B18FF1E5266D1000ED799 /* Kanna.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E121DACF200006A036D /* Kanna.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C48B19001E5266D1000ED799 /* Result.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C46F2E131DACF200006A036D /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C4AAB7241E52C3E100348D04 /* KannaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4AAB7231E52C3E100348D04 /* KannaTests.swift */; };
C4AAB7261E52C40000348D04 /* google.html in Resources */ = {isa = PBXBuildFile; fileRef = C4AAB7251E52C40000348D04 /* google.html */; };
C4AAB7271E52C40000348D04 /* google.html in Resources */ = {isa = PBXBuildFile; fileRef = C4AAB7251E52C40000348D04 /* google.html */; };
Expand Down Expand Up @@ -76,7 +70,6 @@
C48B18F81E5266B4000ED799 /* BrightFutures.framework in CopyFiles */,
C48B18F91E5266B4000ED799 /* FileKit.framework in CopyFiles */,
C48B18FA1E5266B4000ED799 /* Kanna.framework in CopyFiles */,
C48B18FB1E5266B4000ED799 /* Result.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -89,7 +82,6 @@
C48B18FD1E5266D1000ED799 /* BrightFutures.framework in CopyFiles */,
C48B18FE1E5266D1000ED799 /* FileKit.framework in CopyFiles */,
C48B18FF1E5266D1000ED799 /* Kanna.framework in CopyFiles */,
C48B19001E5266D1000ED799 /* Result.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -108,11 +100,9 @@
C46F2E101DACF200006A036D /* BrightFutures.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BrightFutures.framework; path = Carthage/Build/iOS/BrightFutures.framework; sourceTree = "<group>"; };
C46F2E111DACF200006A036D /* FileKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FileKit.framework; path = Carthage/Build/iOS/FileKit.framework; sourceTree = "<group>"; };
C46F2E121DACF200006A036D /* Kanna.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kanna.framework; path = Carthage/Build/iOS/Kanna.framework; sourceTree = "<group>"; };
C46F2E131DACF200006A036D /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/iOS/Result.framework; sourceTree = "<group>"; };
C46F2E1C1DACF210006A036D /* BrightFutures.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BrightFutures.framework; path = Carthage/Build/Mac/BrightFutures.framework; sourceTree = "<group>"; };
C46F2E1D1DACF210006A036D /* FileKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FileKit.framework; path = Carthage/Build/Mac/FileKit.framework; sourceTree = "<group>"; };
C46F2E1E1DACF210006A036D /* Kanna.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kanna.framework; path = Carthage/Build/Mac/Kanna.framework; sourceTree = "<group>"; };
C46F2E1F1DACF210006A036D /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/Mac/Result.framework; sourceTree = "<group>"; };
C4AAB7231E52C3E100348D04 /* KannaTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KannaTests.swift; sourceTree = "<group>"; };
C4AAB7251E52C40000348D04 /* google.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = google.html; sourceTree = SOURCE_ROOT; };
C4D50DDC1BFB51130053B624 /* Erik.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Erik.swift; sourceTree = "<group>"; };
Expand All @@ -131,7 +121,6 @@
files = (
C46F2E141DACF200006A036D /* BrightFutures.framework in Frameworks */,
C46F2E181DACF200006A036D /* Kanna.framework in Frameworks */,
C46F2E1A1DACF200006A036D /* Result.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -140,7 +129,6 @@
buildActionMask = 2147483647;
files = (
C46F2E191DACF200006A036D /* Kanna.framework in Frameworks */,
C46F2E1B1DACF200006A036D /* Result.framework in Frameworks */,
C46F2E151DACF200006A036D /* BrightFutures.framework in Frameworks */,
C46F2E171DACF200006A036D /* FileKit.framework in Frameworks */,
C42828E21BF9EDE1005EC7C3 /* Erik.framework in Frameworks */,
Expand All @@ -153,7 +141,6 @@
files = (
C46F2E201DACF210006A036D /* BrightFutures.framework in Frameworks */,
C46F2E241DACF210006A036D /* Kanna.framework in Frameworks */,
C46F2E261DACF210006A036D /* Result.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -163,7 +150,6 @@
files = (
C48B18ED1E525BAB000ED799 /* Erik.framework in Frameworks */,
C46F2E251DACF210006A036D /* Kanna.framework in Frameworks */,
C46F2E271DACF210006A036D /* Result.framework in Frameworks */,
C46F2E211DACF210006A036D /* BrightFutures.framework in Frameworks */,
C46F2E231DACF210006A036D /* FileKit.framework in Frameworks */,
);
Expand Down Expand Up @@ -251,7 +237,6 @@
C46F2E101DACF200006A036D /* BrightFutures.framework */,
C46F2E111DACF200006A036D /* FileKit.framework */,
C46F2E121DACF200006A036D /* Kanna.framework */,
C46F2E131DACF200006A036D /* Result.framework */,
);
name = iOS;
sourceTree = "<group>";
Expand All @@ -262,7 +247,6 @@
C46F2E1C1DACF210006A036D /* BrightFutures.framework */,
C46F2E1D1DACF210006A036D /* FileKit.framework */,
C46F2E1E1DACF210006A036D /* Kanna.framework */,
C46F2E1F1DACF210006A036D /* Result.framework */,
);
name = Mac;
sourceTree = "<group>";
Expand Down Expand Up @@ -395,18 +379,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = phimage;
TargetAttributes = {
C42828D61BF9EDE1005EC7C3 = {
CreatedOnToolsVersion = 7.1;
DevelopmentTeam = GGU39CDBL2;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
C42828E01BF9EDE1005EC7C3 = {
CreatedOnToolsVersion = 7.1;
DevelopmentTeam = GGU39CDBL2;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
C431787E1BFA3E1A00C04250 = {
CreatedOnToolsVersion = 7.1;
Expand All @@ -418,10 +402,11 @@
};
buildConfigurationList = C42828D11BF9EDE1005EC7C3 /* Build configuration list for PBXProject "Erik" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = C42828CD1BF9EDE1005EC7C3;
productRefGroup = C42828D81BF9EDE1005EC7C3 /* Products */;
Expand Down Expand Up @@ -530,6 +515,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -580,7 +566,7 @@
SDKROOT = macosx;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Carthage/Checkouts/Kanna/Modules";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -591,6 +577,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -634,7 +621,7 @@
SDKROOT = macosx;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Carthage/Checkouts/Kanna/Modules";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -666,7 +653,7 @@
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -692,7 +679,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -712,7 +699,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Carthage/Checkouts/Kanna/Modules";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -732,7 +719,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Carthage/Checkouts/Kanna/Modules";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -759,7 +746,7 @@
PRODUCT_NAME = Erik;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -785,7 +772,7 @@
PRODUCT_NAME = Erik;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -807,7 +794,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Carthage/Checkouts/Kanna/Modules";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -829,7 +816,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Carthage/Checkouts/Kanna/Modules";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Erik.xcodeproj/xcshareddata/xcschemes/Erik.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Erik.xcodeproj/xcshareddata/xcschemes/ErikOSX.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 0 additions & 1 deletion ErikTests/ErikTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import XCTest
@testable import Erik
import FileKit
import BrightFutures
import Result

let url = URL(string:"https://www.google.com")!
let PageLoadedPolicy: WebKitLayoutEngine.PageLoadedPolicy = .navigationDelegate
Expand Down
6 changes: 3 additions & 3 deletions Sources/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ open class Element: Node {

public extension Array where Element: Node {

public var toHTML: String? {
var toHTML: String? {
let html = reduce("") {
if let text = $1.toHTML {
return $0 + text
Expand All @@ -333,7 +333,7 @@ public extension Array where Element: Node {
return html.isEmpty == false ? html : nil
}

public var innerHTML: String? {
var innerHTML: String? {
let html = reduce("") {
if let text = $1.innerHTML {
return $0 + text
Expand All @@ -343,7 +343,7 @@ public extension Array where Element: Node {
return html.isEmpty == false ? html : nil
}

public var text: String? {
var text: String? {
let html = reduce("") {
if let text = $1.text {
return $0 + text
Expand Down
5 changes: 0 additions & 5 deletions Sources/Erik.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ extension Erik {
public static func load(urlRequest: Foundation.URLRequest, completionHandler: DocumentCompletionHandler?) {
Erik.sharedInstance.load(urlRequest: urlRequest, completionHandler: completionHandler)
}

@available(*, deprecated: 1.1, obsoleted: 1.2, message: "Use url")
public static var currentURL: URL? {
return Erik.sharedInstance.url
}

public static var url: URL? {
return Erik.sharedInstance.url
Expand Down
1 change: 0 additions & 1 deletion Sources/Future/Future.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ SOFTWARE.

import Foundation
import BrightFutures
import Result

extension Erik {

Expand Down

0 comments on commit 5a79be4

Please sign in to comment.