-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathPackage.swift
50 lines (47 loc) · 1.74 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// swift-tools-version: 5.8
import PackageDescription
let package = Package(
name: "swift-webdriver",
products: [
.library(name: "WebDriver", targets: ["WebDriver"]),
] + ifWindows([
.library(name: "WinAppDriver", targets: ["WinAppDriver"]),
]),
targets: [
.target(
name: "WebDriver",
path: "Sources/WebDriver",
exclude: ["CMakeLists.txt"]),
.target(
name: "TestsCommon",
path: "Tests/Common"),
.testTarget(
name: "UnitTests",
dependencies: ["TestsCommon", "WebDriver"],
// Ignore "LNK4217: locally defined symbol imported" spew due to SPM library support limitations
linkerSettings: [ .unsafeFlags(["-Xlinker", "-ignore:4217"], .when(platforms: [.windows])) ]),
.testTarget(
name: "AppiumTests",
dependencies: ["TestsCommon", "WebDriver"],
// Ignore "LNK4217: locally defined symbol imported" spew due to SPM library support limitations
linkerSettings: ifWindows([ .unsafeFlags(["-Xlinker", "-ignore:4217"]) ])),
] + ifWindows([
.target(
name: "WinAppDriver",
dependencies: ["WebDriver"],
path: "Sources/WinAppDriver",
exclude: ["CMakeLists.txt"]),
.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"]) ]),
])
)
func ifWindows<T>(_ values: [T]) -> [T] {
#if os(Windows)
return values
#else
return []
#endif
}