-
-
Notifications
You must be signed in to change notification settings - Fork 427
Expand file tree
/
Copy pathmain.swift
More file actions
19 lines (15 loc) · 633 Bytes
/
Copy pathmain.swift
File metadata and controls
19 lines (15 loc) · 633 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import AppKit
import Foundation
class AppDelegate: NSObject, NSApplicationDelegate {}
let bundleIdentifierBase = Bundle(url: Bundle.main.bundleURL.appendingPathComponent(
"CopilotForXcodeExtensionService.app"
))?.object(forInfoDictionaryKey: "BUNDLE_IDENTIFIER_BASE") as? String ?? "com.intii.CopilotForXcode"
let serviceIdentifier = bundleIdentifierBase + ".CommunicationBridge"
let appDelegate = AppDelegate()
let delegate = ServiceDelegate()
let listener = NSXPCListener(machServiceName: serviceIdentifier)
listener.delegate = delegate
listener.resume()
let app = NSApplication.shared
app.delegate = appDelegate
app.run()