Skip to content
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

Refactor for xplat building. #140

Merged
merged 1 commit into from
Feb 6, 2024
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
33 changes: 21 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,37 @@ import PackageDescription
let package = Package(
name: "swift-webdriver",
products: [
.library(name: "WebDriver", targets: ["WebDriver", "WinAppDriver"]),
.library(name: "WebDriver", targets: ["WebDriver"]),
],
targets: [
.target(
name: "WebDriver",
path: "Sources/WebDriver"),
.target(
name: "WinAppDriver",
dependencies: ["WebDriver"],
path: "Sources/WinAppDriver"),
.target(
name: "TestsCommon",
path: "Tests/Common"),
.testTarget(
name: "WinAppDriverTests",
dependencies: ["TestsCommon", "WebDriver", "WinAppDriver"],
// Ignore "LNK4217: locally defined symbol imported" spew due to SPM library support limitations
linkerSettings: [ .unsafeFlags(["-Xlinker", "-ignore:4217"]) ]),
.testTarget(
name: "UnitTests",
dependencies: ["TestsCommon", "WebDriver", "WinAppDriver"],
dependencies: ["TestsCommon", "WebDriver"],
// Ignore "LNK4217: locally defined symbol imported" spew due to SPM library support limitations
linkerSettings: [ .unsafeFlags(["-Xlinker", "-ignore:4217"]) ]),
linkerSettings: [ .unsafeFlags(["-Xlinker", "-ignore:4217"], .when(platforms: [.windows])) ]),
]
)

#if os(Windows)
jeffdav marked this conversation as resolved.
Show resolved Hide resolved
package.products += [
.library(name: "WinAppDriver", targets: ["WinAppDriver"])
]
package.targets += [
.target(
name: "WinAppDriver",
dependencies: ["WebDriver"],
path: "Sources/WinAppDriver"),
.testTarget(
name: "WinAppDriverTests",
dependencies: ["TestsCommon", "WebDriver", "WinAppDriver"],
// Ignore "LNK4217: locally defined symbol imported" spew due to SPM library support limitations
linkerSettings: [ .unsafeFlags(["-Xlinker", "-ignore:4217"]) ]),
]
#endif

2 changes: 2 additions & 0 deletions Sources/WebDriver/HTTPWebDriver.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

public struct HTTPWebDriver: WebDriver {
let rootURL: URL
Expand Down
2 changes: 2 additions & 0 deletions Sources/WebDriver/URLRequestExtensions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

extension URLSession {
func dataTask(
Expand Down
Loading