From f75f582843cd08358678a529cf2014e4004c5795 Mon Sep 17 00:00:00 2001 From: Zhuhao Wang Date: Tue, 20 Sep 2016 21:48:52 +0800 Subject: [PATCH] Update to swift 2.3 Also set test env to Xcode 8. --- .travis.yml | 11 ++++++----- tun2socks.xcodeproj/project.pbxproj | 12 ++++++++++++ tun2socks/TSIPStack.swift | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd5375b..d5b383a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ language: objective-c -osx_image: xcode7.3 +osx_image: xcode8 + +install: + - gem install gym script: -- xctool -project tun2socks.xcodeproj -scheme "tun2socks-macOS" -sdk macosx10.11 -arch - x86_64 build -- xctool -project tun2socks.xcodeproj -scheme "tun2socks-iOS" -sdk iphoneos9.3 -arch - arm64 build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO +- xcodebuild -project tun2socks.xcodeproj -scheme "tun2socks-macOS" | xcpretty +- xcodebuild -project tun2socks.xcodeproj -scheme "tun2socks-iOS" | xcpretty after_success: - "./docs/build_docs.sh" diff --git a/tun2socks.xcodeproj/project.pbxproj b/tun2socks.xcodeproj/project.pbxproj index 803cd22..75e4820 100644 --- a/tun2socks.xcodeproj/project.pbxproj +++ b/tun2socks.xcodeproj/project.pbxproj @@ -872,15 +872,19 @@ TargetAttributes = { 3642C9FD1CEDCC60001E0AAF = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0800; }; 36A718F01D5B0A1B00DC35F5 = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0800; }; 36A718FE1D5B0AC100DC35F5 = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0800; }; 36C48CA11CF8701A0071804F = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0800; }; }; }; @@ -1130,6 +1134,7 @@ PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.tun2socks; PRODUCT_NAME = "$(PROJECT_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -1149,6 +1154,7 @@ PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.tun2socks; PRODUCT_NAME = "$(PROJECT_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -1168,6 +1174,7 @@ PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.lwip; PRODUCT_NAME = lwip; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/lwip"; }; name = Debug; @@ -1188,6 +1195,7 @@ PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.lwip; PRODUCT_NAME = lwip; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/lwip"; }; name = Release; @@ -1209,6 +1217,7 @@ PRODUCT_NAME = lwip; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/lwip/"; }; @@ -1231,6 +1240,7 @@ PRODUCT_NAME = lwip; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/lwip/"; VALIDATE_PRODUCT = YES; @@ -1255,6 +1265,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1277,6 +1288,7 @@ PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; diff --git a/tun2socks/TSIPStack.swift b/tun2socks/TSIPStack.swift index 0d4b21b..2d90943 100644 --- a/tun2socks/TSIPStack.swift +++ b/tun2socks/TSIPStack.swift @@ -35,7 +35,7 @@ public final class TSIPStack { public static var stack = TSIPStack() // The whole stack is running in this dispatch queue. - let processQueue = dispatch_queue_create("tun2socks.IPStackQueue", DISPATCH_QUEUE_SERIAL)! + let processQueue = dispatch_queue_create("tun2socks.IPStackQueue", DISPATCH_QUEUE_SERIAL) var timer: dispatch_source_t? let listenPCB: UnsafeMutablePointer