Skip to content

Android support #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 19, 2025
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: 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
Loading