Skip to content

Commit 70ffd23

Browse files
committed
spm: add initial support for SPM together with headers.sh to generate symlinks
Signed-off-by: Muvaffak Onus <me@muvaf.com>
1 parent b79eff8 commit 70ffd23

44 files changed

Lines changed: 188 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Package.swift

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// swift-tools-version: 5.9
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "WebDriverAgent",
6+
defaultLocalization: "en",
7+
platforms: [
8+
.iOS(.v12)
9+
],
10+
products: [
11+
// Expose the Obj-C library as a SwiftPM product so it can be imported from Swift.
12+
.library(name: "WebDriverAgentLib", targets: ["WebDriverAgentLib"])
13+
],
14+
targets: [
15+
// ---- Vendor: CocoaAsyncSocket ----
16+
.target(
17+
name: "CocoaAsyncSocket",
18+
path: "WebDriverAgentLib/Vendor/CocoaAsyncSocket",
19+
publicHeadersPath: "."
20+
),
21+
22+
// ---- Vendor: CocoaHTTPServer ----
23+
.target(
24+
name: "CocoaHTTPServer",
25+
dependencies: ["CocoaAsyncSocket"],
26+
path: "WebDriverAgentLib/Vendor/CocoaHTTPServer",
27+
publicHeadersPath: ".",
28+
cSettings: [
29+
.headerSearchPath("Categories"),
30+
.headerSearchPath("Responses")
31+
]
32+
),
33+
34+
// ---- Vendor: RoutingHTTPServer ----
35+
.target(
36+
name: "RoutingHTTPServer",
37+
dependencies: ["CocoaHTTPServer"],
38+
path: "WebDriverAgentLib/Vendor/RoutingHTTPServer",
39+
publicHeadersPath: ".",
40+
cSettings: [
41+
// Need CocoaHTTPServer headers in include path for quote-style imports
42+
.headerSearchPath("../CocoaHTTPServer"),
43+
.headerSearchPath("../CocoaHTTPServer/Responses"),
44+
.headerSearchPath("../CocoaHTTPServer/Categories")
45+
]
46+
),
47+
48+
// ---- Main library ----
49+
.target(
50+
name: "WebDriverAgentLib",
51+
dependencies: [
52+
"RoutingHTTPServer"
53+
],
54+
path: "WebDriverAgentLib",
55+
exclude: [
56+
"Vendor" // compiled in dedicated targets above
57+
],
58+
publicHeadersPath: "include",
59+
cSettings: [
60+
.headerSearchPath(".."),
61+
.headerSearchPath("include"),
62+
.headerSearchPath("Routing"),
63+
.headerSearchPath("Utilities"),
64+
.headerSearchPath("Utilities/LRUCache"),
65+
.headerSearchPath("Categories"),
66+
.headerSearchPath("Commands"),
67+
.headerSearchPath("include/WebDriverAgentLib"),
68+
.headerSearchPath("../PrivateHeaders/XCTest"),
69+
.headerSearchPath("../PrivateHeaders/MobileCoreServices"),
70+
.headerSearchPath("../PrivateHeaders/AccessibilityUtilities"),
71+
.headerSearchPath("../PrivateHeaders/TextInput"),
72+
.headerSearchPath("../PrivateHeaders/UIKitCore"),
73+
],
74+
linkerSettings: [
75+
// Link against XCTest and system UIKit/Foundation frameworks that
76+
// are referenced across the Objective-C implementation files.
77+
.linkedFramework("XCTest"),
78+
.linkedFramework("UIKit"),
79+
.linkedFramework("Foundation"),
80+
.linkedFramework("MobileCoreServices"),
81+
.linkedFramework("UniformTypeIdentifiers")
82+
]
83+
),
84+
// Unit-test target (optional – keeps parity with the original project).
85+
.testTarget(
86+
name: "WebDriverAgentLibTests",
87+
dependencies: ["WebDriverAgentLib"],
88+
path: "WebDriverAgentTests"
89+
)
90+
]
91+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../PrivateHeaders/XCTest/CDStructures.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../FBAlert.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Routing/FBCommandHandler.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Routing/FBCommandStatus.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Utilities/FBConfiguration.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Utilities/FBDebugLogDelegateDecorator.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Routing/FBElement.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Routing/FBElementCache.h
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Utilities/FBElementTypeTransformer.h

0 commit comments

Comments
 (0)