forked from steipete/CodexBar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
132 lines (127 loc) · 5.23 KB
/
Package.swift
File metadata and controls
132 lines (127 loc) · 5.23 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
// swift-tools-version: 6.2
import CompilerPluginSupport
import Foundation
import PackageDescription
let sweetCookieKitPath = "../SweetCookieKit"
let useLocalSweetCookieKit =
ProcessInfo.processInfo.environment["CODEXBAR_USE_LOCAL_SWEETCOOKIEKIT"] == "1"
let sweetCookieKitDependency: Package.Dependency =
useLocalSweetCookieKit && FileManager.default.fileExists(atPath: sweetCookieKitPath)
? .package(path: sweetCookieKitPath)
: .package(url: "https://github.com/steipete/SweetCookieKit", from: "0.4.1")
let package = Package(
name: "CodexBar",
defaultLocalization: "en",
platforms: [
.macOS(.v14),
],
dependencies: [
.package(url: "https://github.com/sparkle-project/Sparkle", from: "2.9.1"),
.package(url: "https://github.com/steipete/Commander", from: "0.2.1"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
.package(url: "https://github.com/apple/swift-log", from: "1.12.0"),
.package(url: "https://github.com/apple/swift-syntax", from: "600.0.1"),
.package(url: "https://github.com/sindresorhus/KeyboardShortcuts", from: "2.4.0"),
.package(url: "https://github.com/zats/Vortex", revision: "ef5392088d4aeb255c4eee83157dbdafcd31bf07"),
sweetCookieKitDependency,
],
targets: {
var targets: [Target] = [
.target(
name: "CodexBarCore",
dependencies: [
"CodexBarMacroSupport",
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "Logging", package: "swift-log"),
.product(name: "SweetCookieKit", package: "SweetCookieKit"),
],
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
]),
.macro(
name: "CodexBarMacros",
dependencies: [
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
]),
.target(
name: "CodexBarMacroSupport",
dependencies: [
"CodexBarMacros",
]),
.executableTarget(
name: "CodexBarCLI",
dependencies: [
"CodexBarCore",
.product(name: "Commander", package: "Commander"),
],
path: "Sources/CodexBarCLI",
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
]),
.testTarget(
name: "CodexBarLinuxTests",
dependencies: ["CodexBarCore", "CodexBarCLI"],
path: "TestsLinux",
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
.enableExperimentalFeature("SwiftTesting"),
]),
]
#if os(macOS)
targets.append(contentsOf: [
.executableTarget(
name: "CodexBarClaudeWatchdog",
dependencies: [],
path: "Sources/CodexBarClaudeWatchdog",
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
]),
.executableTarget(
name: "CodexBar",
dependencies: [
.product(name: "Sparkle", package: "Sparkle"),
.product(name: "KeyboardShortcuts", package: "KeyboardShortcuts"),
.product(name: "Vortex", package: "Vortex"),
"CodexBarMacroSupport",
"CodexBarCore",
],
path: "Sources/CodexBar",
resources: [
.process("Resources"),
],
swiftSettings: [
// Opt into Swift 6 strict concurrency (approachable migration path).
.enableUpcomingFeature("StrictConcurrency"),
.define("ENABLE_SPARKLE"),
]),
.executableTarget(
name: "CodexBarWidget",
dependencies: ["CodexBarCore"],
path: "Sources/CodexBarWidget",
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
]),
.executableTarget(
name: "CodexBarClaudeWebProbe",
dependencies: ["CodexBarCore"],
path: "Sources/CodexBarClaudeWebProbe",
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
]),
])
targets.append(.testTarget(
name: "CodexBarTests",
dependencies: ["CodexBar", "CodexBarCore", "CodexBarCLI", "CodexBarWidget"],
path: "Tests",
resources: [
.copy("CodexBarTests/Fixtures"),
],
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency"),
.enableExperimentalFeature("SwiftTesting"),
]))
#endif
return targets
}())