Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aliases:
- store_test_results:
path: build/reports/
- run: xcodebuild -workspace SourceKitten.xcworkspace -scheme sourcekitten $XCODE_FLAGS_FOR_TEST test-without-building
- run: echo "ruby-2.3" > ~/.ruby-version
- run: echo "ruby-2.4" > ~/.ruby-version
- restore_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
- run: bundle check --path vendor/bundle || bundle install --path vendor/bundle
Expand Down Expand Up @@ -36,12 +36,12 @@ jobs:
environment:
XCODE_FLAGS_FOR_TEST: -parallel-testing-enabled NO
macos:
xcode: "10.0.0"
xcode: "10.1.0"
<<: *configurations-for-xcode

swiftpm_4.2:
macos:
xcode: "10.0.0"
xcode: "10.1.0"
steps: *steps-for-swiftpm

xcode_9.4:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
# linux jobs
linux_swift_4.2:
docker:
- image: norionomura/swift:4220180730a
- image: norionomura/swift:42
steps: *steps-for-linux

linux_swift_4.1.3:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use the `clean` action on `xcodebuild`.
[Norio Nomura](https://github.com/norio-nomura)

* Use 'as' bridging on Linux when using Swift 4.2.
[JP Simard](https://github.com/jpsim)

##### Bug Fixes

* None.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ archive:
release: package archive

docker_test:
docker run -v `pwd`:`pwd` -w `pwd` --rm norionomura/swift:40 swift test
docker run -v `pwd`:`pwd` -w `pwd` --name sourcekitten --rm norionomura/swift:42 swift test --parallel

docker_htop:
docker run -it --rm --pid=container:sourcekitten terencewestphal/htop || reset

# http://irace.me/swift-profiling/
display_compilation_time:
Expand Down
30 changes: 15 additions & 15 deletions Source/SourceKittenFramework/LinuxCompatibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,50 @@ import Foundation

extension Array {
public func bridge() -> NSArray {
#if os(Linux)
return NSArray(array: self)
#else
#if _runtime(_ObjC) || swift(>=4.1.50)
return self as NSArray
#else
return NSArray(array: self)
#endif
}
}

extension CharacterSet {
public func bridge() -> NSCharacterSet {
#if os(Linux)
return _bridgeToObjectiveC()
#else
#if _runtime(_ObjC) || swift(>=4.1.50)
return self as NSCharacterSet
#else
return _bridgeToObjectiveC()
#endif
}
}

extension Dictionary {
public func bridge() -> NSDictionary {
#if os(Linux)
return NSDictionary(dictionary: self)
#else
#if _runtime(_ObjC) || swift(>=4.1.50)
return self as NSDictionary
#else
return NSDictionary(dictionary: self)
#endif
}
}

extension NSString {
public func bridge() -> String {
#if os(Linux)
return _bridgeToSwift()
#else
#if _runtime(_ObjC) || swift(>=4.1.50)
return self as String
#else
return _bridgeToSwift()
#endif
}
}

extension String {
public func bridge() -> NSString {
#if os(Linux)
return NSString(string: self)
#else
#if _runtime(_ObjC) || swift(>=4.1.50)
return self as NSString
#else
return NSString(string: self)
#endif
}
}
4 changes: 0 additions & 4 deletions Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
"associatedUSRs" : "s:s17FixedWidthIntegerPsE12unsafeAddingyxxF",
"context" : "source.codecompletion.context.superclass",
"descriptionKey" : "unsafeAdding(other: Int)",
"docBrief" : "Returns the sum of this value and the given value without checking for arithmetic overflow.",
"kind" : "source.lang.swift.decl.function.method.instance",
"moduleName" : "Swift",
"name" : "unsafeAdding(:)",
Expand All @@ -331,7 +330,6 @@
"associatedUSRs" : "s:s17FixedWidthIntegerPsE13unsafeDivided2byxx_tF",
"context" : "source.codecompletion.context.superclass",
"descriptionKey" : "unsafeDivided(by: Int)",
"docBrief" : "Returns the quotient obtained by dividing this value by the given value without checking for arithmetic overflow.",
"kind" : "source.lang.swift.decl.function.method.instance",
"moduleName" : "Swift",
"name" : "unsafeDivided(by:)",
Expand All @@ -342,7 +340,6 @@
"associatedUSRs" : "s:s17FixedWidthIntegerPsE16unsafeMultiplied2byxx_tF",
"context" : "source.codecompletion.context.superclass",
"descriptionKey" : "unsafeMultiplied(by: Int)",
"docBrief" : "Returns the product of this value and the given value without checking for arithmetic overflow.",
"kind" : "source.lang.swift.decl.function.method.instance",
"moduleName" : "Swift",
"name" : "unsafeMultiplied(by:)",
Expand All @@ -353,7 +350,6 @@
"associatedUSRs" : "s:s17FixedWidthIntegerPsE17unsafeSubtractingyxxF",
"context" : "source.codecompletion.context.superclass",
"descriptionKey" : "unsafeSubtracting(other: Int)",
"docBrief" : "Returns the difference obtained by subtracting the given value from this value without checking for arithmetic overflow.",
"kind" : "source.lang.swift.decl.function.method.instance",
"moduleName" : "Swift",
"name" : "unsafeSubtracting(:)",
Expand Down