-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathPackage.swift
More file actions
89 lines (82 loc) · 2.37 KB
/
Copy pathPackage.swift
File metadata and controls
89 lines (82 loc) · 2.37 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
// swift-tools-version: 6.2
import PackageDescription
#if os(macOS)
let package = Package(
name: "vChewingIME",
platforms: [
.macOS(.v12),
],
products: [
.executable(
name: "vChewing",
targets: ["vChewing"]
),
.executable(
name: "vChewingInstaller",
targets: ["vChewingInstaller"]
),
],
dependencies: [
.package(path: "./Packages/vChewing_InstallerAssembly4Darwin"),
.package(path: "./Packages/vChewing_MainAssembly4Darwin"),
],
targets: [
// MARK: - Executable Targets
.executableTarget(
name: "vChewing",
dependencies: [
.product(name: "MainAssembly4Darwin", package: "vChewing_MainAssembly4Darwin"),
],
path: "./Sources/vChewingIME_macOS",
exclude: ["Resources"],
sources: ["Modules"],
swiftSettings: [
.defaultIsolation(MainActor.self),
]
),
.executableTarget(
name: "vChewingInstaller",
dependencies: [
.product(name: "InstallerAssembly4Darwin", package: "vChewing_InstallerAssembly4Darwin"),
],
path: "./Sources/Installer_macOS",
exclude: ["Resources"],
swiftSettings: [
.defaultIsolation(MainActor.self),
]
),
// MARK: - Build Plugin
/// Assembles macOS `.app` bundles for vChewing and vChewingInstaller.
///
/// Usage:
/// ```
/// swift package --allow-writing-to-package-directory bundle-apps
/// swift package --allow-writing-to-package-directory bundle-apps -- --debug
/// swift package --allow-writing-to-package-directory bundle-apps -- --archive
/// ```
///
/// Output goes to `Build/Products/Release/` (or `Debug/`).
/// With `--archive`, also creates an `.xcarchive` in
/// `~/Library/Developer/Xcode/Archives/`.
.plugin(
name: "BundleApps",
capability: .command(
intent: .custom(
verb: "bundle-apps",
description: "Build and assemble macOS app bundles for vChewing and vChewingInstaller"
),
permissions: [
.writeToPackageDirectory(
reason: "Creates app bundles in Build/Products/"
),
]
)
),
]
)
#else
let package = Package(
name: "vChewingIME",
targets: []
)
#endif