Skip to content

Commit

Permalink
Merge pull request #161 from marcprux/main
Browse files Browse the repository at this point in the history
Android support
  • Loading branch information
NeedleInAJayStack authored Jan 19, 2025
2 parents 2b0db26 + 886fd72 commit 7fc8b83
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ jobs:
name: test-coverage-report
path: .test-coverage

android:
name: Test on Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test
uses: skiptools/swift-android-action@v2

backcompat-ubuntu-22_04:
name: Test Swift ${{ matrix.swift }} on Ubuntu 22.04
runs-on: ubuntu-22.04
Expand Down
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
"version" : "1.1.3"
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
"version" : "1.1.4"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "4c4453b489cf76e6b3b0f300aba663eb78182fad",
"version" : "2.70.0"
"revision" : "27c839f4700069928196cd0e9fa03b22f297078a",
"version" : "2.78.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/GraphQL/Instrumentation/Instrumentation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public extension Instrumentation {
}

func threadId() -> Int {
#if os(Linux)
#if os(Linux) || os(Android)
return Int(pthread_self())
#else
return Int(pthread_mach_thread_np(pthread_self()))
Expand Down
2 changes: 1 addition & 1 deletion Sources/GraphQL/Map/AnyCoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ private extension _AnyDecoder {
func unbox(_ value: Any, as type: Bool.Type) throws -> Bool? {
guard !(value is NSNull) else { return nil }

#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux)
#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux) || os(Android)
// Bridging differences require us to split implementations here
guard let number = __SwiftValue.store(value) as? NSNumber else {
throw DecodingError._typeMismatch(at: codingPath, expectation: type, reality: value)
Expand Down
2 changes: 1 addition & 1 deletion Sources/GraphQL/Map/MapCoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2707,7 +2707,7 @@ private extension _MapDecoder {
func unbox(_ value: Any, as type: Bool.Type) throws -> Bool? {
guard !(value is NSNull) else { return nil }

#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux)
#if DEPLOYMENT_RUNTIME_SWIFT || os(Linux) || os(Android)
// Bridging differences require us to split implementations here
guard let number = __SwiftValue.store(value) as? NSNumber else {
throw DecodingError._typeMismatch(at: codingPath, expectation: type, reality: value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class InstrumentationTests: XCTestCase, Instrumentation {
}

func testInstrumentationCalls() throws {
// #if os(Linux)
// #if os(Linux) || os(Android)
// expectedThreadId = Int(pthread_self())
// #else
// expectedThreadId = Int(pthread_mach_thread_np(pthread_self()))
Expand All @@ -172,7 +172,7 @@ class InstrumentationTests: XCTestCase, Instrumentation {

func testDispatchQueueInstrumentationWrapper() throws {
// let dispatchGroup = DispatchGroup()
// #if os(Linux)
// #if os(Linux) || os(Android)
// expectedThreadId = Int(pthread_self())
// #else
// expectedThreadId = Int(pthread_mach_thread_np(pthread_self()))
Expand Down

0 comments on commit 7fc8b83

Please sign in to comment.