From 43ed34352e8c645df4bbf378501afbeb7e994ba4 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 25 Sep 2019 13:38:30 +0100 Subject: [PATCH 1/5] Add Xcode 11, Swift 5.1 to azure-pipelines.yml --- azure-pipelines.yml | 18 ++++++++++++++++-- test_xcodebuild.sh | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1b090d11..455809a5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,6 +36,14 @@ jobs: env: IOS_DEVICE: 'platform=iOS Simulator,OS=12.2,name=iPhone SE' TVOS_DEVICE: 'platform=tvOS Simulator,OS=12.2,name=Apple TV 4K' +- job: test_xcodebuild_11_0 + pool: + vmImage: 'macos-latest' + steps: + - bash: ./test_xcodebuild.sh Xcode_11 + env: + IOS_DEVICE: 'platform=iOS Simulator,OS=13.0,name=iPhone SE' + TVOS_DEVICE: 'platform=tvOS Simulator,OS=13.0,name=Apple TV 4K' CODECOV_JOB: 'true' CODECOV_TOKEN: $(codecovToken) - job: test_swiftpm @@ -43,9 +51,15 @@ jobs: vmImage: 'macos-latest' steps: - script: ./test_swiftpm.sh -- job: test_linux +- job: test_linux_5_0 + pool: + vmImage: 'Ubuntu 16.04' + container: norionomura/swift:503 + steps: + - script: ./test_linux.sh +- job: test_linux_5_1 pool: vmImage: 'Ubuntu 16.04' - container: norionomura/swift:501 + container: norionomura/swift:51 steps: - script: ./test_linux.sh diff --git a/test_xcodebuild.sh b/test_xcodebuild.sh index cef0b066..88c49d51 100755 --- a/test_xcodebuild.sh +++ b/test_xcodebuild.sh @@ -3,6 +3,8 @@ set -e set -o pipefail +ls /Applications/Xcode* + sudo xcode-select --switch /Applications/$1.app/Contents/Developer xcodebuild -version From 9a6699c0a534226d94bb005d4da65db4f7e6954a Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 25 Sep 2019 13:46:26 +0100 Subject: [PATCH 2/5] Add FoundationXML import to XMLStackParser --- Sources/XMLCoder/Auxiliaries/XMLStackParser.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift index 07ec9b51..57595d22 100644 --- a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift +++ b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift @@ -7,6 +7,9 @@ // import Foundation +#if canImport(FoundationXML) +import FoundationXML +#endif class XMLStackParser: NSObject { var root: XMLCoderElement? From 33dd47dc0bd8ca0e58f597ca02ed58c003ffe8b9 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 25 Sep 2019 13:48:50 +0100 Subject: [PATCH 3/5] Clean up xcodebuild.sh, use iPhone 8 for iOS 13 --- azure-pipelines.yml | 2 +- test_xcodebuild.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 455809a5..a5aaae93 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,7 +42,7 @@ jobs: steps: - bash: ./test_xcodebuild.sh Xcode_11 env: - IOS_DEVICE: 'platform=iOS Simulator,OS=13.0,name=iPhone SE' + IOS_DEVICE: 'platform=iOS Simulator,OS=13.0,name=iPhone 8' TVOS_DEVICE: 'platform=tvOS Simulator,OS=13.0,name=Apple TV 4K' CODECOV_JOB: 'true' CODECOV_TOKEN: $(codecovToken) diff --git a/test_xcodebuild.sh b/test_xcodebuild.sh index 88c49d51..cef0b066 100755 --- a/test_xcodebuild.sh +++ b/test_xcodebuild.sh @@ -3,8 +3,6 @@ set -e set -o pipefail -ls /Applications/Xcode* - sudo xcode-select --switch /Applications/$1.app/Contents/Developer xcodebuild -version From 21b1c67bd7fa651bd742e2f1d1b32369d0a7c524 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 25 Sep 2019 13:57:46 +0100 Subject: [PATCH 4/5] Check for the Linux compiler version --- Sources/XMLCoder/Auxiliaries/XMLStackParser.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift index 57595d22..8d7ea1a1 100644 --- a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift +++ b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift @@ -129,7 +129,7 @@ extension XMLStackParser: XMLParserDelegate { namespaceURI: String?, qualifiedName: String?, attributes attributeDict: [String: String] = [:]) { - #if os(Linux) + #if os(Linux) && compiler(<5.1) // For some reason, element names on linux are coming out with the namespace after the name // https://bugs.swift.org/browse/SR-11191 let elementName = elementName.components(separatedBy: ":").reversed().joined(separator: ":") From 688d49092f182afc28ff239b3f87911f2b526abc Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 25 Sep 2019 14:00:18 +0100 Subject: [PATCH 5/5] Fix old compiler versions not handling comparisons --- Sources/XMLCoder/Auxiliaries/XMLStackParser.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift index 8d7ea1a1..8890b8c6 100644 --- a/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift +++ b/Sources/XMLCoder/Auxiliaries/XMLStackParser.swift @@ -129,7 +129,7 @@ extension XMLStackParser: XMLParserDelegate { namespaceURI: String?, qualifiedName: String?, attributes attributeDict: [String: String] = [:]) { - #if os(Linux) && compiler(<5.1) + #if os(Linux) && !compiler(>=5.1) // For some reason, element names on linux are coming out with the namespace after the name // https://bugs.swift.org/browse/SR-11191 let elementName = elementName.components(separatedBy: ":").reversed().joined(separator: ":")