Skip the AirDrop helper compile unless swiftc is on macOS.

Linux CI has a Swift compiler that cannot import AppKit. The menu-bar app opens the share sheet itself when verae-airdrop is not in the package.

Co-authored-by: George Lambert <marchon@gmail.com>
This commit is contained in:
Cursor Agent 2026-10-05 01:29:53 +00:00
commit a63ad55343
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -298,7 +298,7 @@ func TestMacAirDropAndPackageSources(t *testing.T) {
{"airdrop_darwin.go", []string{"NSSharingService", nsAirDropService, "performWithItems:", airDropAgainTitle, "UNUserNotificationCenter"}},
{"../../platform/macos/airdrop/main.swift", []string{"NSSharingService(named: .sendViaAirDrop)", "perform(withItems:"}},
{"service_darwin.go", []string{"/Library/LaunchAgents/com.verae.netprint.tray.plist", "LimitLoadToSessionType", "Aqua", "netprint"}},
{"../../platform/macos/pkg/build-netprint-pkg.sh", []string{"VeraeNetPrint-macos-arm64-", "LaunchAgents", "LaunchDaemons"}},
{"../../platform/macos/pkg/build-netprint-pkg.sh", []string{"VeraeNetPrint-macos-arm64-", "LaunchAgents", "LaunchDaemons", `uname -s`, "Darwin"}},
{"../../docs/network-printer.md", []string{"right-click", "sudo installer -pkg", "Local Network", "not signed"}},
{"dnsservice_darwin.go", []string{"DNSServiceRegister", "DNSServiceProcessResult", "dnsPort"}},
{"advertise_darwin.go", []string{`advertiseForOS("darwin"`}},

View file

@ -34,7 +34,9 @@ cp -f "$ROOT/platform/macos/netprint/com.verae.netprint.tray.plist" "$STAGE/Libr
cp -f "$ROOT/platform/macos/netprint/com.verae.netprint.plist" "$STAGE/Library/LaunchDaemons/com.verae.netprint.plist"
cp -f "$ROOT/platform/macos/netprint/com.verae.netprint.tray.plist" "$STAGE/Library/LaunchAgents/com.verae.netprint.tray.plist"
chmod 644 "$STAGE/Library/LaunchDaemons/com.verae.netprint.plist" "$STAGE/Library/LaunchAgents/com.verae.netprint.tray.plist"
if command -v swiftc >/dev/null 2>&1; then
# swiftc on Linux cannot import AppKit. The menu-bar binary opens the same
# share sheet itself when verae-airdrop is absent, so Linux CI skips the helper.
if [[ "$(uname -s)" == "Darwin" ]] && command -v swiftc >/dev/null 2>&1; then
swiftc -O -o "$STAGE/Library/Application Support/Verae/NetPrint/bin/verae-airdrop" \
"$ROOT/platform/macos/airdrop/main.swift"
chmod 755 "$STAGE/Library/Application Support/Verae/NetPrint/bin/verae-airdrop"