Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
601 lines (569 loc) · 26.5 KB
/
Copy pathPackage.swift
File metadata and controls
601 lines (569 loc) · 26.5 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
// swift-tools-version: 6.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
// Tools-version 6.3: the C functions use the @c attribute (Swift 6.3, Xcode 26.4), and the Swift 6
// language mode is the default for every target in this package.
//
// ActionUI SPM Package
// Source distribution for https://github.com/abra-code/ActionUI
//
// Products:
// • ActionUI – Core library (Swift)
// • ActionUISwiftAdapter – Swift-friendly static wrapper over ActionUI
// • ActionUICAdapter – C adapter (header + Swift glue)
// • ActionUIObjCAdapter – Objective-C adapter
// • ActionUIJavaScriptCoreAdapter – JavaScriptCore adapter
// • ActionUIWebKitJSAdapter – WebKit / WKWebView JS bridge adapter
// • ActionUIRemote – Out-of-process binding: Unix socket + JSON-RPC 2.0 server (macOS; on Linux in libActionUI.so)
// • ActionUIDocumentation – Resource-only bundle (schemas, templates, index)
// • ActionUIVerifier – Document verifier against the element schemas, Foundation only (FoundationEssentials on Linux, no GTK)
//
// The ActionUIViewer preview tool moved to its own aggregator package at Apps/ActionUIViewer so it
// can link the optional add-ons and register their element types (a core target cannot depend on the
// add-ons, which depend on core - that would be circular).
//
// Excluded adapters:
// • ActionUICppAdapter – not included in this distribution
import Foundation
import PackageDescription
// Three packages, one chosen at the end. applePackage() is the full package for Apple platforms,
// linuxPackage() the one for Linux: the same module ActionUI, made of the portable code in
// ActionUI/Core, the toolkit-free renderer code in ActionUIRendererShared (layout solvers and
// helpers any non-Apple renderer can use) and the GTK renderer in ActionUIAdwaita.
// coreCheckPackage() builds only the portable code (ActionUI/Core and ActionUIRendererShared), as
// the module ActionUI; set ACTIONUI_CORE_ONLY=1 to select it on either host, which
// Scripts/check-core.sh does on a Mac to cross-build it for Linux.
let coreOnly = Context.environment["ACTIONUI_CORE_ONLY"] == "1"
// Every path in a target's folder (`target`, relative to the repository; "" for the root) that is
// neither one of `kept` nor a folder on the way to one, for the target's `exclude`: that leaves
// the target holding only the kept folders. Paths are relative to the target's folder, as
// `exclude` and `sources` are. Without it SwiftPM scans the whole folder of a target with
// `sources`: for path "." it takes every app's asset catalog as one of its resources, and in a
// test folder it warns about every other test file. SwiftPM caches a manifest's result by its
// text, not by the folder listing, so a build of such a package passes --manifest-cache none.
func excludingAllBut(_ kept: [String], in target: String = "") -> [String] {
let root = target.isEmpty ? Context.packageDirectory : Context.packageDirectory + "/" + target
func walk(_ relative: String) -> [String] {
let folder = relative.isEmpty ? root : root + "/" + relative
let entries = (try? FileManager.default.contentsOfDirectory(atPath: folder)) ?? []
var excluded: [String] = []
for entry in entries.sorted() {
let path = relative.isEmpty ? entry : relative + "/" + entry
if kept.contains(path) {
continue
}
if kept.contains(where: { $0.hasPrefix(path + "/") }) {
excluded += walk(path)
} else {
excluded.append(path)
}
}
return excluded
}
return walk("")
}
func applePackage() -> Package {
Package(
name: "ActionUI",
platforms: [
.macOS("14.6"), // macOS 14.6+
.iOS("17.6"), // iOS 17.6+
.tvOS("17.6"), // tvOS 17.6+
.watchOS("10.6"), // watchOS 10.6+
.visionOS("2.6"), // visionOS 2.6+
],
products: [
// MARK: - Core library
.library(
name: "ActionUI",
targets: ["ActionUI"]
),
// MARK: - Menu bar
// Lifecycle-free JSON->NSMenu builder (default macOS menu bar plus
// CommandMenu / CommandGroup items). Shared by ActionUIAppKitApplication
// and external hosts. Depends only on ActionUI core.
.library(
name: "ActionUIMenuBar",
targets: ["ActionUIMenuBar"]
),
// MARK: - Swift adapter
// Provides the @MainActor ActionUISwift struct with a simplified static API.
// Depends on ActionUI. Suitable for Swift-only clients.
.library(
name: "ActionUISwiftAdapter",
targets: ["ActionUISwiftAdapter"]
),
// MARK: - C adapter
// Exposes a pure-C API surface for embedding ActionUI in C projects or
// for use as a stable ABI boundary from other languages.
.library(
name: "ActionUICAdapter",
targets: ["ActionUICAdapter"]
),
// MARK: - Objective-C adapter
// Wraps ActionUI in Objective-C for integration with ObjC or mixed codebases.
.library(
name: "ActionUIObjCAdapter",
targets: ["ActionUIObjCAdapter"]
),
// MARK: - JavaScriptCore adapter
// Bridges ActionUI to JavaScriptCore for scripting environments.
.library(
name: "ActionUIJavaScriptCoreAdapter",
targets: ["ActionUIJavaScriptCoreAdapter"]
),
// MARK: - WebKit JS adapter
// Bridges ActionUI to WKWebView / WebKit JavaScript for hybrid web apps.
.library(
name: "ActionUIWebKitJSAdapter",
targets: ["ActionUIWebKitJSAdapter"]
),
// MARK: - Remote binding
// Out-of-process access to ActionUI windows: a Unix domain socket server speaking
// newline-delimited JSON-RPC 2.0, mirroring the C adapter's verb set. Hosts that
// embed ActionUI start it so that child processes (Python scripts, tools, tests)
// can read and mutate window state. macOS here; on Linux it is part of libActionUI.so
// (linuxPackage). See ActionUIRemote/PROTOCOL.md.
.library(
name: "ActionUIRemote",
targets: ["ActionUIRemote"]
),
// MARK: - Documentation bundle
// Resource-only bundle containing element schemas (.md), JSON templates,
// and the element index. No code dependencies — consumers access the
// bundle at runtime via ActionUIDocumentation.bundle.
.library(
name: "ActionUIDocumentation",
targets: ["ActionUIDocumentation"]
),
// MARK: - Document verifier
// Checks ActionUI JSON documents against the element schemas: unknown property names,
// wrong value types, unknown enum values, missing required properties, platform issues.
// Swift twin of the Python verifier in Tools/verifier (both read ActionUIVerifier/Schemas),
// Foundation only; it does not depend on ActionUI. The command-line tool is in
// Apps/ActionUIVerifier.
.library(
name: "ActionUIVerifier",
targets: ["ActionUIVerifier"]
),
],
targets: [
// MARK: - ActionUI (core)
// Pure Swift target. Contains all view types, ActionUIModel, ActionUIRegistry,
// ActionUIView, and related infrastructure.
.target(
name: "ActionUI",
path: "ActionUI",
// VideoPlayer.swift imports AVKit, but the code only references the SwiftUI overlay
// (_AVKit_SwiftUI), so the linker records no dependency on AVKit.framework itself and
// the overlay's VideoPlayerView then fails at runtime: "failed to demangle superclass of
// VideoPlayerView from mangled name 'So12AVPlayerViewC'" (AVPlayerView is not loaded).
// The Xcode project links AVKit.framework explicitly for the same reason (de12140);
// this is the SwiftPM equivalent, so the viewer and any other package client get it.
// Unconditional: AVKit exists on every platform this package declares.
linkerSettings: [
.linkedFramework("AVKit"),
.linkedFramework("Charts"),
],
),
// MARK: - ActionUIMenuBar
// Lifecycle-free menu-bar construction.
.target(
name: "ActionUIMenuBar",
dependencies: ["ActionUI"],
path: "ActionUIMenuBar",
),
// MARK: - ActionUISwiftAdapter
// Thin Swift wrapper. Public entry point for Swift clients.
.target(
name: "ActionUISwiftAdapter",
dependencies: ["ActionUI"],
path: "ActionUISwiftAdapter",
),
// MARK: - ActionUICAdapterHeaders
// Headers-only C target. Owns the public C headers so SPM can build them
// as a standalone Clang module that ActionUICAdapter (Swift) can import.
//
// SPM cannot mix C and Swift in one target Splitting into a dedicated C target
// sidesteps all bridging-header and module-map issues.
//
// Not listed in `products` — internal implementation detail only.
//
// Required file layout (no changes to existing files):
// ActionUICAdapter/
// dummy.c
// include/
// ActionUICAdapter.h - umbrella (may keep <ActionUICAdapter/ActionUIC.h>)
// ActionUIC.h - typedefs and public C API
// ActionUIC.swift, ActionUIC+Apple.swift - compiled by ActionUICAdapter target below
// ActionUIC+Linux.swift - compiled by linuxPackage's ActionUICAdapter
// HeaderCheck/ - compiled by the Xcode framework target, and
// by Scripts/check-c-prototypes.sh
.target(
name: "ActionUICAdapterHeaders",
path: "ActionUICAdapter",
exclude: [
"ActionUIC.swift",
"ActionUIC+Apple.swift",
"ActionUIC+Linux.swift",
"HeaderCheck",
],
publicHeadersPath: "include"
),
// MARK: - ActionUICAdapter (Swift)
// Swift glue layer over the C API. Depends on ActionUICAdapterHeaders so that
// all C typedefs (ActionUILoggerCallback, ActionUILogLevel, ...) are visible
// to ActionUIC.swift via `import ActionUICAdapterHeaders` — no bridging header
// or unsafe flags required.
//
.target(
name: "ActionUICAdapter",
dependencies: ["ActionUI", "ActionUICAdapterHeaders"],
path: "ActionUICAdapter",
exclude: [
// Exclude C sources and headers — owned by ActionUICAdapterHeaders
"dummy.c",
"include",
"HeaderCheck",
"ActionUIC+Linux.swift",
],
sources: ["ActionUIC.swift", "ActionUIC+Apple.swift"],
),
// MARK: - ActionUIObjCAdapter (Swift)
// Pure Swift target containing the @objc implementation.
//
// Consumers (ObjC/C++) import via:
// @import ActionUIObjCAdapter;
.target(
name: "ActionUIObjCAdapter",
dependencies: ["ActionUI"],
path: "ActionUIObjCAdapter",
sources: ["ActionUIObjC.swift"],
),
// MARK: - ActionUIJavaScriptCoreAdapter
// Swift + JSC target. Bridges JSContext calls to ActionUIModel.
// JavaScriptCore is a system framework on Apple platforms — no extra dep needed.
.target(
name: "ActionUIJavaScriptCoreAdapter",
dependencies: ["ActionUI"],
path: "ActionUIJavaScriptCoreAdapter",
),
// MARK: - ActionUIWebKitJSAdapter
// Swift target bridging WKWebView <-> ActionUI.
// WebKit is a system framework — available on macOS, iOS, iPadOS, visionOS.
// Not available on watchOS or tvOS; guard at the call site if needed.
//
// ActionUIWebKitJSBridge.js is loaded at runtime via Bundle.module and must
// be declared as a bundled resource so SPM copies it into the product bundle.
.target(
name: "ActionUIWebKitJSAdapter",
dependencies: ["ActionUI"],
path: "ActionUIWebKitJSAdapter",
resources: [
.process("ActionUIWebKitJSBridge.js"),
],
),
// MARK: - ActionUIViewer (moved out of core)
// The viewer now lives in its own aggregator package at Apps/ActionUIViewer so it can link
// the optional add-on packages and register their element types - a core target cannot,
// because the add-ons depend on core (that would be a circular package dependency). Build it
// with: swift build --package-path Apps/ActionUIViewer --product ActionUIViewer.
// MARK: - ActionUIDocumentation
// Resource-only target. Bundles the Documentation/ folder so consumers
// can access schemas, JSON templates, and the element index at runtime.
// Not linked into any framework — meant to be copied into app bundles.
.target(
name: "ActionUIDocumentation",
path: "Documentation",
exclude: [
"Comparison-vs-ReactNative.md",
"Comparison-vs-tkinter.md",
"Architecture.md"
],
sources: ["ActionUIDocumentation.swift"],
resources: [
.copy("ActionUI-JSON-Guide.md"),
.copy("ActionUI-MenuBar-JSON-Guide.md"),
.copy("ActionUI-Elements.md"),
.copy("Schemas"),
.copy("Elements"),
]
),
// MARK: - Unit tests for ActionUI core
.testTarget(
name: "ActionUITests",
dependencies: ["ActionUI"],
path: "ActionUITests"
),
// MARK: - Unit tests for the menu-bar builder (macOS)
.testTarget(
name: "ActionUIMenuBarTests",
dependencies: ["ActionUIMenuBar", "ActionUI"],
path: "ActionUIMenuBarTests"
),
// MARK: - ActionUIRemote
// Remote binding: JSON-RPC 2.0 codec, Unix domain socket server, and the method table
// over ActionUIModel. Swift over FoundationEssentials (Foundation on Apple), Dispatch and
// the C library, shared with the Linux build; the sources are guarded with
// #if os(macOS) || os(Linux) rather than through platform conditions here.
// Non-Swift files under ActionUIRemote/ (Python client, protocol docs) are listed in
// `exclude` as they are added, so SPM does not warn about unhandled files.
.target(
name: "ActionUIRemote",
dependencies: ["ActionUI"],
path: "ActionUIRemote",
exclude: [
"Node",
"PROTOCOL.md",
"Python",
"README.md",
"Shell",
],
),
// MARK: - ActionUIVerifier
// Swift sources in ActionUIVerifier/, and ActionUIVerifier/Schemas - the element schemas,
// shared with the Python verifier in Tools/verifier - bundled as a resource (reached
// through Bundle.module).
.target(
name: "ActionUIVerifier",
path: "ActionUIVerifier",
resources: [
.copy("Schemas"),
]
),
// MARK: - Unit tests for ActionUIVerifier
// Parity/ holds the script that compares this verifier with the Python one; it is run
// with python3, not by `swift test`.
.testTarget(
name: "ActionUIVerifierTests",
dependencies: ["ActionUIVerifier"],
path: "ActionUIVerifierTests",
exclude: [
"Parity",
]
),
// MARK: - Unit tests for ActionUIRemote
.testTarget(
name: "ActionUIRemoteTests",
dependencies: ["ActionUIRemote", "ActionUI"],
path: "ActionUIRemoteTests"
),
]
)
}
func coreCheckPackage() -> Package {
Package(
name: "ActionUI",
products: [
.library(name: "ActionUI", targets: ["ActionUI"]),
],
targets: [
// The portable code, and a renderer half with no renderers (ActionUICoreCheck).
.target(
name: "ActionUI",
path: ".",
exclude: excludingAllBut(["ActionUI/Core", "ActionUIRendererShared/Sources", "ActionUICoreCheck"]),
sources: ["ActionUI/Core", "ActionUIRendererShared/Sources", "ActionUICoreCheck"]
),
// The portable tests: ActionUITests/Core and ActionUIRendererShared/Tests, portable like
// the code they test.
.testTarget(
name: "ActionUITests",
dependencies: ["ActionUI"],
path: ".",
exclude: excludingAllBut(["ActionUITests/Core", "ActionUIRendererShared/Tests"]),
sources: ["ActionUITests/Core", "ActionUIRendererShared/Tests"]
),
]
)
}
// Linux: GTK 4, libadwaita and libsoup 3 from the system (libgtk-4-dev, libadwaita-1-dev,
// libsoup-3.0-dev and pkg-config to build), never bundled; the version floors are in
// ActionUIAdwaita/CAdwaita/CAdwaita.h and ActionUIAdwaita/CSoup/CSoup.h. At run time https URLs
// also need glib-networking (installed with GNOME). WebView needs WebKitGTK 6.0 (libwebkitgtk-6.0-4),
// loaded at run time only when a WebView is shown, so it is an app's dependency, not ActionUI's; Map
// likewise needs libshumate (libshumate-1.0-1), loaded when a Map is made.
func linuxPackage() -> Package {
Package(
name: "ActionUI",
products: [
// The ActionUI module linked into what uses it, for add-ons and Swift programs: one process has
// one Swift runtime, and an add-on links no ActionUI of its own. libActionUI.so, for programs
// in other languages, is a package of its own: ActionUIAdwaita/Library.
.library(name: "ActionUIStatic", targets: ["ActionUI"]),
// What that library adds: the C adapter, the application functions and the remote server.
.library(name: "ActionUIStaticHosts", targets: ["ActionUICAdapter", "ActionUIRemote", "ActionUIAdwaitaApplication"]),
// The same three one by one, for a host that runs its own application (as an AppKit host does
// on macOS) and takes the C adapter and the remote server without ActionUI's application.
.library(name: "ActionUICAdapter", targets: ["ActionUICAdapter"]),
.library(name: "ActionUIRemote", targets: ["ActionUIRemote"]),
.library(name: "ActionUIAdwaitaApplication", targets: ["ActionUIAdwaitaApplication"]),
// libadwaita's and GTK's C API, so an add-on sees GtkWidget as ActionUI's module does.
.library(name: "CAdwaita", targets: ["CAdwaita"]),
// The Swift adapter, for Swift programs.
.library(name: "ActionUISwiftAdapter", targets: ["ActionUISwiftAdapter"]),
// The test app's action handlers, for the Linux demo in ActionUIAdwaita/Apps.
.library(name: "ActionUIDemoHandlers", targets: ["ActionUIDemoHandlers"]),
// The document verifier, which needs no GTK. The command-line tool is in Apps/ActionUIVerifier.
.library(name: "ActionUIVerifier", targets: ["ActionUIVerifier"]),
],
targets: [
// libadwaita's C API (and GTK's, which it includes), found through pkg-config.
.systemLibrary(
name: "CAdwaita",
path: "ActionUIAdwaita/CAdwaita",
pkgConfig: "libadwaita-1"
),
// libsoup 3's C API, for http and https URLs (AsyncImage).
.systemLibrary(
name: "CSoup",
path: "ActionUIAdwaita/CSoup",
pkgConfig: "libsoup-3.0"
),
// The portable code, the shared renderer code and the GTK renderer: one module, as ActionUI is on Apple platforms.
// The symbol icons come from CSymbolResource; ActionUISymbolResourceCheck warns when they
// were not generated (Scripts/prepare-linux-symbols.sh).
.target(
name: "ActionUI",
dependencies: ["CAdwaita", "CSoup", "CSymbolResource", "CLinkedAddOns"],
path: ".",
exclude: excludingAllBut(["ActionUI/Core", "ActionUIRendererShared/Sources", "ActionUIAdwaita/Sources"]),
sources: ["ActionUI/Core", "ActionUIRendererShared/Sources", "ActionUIAdwaita/Sources"],
plugins: ["ActionUISymbolResourceCheck"]
),
// Reaches the add-ons linked into libActionUI.so, in a package ActionUI cannot depend on.
.target(
name: "CLinkedAddOns",
path: "ActionUIAdwaita/CLinkedAddOns"
),
// The Material Symbols icons that stand in for SF Symbols, a GResource in a section of its
// own, generated before the build by Scripts/prepare-linux-symbols.sh (empty without it).
.target(
name: "CSymbolResource",
dependencies: ["CAdwaita"],
path: "ActionUIAdwaita/CSymbolResource"
),
// Warns on every build while the icons are missing or older than their map or font.
.plugin(
name: "ActionUISymbolResourceCheck",
capability: .buildTool(),
path: "ActionUIAdwaita/Plugins/SymbolResourceCheck"
),
// The C interface: its C header as a module (only ActionUIC.h: the folder's umbrella
// header declares version symbols that only the Xcode framework build defines), and the
// functions that work with values and JSON text (ActionUIC.swift; the Apple-only ones,
// which hand out native views, are not built).
.systemLibrary(
name: "ActionUICAdapterHeaders",
path: "ActionUIAdwaita/CAdapterHeaders"
),
.target(
name: "ActionUICAdapter",
dependencies: ["ActionUI", "ActionUICAdapterHeaders"],
path: "ActionUICAdapter",
exclude: [
"dummy.c",
"include",
"HeaderCheck",
"ActionUIC+Apple.swift",
],
sources: ["ActionUIC.swift", "ActionUIC+Linux.swift"]
),
// The application functions (actionUIApp*), over AdwaitaApplication; their C header's
// handler types come from ActionUIApp.h as a module (only that header: its folder's
// umbrella header declares version symbols that only the Xcode framework build defines).
.systemLibrary(
name: "ActionUIAppHeaders",
path: "ActionUIAdwaita/AppHeaders"
),
// accept4, which the remote server uses and Swift's Glibc module does not import.
.systemLibrary(
name: "CLinuxSocket",
path: "ActionUIAdwaita/CLinuxSocket"
),
// The remote server (ActionUIRemote/PROTOCOL.md): JSON-RPC over a Unix socket, so other
// processes of the user read and change the application's windows. The same sources as on
// macOS; the clients and the protocol text are not compiled.
.target(
name: "ActionUIRemote",
dependencies: ["ActionUI", "CLinuxSocket"],
path: "ActionUIRemote",
exclude: [
"Node",
"PROTOCOL.md",
"Python",
"README.md",
"Shell",
]
),
.target(
name: "ActionUIAdwaitaApplication",
dependencies: ["ActionUI", "CAdwaita", "ActionUIAppHeaders", "ActionUIRemote"],
path: "ActionUIAdwaitaApplication"
),
// The Swift adapter without its SwiftUI views (ActionUISwift+SwiftUI.swift), for Swift programs.
.target(
name: "ActionUISwiftAdapter",
dependencies: ["ActionUI"],
path: "ActionUISwiftAdapter",
exclude: ["ActionUISwift+SwiftUI.swift", "ActionUISwiftAdapter.docc"]
),
// The test app's action handlers, which the Mac and iOS app compiles itself.
.target(
name: "ActionUIDemoHandlers",
dependencies: ["ActionUI", "ActionUISwiftAdapter"],
path: ".",
exclude: excludingAllBut(["ActionUISwiftTestApp/DemoHandlers.swift"]),
sources: ["ActionUISwiftTestApp/DemoHandlers.swift"]
),
// The same sources as on Apple, without the schemas as a resource (SchemaSet.swift says why).
.target(
name: "ActionUIVerifier",
path: "ActionUIVerifier",
exclude: ["Schemas"]
),
.testTarget(
name: "ActionUIVerifierTests",
dependencies: ["ActionUIVerifier"],
path: "ActionUIVerifierTests",
exclude: ["Parity"]
),
// The portable tests, as in coreCheckPackage.
.testTarget(
name: "ActionUITests",
dependencies: ["ActionUI"],
path: ".",
exclude: excludingAllBut(["ActionUITests/Core", "ActionUIRendererShared/Tests"]),
sources: ["ActionUITests/Core", "ActionUIRendererShared/Tests"]
),
// An element written as an add-on writes one, for the renderer tests: a module of its own,
// so what it uses is ActionUI's public contract.
.target(
name: "ActionUIAdwaitaAddOnFixture",
dependencies: ["ActionUI", "CAdwaita"],
path: "ActionUIAdwaita/Tests/AddOnFixture"
),
// The renderer tests. They need a display and skip themselves without one.
.testTarget(
name: "ActionUIAdwaitaTests",
dependencies: ["ActionUI", "CAdwaita", "CSoup", "ActionUIAdwaitaApplication", "ActionUIAdwaitaAddOnFixture"],
path: "ActionUIAdwaita/Tests",
// The video VideoPlayer plays, and the add-on fixture, a target of its own.
exclude: ["AddOnFixture", "Media"]
),
// The remote server's tests: the codec, the socket server, the shared server and the Python
// client against it.
.testTarget(
name: "ActionUIRemoteTests",
dependencies: ["ActionUIRemote", "ActionUI"],
path: "ActionUIRemoteTests"
),
]
)
}
// Only the chosen package may be constructed: PackageDescription takes the last Package created as
// the manifest.
#if os(Linux)
let package = coreOnly ? coreCheckPackage() : linuxPackage()
#else
let package = coreOnly ? coreCheckPackage() : applePackage()
#endif