-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPackage.swift
More file actions
52 lines (48 loc) · 1.48 KB
/
Copy pathPackage.swift
File metadata and controls
52 lines (48 loc) · 1.48 KB
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
51
52
// swift-tools-version: 6.1
import PackageDescription
let package = Package(
name: "Playwright",
platforms: [.macOS(.v15)],
products: [
.library(name: "Playwright", targets: ["Playwright"]),
.library(name: "PlaywrightTesting", targets: ["PlaywrightTesting"]),
.plugin(name: "PlaywrightDriverPlugin", targets: ["PlaywrightDriverPlugin"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.3.0"),
],
targets: [
// Library
.target(name: "Playwright", path: "./src/core", resources: [.copy("drivers")]),
.target(name: "PlaywrightTesting", dependencies: ["Playwright"], path: "./src/testing"),
// Driver Downloader
.executableTarget(
name: "DownloadDriver",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "./cli"
),
.plugin(
name: "PlaywrightDriverPlugin",
capability: .command(
intent: .custom(
verb: "install-playwright",
description: "Download the Playwright driver for browser automation"
),
permissions: [
.writeToPackageDirectory(reason: "Downloads the Playwright driver"),
.allowNetworkConnections(
scope: .all(ports: [443]),
reason: "Downloads the Playwright driver from cdn.playwright.dev"
),
]
),
dependencies: ["DownloadDriver"],
path: "./plugin"
),
// Tests
.testTarget(name: "PlaywrightTests", dependencies: ["Playwright", "PlaywrightTesting"], path: "./tests"),
],
swiftLanguageModes: [.v6]
)