Skip to content
Open
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
11 changes: 10 additions & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ let package = Package(
.product(
name: "Subprocess",
package: "swift-subprocess",
condition: .when(platforms: [.linux, .macOS])
condition: .when(platforms: [.linux, .macOS, .android])
),
]
),
Expand All @@ -110,7 +110,7 @@ let package = Package(
"DeveloperAPI",
"CXKit",
"XUtils",
.byName(name: "XADI", condition: .when(platforms: [.linux])),
.byName(name: "XADI", condition: .when(platforms: [.linux, .android])),
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "Dependencies", package: "swift-dependencies"),
.product(name: "SwiftyMobileDevice", package: "SwiftyMobileDevice"),
Expand All @@ -128,17 +128,17 @@ let package = Package(
.product(
name: "OpenAPIAsyncHTTPClient",
package: "swift-openapi-async-http-client",
condition: .when(platforms: [.linux])
condition: .when(platforms: [.linux, .android])
),
.product(
name: "AsyncHTTPClient",
package: "async-http-client",
condition: .when(platforms: [.linux])
condition: .when(platforms: [.linux, .android])
),
.product(
name: "WebSocketKit",
package: "websocket-kit",
condition: .when(platforms: [.linux])
condition: .when(platforms: [.linux, .android])
),
],
cSettings: cSettings
Expand Down
2 changes: 1 addition & 1 deletion Sources/XKit/HTTPClientProtocol/AsyncHTTPClient+HTTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kabir Oberai on 05/05/21.
//

#if os(Linux)
#if os(Linux) || os(Android)
import Foundation
import AsyncHTTPClient
import NIO
Expand Down
2 changes: 1 addition & 1 deletion Sources/XKit/HTTPClientProtocol/URLSession+HTTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kabir Oberai on 05/05/21.
//

#if !os(Linux)
#if !os(Linux) && !os(Android)
import Foundation
import ConcurrencyExtras
import OpenAPIRuntime
Expand Down
10 changes: 10 additions & 0 deletions Sources/XKit/Utilities/CHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@

import Foundation
import CXKit
#if os(Android)
import Android
#endif

#if os(Android)
// bionic's FILE is an incomplete type, imported as OpaquePointer
package var stdoutSafe: OpaquePointer {
get_stdout()
}
#else
package var stdoutSafe: UnsafeMutablePointer<FILE> {
get_stdout()
}
#endif

extension Data {
init?(deallocator: Deallocator = .free, acceptor: (inout Int) -> UnsafeMutableRawPointer?) {
Expand Down
5 changes: 4 additions & 1 deletion Sources/XToolSupport/XTool.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Foundation
#if os(Android)
import Android
#endif
import XKit
import ArgumentParser
import XUtils
Expand Down Expand Up @@ -74,7 +77,7 @@ extension ParsableCommand where Self: SendableMetatype {
}
}

signal(SIGINT, SIG_IGN)
_ = signal(SIGINT, SIG_IGN)
let source = DispatchSource.makeSignalSource(signal: SIGINT)
source.setEventHandler { task.cancel() }
source.resume()
Expand Down
3 changes: 3 additions & 0 deletions Sources/XUtils/System+Utils.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Foundation
#if os(Android)
import Android
#endif

#if canImport(System)
import System
Expand Down