├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── ProcessServiceContainer.xcframework ├── macos-arm64_x86_64 │ └── ProcessServiceContainer.framework │ │ ├── Versions │ │ ├── Current │ │ └── A │ │ │ ├── ProcessServiceContainer │ │ │ ├── XPCServices │ │ │ └── ProcessService.xpc │ │ │ │ └── Contents │ │ │ │ ├── MacOS │ │ │ │ └── ProcessService │ │ │ │ ├── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ │ ├── Modules │ │ │ ├── ProcessServiceContainer.swiftmodule │ │ │ │ ├── arm64-apple-macos.swiftdoc │ │ │ │ ├── x86_64-apple-macos.swiftdoc │ │ │ │ ├── Project │ │ │ │ │ ├── arm64-apple-macos.swiftsourceinfo │ │ │ │ │ └── x86_64-apple-macos.swiftsourceinfo │ │ │ │ ├── arm64-apple-macos.swiftinterface │ │ │ │ ├── x86_64-apple-macos.swiftinterface │ │ │ │ ├── arm64-apple-macos.private.swiftinterface │ │ │ │ ├── x86_64-apple-macos.private.swiftinterface │ │ │ │ ├── arm64-apple-macos.abi.json │ │ │ │ └── x86_64-apple-macos.abi.json │ │ │ └── module.modulemap │ │ │ ├── Headers │ │ │ ├── ProcessServiceContainer.h │ │ │ └── ProcessServiceContainer-Swift.h │ │ │ ├── Resources │ │ │ └── Info.plist │ │ │ └── _CodeSignature │ │ │ └── CodeResources │ │ ├── Headers │ │ ├── Modules │ │ ├── Resources │ │ ├── XPCServices │ │ └── ProcessServiceContainer └── Info.plist ├── .gitignore ├── .spi.yml ├── Xcode Project ├── ProcessServiceExample │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── ProcessServiceExampleApp.swift │ ├── ProcessServiceExample.entitlements │ └── ContentView.swift ├── ProcessServiceExample.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── swiftpm │ │ │ └── Package.resolved │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── ProcessServiceContainer.xcscheme │ └── project.pbxproj ├── ProcessService │ ├── ProcessService.entitlements │ ├── Info.plist │ └── main.swift └── ProcessServiceContainer │ ├── ProcessServiceContainer.xcconfig │ ├── Bootstrap.swift │ └── ProcessServiceContainer.h ├── Sources ├── ProcessServiceServer │ ├── NSXPCConnection+Server.swift │ └── ExportedProcessService.swift ├── ProcessServiceShared │ ├── Process+Event.swift │ └── ProcessServiceXPCProtocols.swift └── ProcessServiceClient │ ├── NSXPCConnection+ProcessService.swift │ ├── ExportedProcessServiceClient.swift │ └── HostedProcess.swift ├── Package.resolved ├── LICENSE ├── Package.swift ├── Tests ├── ProcessServiceClientTests │ └── HostedProcessTests.swift └── ProcessServiceServerTests │ └── ExportedProcessServiceTests.swift ├── README.md └── CODE_OF_CONDUCT.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [mattmassicotte] 2 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm 8 | .netrc 9 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/XPCServices: -------------------------------------------------------------------------------- 1 | Versions/Current/XPCServices -------------------------------------------------------------------------------- /.spi.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | builder: 3 | configs: 4 | - documentation_targets: [ProcessServiceServer, ProcessServiceClient] 5 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/ProcessServiceContainer: -------------------------------------------------------------------------------- 1 | Versions/Current/ProcessServiceContainer -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Xcode Project/ProcessService/ProcessService.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample/ProcessServiceExampleApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | @main 4 | struct ProcessServiceExampleApp: App { 5 | var body: some Scene { 6 | WindowGroup { 7 | ContentView() 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/ProcessServiceContainer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChimeHQ/ProcessService/HEAD/ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/ProcessServiceContainer -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceContainer/ProcessServiceContainer.xcconfig: -------------------------------------------------------------------------------- 1 | SWIFT_VERSION = 5.0 2 | 3 | APPLICATION_EXTENSION_API_ONLY = YES 4 | BUILD_LIBRARY_FOR_DISTRIBUTION = YES 5 | ENABLE_HARDENED_RUNTIME = YES 6 | MACH_O_TYPE = mh_dylib 7 | 8 | INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2023 Chime Systems Inc. All rights reserved. 9 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/XPCServices/ProcessService.xpc/Contents/MacOS/ProcessService: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChimeHQ/ProcessService/HEAD/ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/XPCServices/ProcessService.xpc/Contents/MacOS/ProcessService -------------------------------------------------------------------------------- /Xcode Project/ProcessService/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | XPCService 6 | 7 | ServiceType 8 | Application 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChimeHQ/ProcessService/HEAD/ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.swiftdoc -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChimeHQ/ProcessService/HEAD/ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.swiftdoc -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module ProcessServiceContainer { 2 | umbrella header "ProcessServiceContainer.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | 8 | module ProcessServiceContainer.Swift { 9 | header "ProcessServiceContainer-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChimeHQ/ProcessService/HEAD/ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChimeHQ/ProcessService/HEAD/ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample/ProcessServiceExample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - '**' 10 | 11 | env: 12 | DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer 13 | 14 | jobs: 15 | test: 16 | name: Test 17 | runs-on: macOS-13 18 | steps: 19 | - uses: actions/checkout@v3 20 | - name: Build 21 | run: set -o pipefail && xcodebuild -scheme ProcessService-Package -destination "platform=macOS" build | xcpretty 22 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceContainer/Bootstrap.swift: -------------------------------------------------------------------------------- 1 | public struct ServiceContainer { 2 | /// The name of the bundled XPC service. 3 | public static let name = "com.chimehq.ProcessService" 4 | 5 | /// Initializes the service so look ups can work from anywhere in the current process. 6 | /// 7 | /// This function **must** be run once before trying to interact with the any of the `ProcessServiceClient` APIs. This only needs to happen once per system boot, which makes errors here very hard to detect. 8 | public static func bootstrap() { 9 | _ = NSXPCConnection(serviceName: name) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Xcode Project/ProcessService/main.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | import ProcessServiceServer 4 | 5 | final class ServiceDelegate: NSObject, NSXPCListenerDelegate { 6 | func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool { 7 | do { 8 | try newConnection.configureProcessServiceServer() 9 | } catch { 10 | return false 11 | } 12 | 13 | newConnection.activate() 14 | 15 | return true 16 | } 17 | } 18 | 19 | let delegate = ServiceDelegate() 20 | let listener = NSXPCListener.service() 21 | 22 | listener.delegate = delegate 23 | listener.resume() 24 | 25 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceContainer/ProcessServiceContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProcessServiceContainer.h 3 | // ProcessServiceContainer 4 | // 5 | // Created by Matthew Massicotte on 2022-10-12. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for ProcessServiceContainer. 11 | FOUNDATION_EXPORT double ProcessServiceContainerVersionNumber; 12 | 13 | //! Project version string for ProcessServiceContainer. 14 | FOUNDATION_EXPORT const unsigned char ProcessServiceContainerVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /Sources/ProcessServiceServer/NSXPCConnection+Server.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | import ProcessServiceShared 4 | 5 | extension NSXPCConnection { 6 | public func configureProcessServiceServer() throws { 7 | self.remoteObjectInterface = NSXPCInterface(with: ProcessServiceClientXPCProtocol.self) 8 | 9 | guard let client = remoteObjectProxy as? ProcessServiceClientXPCProtocol else { 10 | return 11 | } 12 | 13 | self.exportedInterface = NSXPCInterface(with: ProcessServiceXPCProtocol.self) 14 | 15 | let exportedObject = ExportedProcessService(client: client) // retained by the connection 16 | self.exportedObject = exportedObject 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sources/ProcessServiceShared/Process+Event.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension Process { 4 | public enum Event: Hashable, Sendable { 5 | case stdout(Data) 6 | case stderr(Data) 7 | case terminated(Process.TerminationReason) 8 | } 9 | } 10 | 11 | extension Process.Event: CustomStringConvertible { 12 | public var description: String { 13 | switch self { 14 | case .stdout(let data): 15 | return "stdout(\(data))" 16 | case .stderr(let data): 17 | return "stderr(\(data))" 18 | case .terminated(.exit): 19 | return "terminated(exit)" 20 | case .terminated(.uncaughtSignal): 21 | return "terminated(signal)" 22 | case .terminated(_): 23 | return "terminated(?)" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Headers/ProcessServiceContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProcessServiceContainer.h 3 | // ProcessServiceContainer 4 | // 5 | // Created by Matthew Massicotte on 2022-10-12. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for ProcessServiceContainer. 11 | FOUNDATION_EXPORT double ProcessServiceContainerVersionNumber; 12 | 13 | //! Project version string for ProcessServiceContainer. 14 | FOUNDATION_EXPORT const unsigned char ProcessServiceContainerVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.120.7 clang-1500.0.34.3) 3 | // swift-module-flags: -target arm64-apple-macos11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name ProcessServiceContainer 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import ProcessServiceContainer 6 | import Swift 7 | import _Concurrency 8 | import _StringProcessing 9 | import _SwiftConcurrencyShims 10 | public struct ServiceContainer { 11 | public static let name: Swift.String 12 | public static func bootstrap() 13 | } 14 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.120.7 clang-1500.0.34.3) 3 | // swift-module-flags: -target x86_64-apple-macos11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name ProcessServiceContainer 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import ProcessServiceContainer 6 | import Swift 7 | import _Concurrency 8 | import _StringProcessing 9 | import _SwiftConcurrencyShims 10 | public struct ServiceContainer { 11 | public static let name: Swift.String 12 | public static func bootstrap() 13 | } 14 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.private.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.120.7 clang-1500.0.34.3) 3 | // swift-module-flags: -target arm64-apple-macos11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name ProcessServiceContainer 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import ProcessServiceContainer 6 | import Swift 7 | import _Concurrency 8 | import _StringProcessing 9 | import _SwiftConcurrencyShims 10 | public struct ServiceContainer { 11 | public static let name: Swift.String 12 | public static func bootstrap() 13 | } 14 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.private.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.120.7 clang-1500.0.34.3) 3 | // swift-module-flags: -target x86_64-apple-macos11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name ProcessServiceContainer 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | @_exported import ProcessServiceContainer 6 | import Swift 7 | import _Concurrency 8 | import _StringProcessing 9 | import _SwiftConcurrencyShims 10 | public struct ServiceContainer { 11 | public static let name: Swift.String 12 | public static func bootstrap() 13 | } 14 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | LibraryIdentifier 9 | macos-arm64_x86_64 10 | LibraryPath 11 | ProcessServiceContainer.framework 12 | SupportedArchitectures 13 | 14 | arm64 15 | x86_64 16 | 17 | SupportedPlatform 18 | macos 19 | 20 | 21 | CFBundlePackageType 22 | XFWK 23 | XCFrameworkFormatVersion 24 | 1.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /Sources/ProcessServiceClient/NSXPCConnection+ProcessService.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | import ProcessServiceShared 4 | 5 | extension NSXPCConnection { 6 | public static func processServiceConnection(named name: String) -> NSXPCConnection { 7 | let connection = NSXPCConnection(serviceName: name) 8 | 9 | connection.remoteObjectInterface = NSXPCInterface(with: ProcessServiceXPCProtocol.self) 10 | 11 | connection.exportedInterface = NSXPCInterface(with: ProcessServiceClientXPCProtocol.self) 12 | connection.exportedObject = ExportedProcessServiceClient() 13 | 14 | #if compiler(>=5.7.1) 15 | // this API is available in 11.0, but only exposed in the headers for 13.0 16 | connection.activate() 17 | #else 18 | connection.resume() 19 | #endif 20 | 21 | return connection 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "AsyncXPCConnection", 6 | "repositoryURL": "https://github.com/ChimeHQ/AsyncXPCConnection", 7 | "state": { 8 | "branch": null, 9 | "revision": "82a0eb00a0d881e6a65cad0acc031c1efd058d06", 10 | "version": null 11 | } 12 | }, 13 | { 14 | "package": "ProcessEnv", 15 | "repositoryURL": "https://github.com/ChimeHQ/ProcessEnv", 16 | "state": { 17 | "branch": null, 18 | "revision": "29487b6581bb785c372c611c943541ef4309d051", 19 | "version": "0.3.1" 20 | } 21 | }, 22 | { 23 | "package": "Queue", 24 | "repositoryURL": "https://github.com/mattmassicotte/Queue", 25 | "state": { 26 | "branch": null, 27 | "revision": "8d6f936097888f97011610ced40313655dc5948d", 28 | "version": "0.1.4" 29 | } 30 | } 31 | ] 32 | }, 33 | "version": 1 34 | } 35 | -------------------------------------------------------------------------------- /Sources/ProcessServiceShared/ProcessServiceXPCProtocols.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Combine 3 | 4 | @objc public protocol ProcessServiceXPCProtocol { 5 | func launchProcess(at url: URL, arguments: [String], environment: [String : String]?, currentDirectoryURL: URL?, reply: @Sendable @escaping (UUID?, Error?) -> Void) 6 | func terminateProcess(with identifier: UUID, reply: @Sendable @escaping (Error?) -> Void) 7 | 8 | func writeDataToStdin(_ data: Data, for identifier: UUID, reply: @Sendable @escaping (Error?) -> Void) 9 | 10 | func captureUserEnvironment(reply: @escaping ([String: String]?, Error?) -> Void) 11 | func userShellInvocation(of executionParametersData: Data, reply: @escaping (Data?, Error?) -> Void) 12 | } 13 | 14 | @objc public protocol ProcessServiceClientXPCProtocol { 15 | func launchedProcess(with identifier: UUID, stdoutData: Data) 16 | func launchedProcess(with identifier: UUID, stderrData: Data) 17 | func launchedProcess(with identifier: UUID, terminated: Int) 18 | } 19 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample/ContentView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | import ProcessServiceClient 4 | 5 | struct ContentView: View { 6 | func doTest() async { 7 | let params = Process.ExecutionParameters(path: "/bin/ls") 8 | 9 | do { 10 | let remoteProcess = HostedProcess(named: "com.yourcompany.ProcessService", parameters: params) 11 | 12 | let data = try await remoteProcess.runAndReadStdout() 13 | let value = String(data: data, encoding: .utf8) ?? "nothing" 14 | 15 | print("value: \(value)") 16 | } catch { 17 | print("error: \(error)") 18 | } 19 | } 20 | 21 | var body: some View { 22 | VStack { 23 | Image(systemName: "globe") 24 | .imageScale(.large) 25 | .foregroundColor(.accentColor) 26 | Text("Hello, world!") 27 | } 28 | .padding() 29 | .task { 30 | await doTest() 31 | } 32 | } 33 | } 34 | 35 | struct ContentView_Previews: PreviewProvider { 36 | static var previews: some View { 37 | ContentView() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "AsyncXPCConnection", 6 | "repositoryURL": "https://github.com/ChimeHQ/AsyncXPCConnection", 7 | "state": { 8 | "branch": null, 9 | "revision": "82a0eb00a0d881e6a65cad0acc031c1efd058d06", 10 | "version": null 11 | } 12 | }, 13 | { 14 | "package": "ProcessEnv", 15 | "repositoryURL": "https://github.com/ChimeHQ/ProcessEnv", 16 | "state": { 17 | "branch": null, 18 | "revision": "29487b6581bb785c372c611c943541ef4309d051", 19 | "version": "0.3.1" 20 | } 21 | }, 22 | { 23 | "package": "Queue", 24 | "repositoryURL": "https://github.com/mattmassicotte/Queue", 25 | "state": { 26 | "branch": null, 27 | "revision": "8d6f936097888f97011610ced40313655dc5948d", 28 | "version": "0.1.4" 29 | } 30 | } 31 | ] 32 | }, 33 | "version": 1 34 | } 35 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "1x", 16 | "size" : "32x32" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "2x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "1x", 26 | "size" : "128x128" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "2x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "1x", 36 | "size" : "256x256" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "2x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "1x", 46 | "size" : "512x512" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "2x", 51 | "size" : "512x512" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, Chime 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 23A5286i 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | ProcessServiceContainer 11 | CFBundleIdentifier 12 | com.chimehq.ProcessServiceContainer 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ProcessServiceContainer 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 14.0 35 | DTSDKBuild 36 | 23A5286f 37 | DTSDKName 38 | macosx14.0 39 | DTXcode 40 | 1500 41 | DTXcodeBuild 42 | 15A5195m 43 | LSMinimumSystemVersion 44 | 11.0 45 | NSHumanReadableCopyright 46 | Copyright © 2023 Chime Systems Inc. All rights reserved. 47 | 48 | 49 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.5 2 | 3 | import PackageDescription 4 | 5 | let settings: [SwiftSetting] = [ 6 | .unsafeFlags(["-Xfrontend", "-strict-concurrency=complete"]) 7 | ] 8 | 9 | let package = Package( 10 | name: "ProcessService", 11 | platforms: [.macOS(.v11)], 12 | products: [ 13 | .library(name: "ProcessServiceServer", targets: ["ProcessServiceServer"]), 14 | .library(name: "ProcessServiceClient", targets: ["ProcessServiceClient"]), 15 | .library(name: "ProcessServiceContainer", targets: ["ProcessServiceContainer"]), 16 | ], 17 | dependencies: [ 18 | .package(url: "https://github.com/ChimeHQ/ProcessEnv", from: "0.3.1"), 19 | .package(url: "https://github.com/mattmassicotte/Queue", from: "0.1.3"), 20 | .package(url: "https://github.com/ChimeHQ/AsyncXPCConnection", revision: "82a0eb00a0d881e6a65cad0acc031c1efd058d06"), 21 | ], 22 | targets: [ 23 | .target(name: "ProcessServiceShared"), 24 | .target( 25 | name: "ProcessServiceServer", 26 | dependencies: ["ProcessServiceShared", "ProcessEnv"], 27 | swiftSettings: settings 28 | ), 29 | .target( 30 | name: "ProcessServiceClient", 31 | dependencies: ["AsyncXPCConnection", "ProcessServiceShared", "ProcessEnv", "Queue"], 32 | swiftSettings: settings 33 | ), 34 | .binaryTarget( 35 | name: "ProcessServiceContainer", 36 | path: "ProcessServiceContainer.xcframework" 37 | ), 38 | 39 | .testTarget( 40 | name: "ProcessServiceClientTests", 41 | dependencies: ["ProcessServiceClient", "ProcessServiceContainer"], 42 | swiftSettings: settings 43 | ), 44 | .testTarget( 45 | name: "ProcessServiceServerTests", 46 | dependencies: ["ProcessServiceServer"], 47 | swiftSettings: settings), 48 | ] 49 | ) 50 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/XPCServices/ProcessService.xpc/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 23A5286i 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDisplayName 10 | ProcessService 11 | CFBundleExecutable 12 | ProcessService 13 | CFBundleIdentifier 14 | com.chimehq.ProcessService 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ProcessService 19 | CFBundlePackageType 20 | XPC! 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 14.0 37 | DTSDKBuild 38 | 23A5286f 39 | DTSDKName 40 | macosx14.0 41 | DTXcode 42 | 1500 43 | DTXcodeBuild 44 | 15A5195m 45 | LSMinimumSystemVersion 46 | 11.0 47 | XPCService 48 | 49 | ServiceType 50 | Application 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Tests/ProcessServiceClientTests/HostedProcessTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | @testable import ProcessServiceClient 4 | import ProcessServiceContainer 5 | 6 | final class HostedProcessTests: XCTestCase { 7 | override func setUp() { 8 | ServiceContainer.bootstrap() 9 | } 10 | 11 | func testLaunchAndReadStdout() async throws { 12 | let params = Process.ExecutionParameters(path: "/bin/echo", arguments: ["hello"]) 13 | let process = HostedProcess(named: ServiceContainer.name, parameters: params) 14 | 15 | let data = try await process.runAndReadStdout() 16 | let value = try XCTUnwrap(String(data: data, encoding: .utf8)) 17 | 18 | XCTAssertEqual(value, "hello\n") 19 | } 20 | 21 | /// stress the io/termination synchronization 22 | /// 23 | /// There have been races here, but they are hard to trigger. have to run a lot of iterations to have some confidence in the system. 24 | func testRunStress() async throws { 25 | let params = Process.ExecutionParameters(path: "/bin/echo", arguments: ["hello"]) 26 | 27 | for _ in 0..<1000 { 28 | let process = HostedProcess(named: ServiceContainer.name, parameters: params) 29 | 30 | let data = try await process.runAndReadStdout() 31 | let value = try XCTUnwrap(String(data: data, encoding: .utf8)) 32 | 33 | XCTAssertEqual(value, "hello\n") 34 | } 35 | } 36 | 37 | func testWriting() async throws { 38 | let params = Process.ExecutionParameters(path: "/usr/bin/tee", arguments: ["/dev/null"]) 39 | let process = HostedProcess(named: ServiceContainer.name, parameters: params) 40 | 41 | try await process.launch() 42 | 43 | var iterator = await process.eventSequence.makeAsyncIterator() 44 | 45 | try await process.write(Data("hello\n".utf8)) 46 | 47 | let first = await iterator.next() 48 | 49 | XCTAssertEqual(first, .stdout(Data("hello\n".utf8))) 50 | 51 | try await process.write(Data("goodbye\n".utf8)) 52 | 53 | let second = await iterator.next() 54 | 55 | XCTAssertEqual(second, .stdout(Data("goodbye\n".utf8))) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Sources/ProcessServiceClient/ExportedProcessServiceClient.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Combine 3 | 4 | import ProcessServiceShared 5 | import Queue 6 | 7 | public actor ExportedProcessServiceClient { 8 | public typealias EventSequence = AsyncStream 9 | private typealias SequencePair = (stream: EventSequence, continuation: EventSequence.Continuation) 10 | 11 | private var processEventPairs = [UUID: SequencePair]() 12 | private let queue = AsyncQueue() 13 | 14 | public init() { 15 | } 16 | 17 | private func processEventPair(for identifier: UUID) -> SequencePair { 18 | if let pair = processEventPairs[identifier] { 19 | return pair 20 | } 21 | 22 | let pair = EventSequence.makeStream() 23 | 24 | processEventPairs[identifier] = pair 25 | 26 | return pair 27 | } 28 | 29 | private func removePair(for identifier: UUID) { 30 | precondition(processEventPairs[identifier] != nil) 31 | 32 | processEventPairs[identifier]?.continuation.finish() 33 | self.processEventPairs[identifier] = nil 34 | } 35 | 36 | public func processEventSequence(for identifier: UUID) -> EventSequence { 37 | return processEventPair(for: identifier).stream 38 | } 39 | } 40 | 41 | extension ExportedProcessServiceClient: ProcessServiceClientXPCProtocol { 42 | public nonisolated func launchedProcess(with identifier: UUID, stdoutData: Data) { 43 | queue.addOperation { 44 | let pair = await self.processEventPair(for: identifier) 45 | 46 | pair.continuation.yield(.stdout(stdoutData)) 47 | } 48 | } 49 | 50 | public nonisolated func launchedProcess(with identifier: UUID, stderrData: Data) { 51 | queue.addOperation { 52 | let pair = await self.processEventPair(for: identifier) 53 | 54 | pair.continuation.yield(.stderr(stderrData)) 55 | } 56 | } 57 | 58 | public nonisolated func launchedProcess(with identifier: UUID, terminated: Int) { 59 | let reason = Process.TerminationReason(rawValue: terminated) ?? .exit 60 | 61 | queue.addOperation { 62 | let pair = await self.processEventPair(for: identifier) 63 | 64 | pair.continuation.yield(.terminated(reason)) 65 | 66 | await self.removePair(for: identifier) 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample.xcodeproj/xcshareddata/xcschemes/ProcessServiceContainer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/XPCServices/ProcessService.xpc/Contents/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | files2 8 | 9 | rules 10 | 11 | ^Resources/ 12 | 13 | ^Resources/.*\.lproj/ 14 | 15 | optional 16 | 17 | weight 18 | 1000 19 | 20 | ^Resources/.*\.lproj/locversion.plist$ 21 | 22 | omit 23 | 24 | weight 25 | 1100 26 | 27 | ^Resources/Base\.lproj/ 28 | 29 | weight 30 | 1010 31 | 32 | ^version.plist$ 33 | 34 | 35 | rules2 36 | 37 | .*\.dSYM($|/) 38 | 39 | weight 40 | 11 41 | 42 | ^(.*/)?\.DS_Store$ 43 | 44 | omit 45 | 46 | weight 47 | 2000 48 | 49 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 50 | 51 | nested 52 | 53 | weight 54 | 10 55 | 56 | ^.* 57 | 58 | ^Info\.plist$ 59 | 60 | omit 61 | 62 | weight 63 | 20 64 | 65 | ^PkgInfo$ 66 | 67 | omit 68 | 69 | weight 70 | 20 71 | 72 | ^Resources/ 73 | 74 | weight 75 | 20 76 | 77 | ^Resources/.*\.lproj/ 78 | 79 | optional 80 | 81 | weight 82 | 1000 83 | 84 | ^Resources/.*\.lproj/locversion.plist$ 85 | 86 | omit 87 | 88 | weight 89 | 1100 90 | 91 | ^Resources/Base\.lproj/ 92 | 93 | weight 94 | 1010 95 | 96 | ^[^/]+$ 97 | 98 | nested 99 | 100 | weight 101 | 10 102 | 103 | ^embedded\.provisionprofile$ 104 | 105 | weight 106 | 20 107 | 108 | ^version\.plist$ 109 | 110 | weight 111 | 20 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status][build status badge]][build status] 2 | [![License][license badge]][license] 3 | [![Platforms][platforms badge]][platforms] 4 | [![Documentation][documentation badge]][documentation] 5 | 6 | # ProcessService 7 | System to host an executable within an XPC service. 8 | 9 | ## Integration 10 | 11 | ### Swift Package Manager 12 | 13 | ```swift 14 | dependencies: [ 15 | .package(url: "https://github.com/ChimeHQ/ProcessService", branch: "main") 16 | ] 17 | ``` 18 | 19 | ### XPC Service 20 | 21 | To be useful, you also need an actual XPC service that hosts the process server. Distributing an XPC service using SPM requires a workaround: bundling a pre-built binary in an xcframework. This comes with two disadvantages. It requires that you both link and embed the framework, which incurs size and potential launch-time impact. And, second, it requires a bootstrapping step to ensure the service can be found at runtime anywhere within the running process. 22 | 23 | This is all **optional** and provided for convenience. You can just build your own service if you want. 24 | 25 | ```swift 26 | import ProcessServiceContainer 27 | 28 | ServiceContainer.bootstrap() 29 | 30 | let userEnv = try await HostedProcess.userEnvironment(with: ServiceContainer.name) 31 | ``` 32 | 33 | ## Usage 34 | 35 | To interact with the service: 36 | 37 | ```swift 38 | import ProcessServiceClient 39 | 40 | let userEnv = try await HostedProcess.userEnvironment(with: "com.myxpcservice") 41 | 42 | let process = HostedProcess(named: "com.myxpcservice", parameters: params) 43 | let data = try await process.runAndReadStdout() 44 | ``` 45 | 46 | Here's now to make an XPC service. Make sure to match up the service bundle id with the name you use. 47 | 48 | ```swift 49 | // main.swift 50 | 51 | import Foundation 52 | 53 | final class ServiceDelegate: NSObject, NSXPCListenerDelegate { 54 | func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool { 55 | do { 56 | try newConnection.configureProcessServiceServer() 57 | } catch { 58 | return false 59 | } 60 | 61 | newConnection.activate() 62 | 63 | return true 64 | } 65 | } 66 | 67 | let delegate = ServiceDelegate() 68 | let listener = NSXPCListener.service() 69 | 70 | listener.delegate = delegate 71 | listener.resume() 72 | ``` 73 | 74 | ## Suggestions or Feedback 75 | 76 | We'd love to hear from you! Get in touch via an issue or pull request. 77 | 78 | Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. 79 | 80 | [build status]: https://github.com/ChimeHQ/ProcessService/actions 81 | [build status badge]: https://github.com/ChimeHQ/ProcessService/workflows/CI/badge.svg 82 | [license]: https://opensource.org/licenses/BSD-3-Clause 83 | [license badge]: https://img.shields.io/github/license/ChimeHQ/ProcessService 84 | [platforms]: https://swiftpackageindex.com/ChimeHQ/ProcessService 85 | [platforms badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FChimeHQ%2FProcessService%2Fbadge%3Ftype%3Dplatforms 86 | [documentation]: https://swiftpackageindex.com/ChimeHQ/ProcessService/main/documentation 87 | [documentation badge]: https://img.shields.io/badge/Documentation-DocC-blue 88 | 89 | -------------------------------------------------------------------------------- /Tests/ProcessServiceServerTests/ExportedProcessServiceTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | import ProcessServiceShared 4 | @testable import ProcessServiceServer 5 | 6 | #if compiler(>=5.9) 7 | final class MockClient: ProcessServiceClientXPCProtocol { 8 | typealias EventSequence = AsyncStream<(UUID, Process.Event)> 9 | 10 | let eventSequence: EventSequence 11 | private let continuation: EventSequence.Continuation 12 | 13 | public init() { 14 | (self.eventSequence, self.continuation) = EventSequence.makeStream() 15 | } 16 | 17 | public func launchedProcess(with identifier: UUID, stdoutData: Data) { 18 | continuation.yield((identifier, .stdout(stdoutData))) 19 | } 20 | 21 | public func launchedProcess(with identifier: UUID, stderrData: Data) { 22 | continuation.yield((identifier, .stderr(stderrData))) 23 | } 24 | 25 | public func launchedProcess(with identifier: UUID, terminated: Int) { 26 | let event = Process.Event.terminated(Process.TerminationReason(rawValue: terminated)!) 27 | 28 | continuation.yield((identifier, event)) 29 | } 30 | } 31 | 32 | final class ExportedProcessServiceTests: XCTestCase { 33 | typealias EventStream = AsyncStream<(UUID, Process.Event)> 34 | 35 | func testCaptureEnviroment() async throws { 36 | let client = MockClient() 37 | let service = ExportedProcessService(client: client) 38 | 39 | let value = try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<[String: String], Error>) in 40 | service.captureUserEnvironment(reply: { env, error in 41 | if let error = error { 42 | continuation.resume(throwing: error) 43 | return 44 | } 45 | 46 | continuation.resume(returning: env!) 47 | }) 48 | } 49 | 50 | // just a simple check to ensure we got something from the environment 51 | XCTAssertNotNil(value["USER"]) 52 | } 53 | 54 | func testLaunchProcess() async throws { 55 | let client = MockClient() 56 | let service = ExportedProcessService(client: client) 57 | 58 | self.continueAfterFailure = false 59 | 60 | var events = client.eventSequence.map({ $0.1 }).makeAsyncIterator() 61 | 62 | _ = try await service.launchProcess(with: .init(path: "/bin/echo", arguments: ["-n", "hello"])) 63 | 64 | let stdoutEvent = await events.next() 65 | 66 | XCTAssertEqual(stdoutEvent, Process.Event.stdout("hello".data(using: .utf8)!)) 67 | 68 | let terminateEvent = await events.next() 69 | 70 | XCTAssertEqual(terminateEvent, Process.Event.terminated(.exit)) 71 | } 72 | 73 | func testTerminationReadingRace() async throws { 74 | let client = MockClient() 75 | let service = ExportedProcessService(client: client) 76 | let params = Process.ExecutionParameters(path: "/bin/echo", arguments: ["-n", "hello"]) 77 | 78 | self.continueAfterFailure = false 79 | 80 | var events = client.eventSequence.map({ $0.1 }).makeAsyncIterator() 81 | 82 | for _ in 0..<30000 { 83 | // print("iteration start \(i)") 84 | 85 | _ = try await service.launchProcess(with: params) 86 | 87 | let stdoutEvent = await events.next() 88 | 89 | XCTAssertEqual(stdoutEvent, Process.Event.stdout("hello".data(using: .utf8)!)) 90 | 91 | let terminateEvent = await events.next() 92 | 93 | XCTAssertEqual(terminateEvent, Process.Event.terminated(.exit)) 94 | 95 | // print("iteration end") 96 | } 97 | } 98 | } 99 | #endif 100 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "children": [ 7 | { 8 | "kind": "TypeDecl", 9 | "name": "ServiceContainer", 10 | "printedName": "ServiceContainer", 11 | "children": [ 12 | { 13 | "kind": "Var", 14 | "name": "name", 15 | "printedName": "name", 16 | "children": [ 17 | { 18 | "kind": "TypeNominal", 19 | "name": "String", 20 | "printedName": "Swift.String", 21 | "usr": "s:SS" 22 | } 23 | ], 24 | "declKind": "Var", 25 | "usr": "s:23ProcessServiceContainer0bC0V4nameSSvpZ", 26 | "mangledName": "$s23ProcessServiceContainer0bC0V4nameSSvpZ", 27 | "moduleName": "ProcessServiceContainer", 28 | "static": true, 29 | "declAttributes": [ 30 | "HasInitialValue", 31 | "HasStorage", 32 | "AccessControl", 33 | "RawDocComment" 34 | ], 35 | "isLet": true, 36 | "hasStorage": true, 37 | "accessors": [ 38 | { 39 | "kind": "Accessor", 40 | "name": "Get", 41 | "printedName": "Get()", 42 | "children": [ 43 | { 44 | "kind": "TypeNominal", 45 | "name": "String", 46 | "printedName": "Swift.String", 47 | "usr": "s:SS" 48 | } 49 | ], 50 | "declKind": "Accessor", 51 | "usr": "s:23ProcessServiceContainer0bC0V4nameSSvgZ", 52 | "mangledName": "$s23ProcessServiceContainer0bC0V4nameSSvgZ", 53 | "moduleName": "ProcessServiceContainer", 54 | "static": true, 55 | "implicit": true, 56 | "accessorKind": "get" 57 | } 58 | ] 59 | }, 60 | { 61 | "kind": "Function", 62 | "name": "bootstrap", 63 | "printedName": "bootstrap()", 64 | "children": [ 65 | { 66 | "kind": "TypeNominal", 67 | "name": "Void", 68 | "printedName": "()" 69 | } 70 | ], 71 | "declKind": "Func", 72 | "usr": "s:23ProcessServiceContainer0bC0V9bootstrapyyFZ", 73 | "mangledName": "$s23ProcessServiceContainer0bC0V9bootstrapyyFZ", 74 | "moduleName": "ProcessServiceContainer", 75 | "static": true, 76 | "declAttributes": [ 77 | "AccessControl", 78 | "RawDocComment" 79 | ], 80 | "funcSelfKind": "NonMutating" 81 | } 82 | ], 83 | "declKind": "Struct", 84 | "usr": "s:23ProcessServiceContainer0bC0V", 85 | "mangledName": "$s23ProcessServiceContainer0bC0V", 86 | "moduleName": "ProcessServiceContainer", 87 | "declAttributes": [ 88 | "AccessControl" 89 | ] 90 | } 91 | ], 92 | "json_format_version": 8 93 | }, 94 | "ConstValues": [ 95 | { 96 | "filePath": "\/Users\/matt\/Chime\/Code\/ProcessService\/Xcode Project\/ProcessServiceContainer\/Bootstrap.swift", 97 | "kind": "StringLiteral", 98 | "offset": 101, 99 | "length": 28, 100 | "value": "\"com.chimehq.ProcessService\"" 101 | } 102 | ] 103 | } -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.abi.json: -------------------------------------------------------------------------------- 1 | { 2 | "ABIRoot": { 3 | "kind": "Root", 4 | "name": "TopLevel", 5 | "printedName": "TopLevel", 6 | "children": [ 7 | { 8 | "kind": "TypeDecl", 9 | "name": "ServiceContainer", 10 | "printedName": "ServiceContainer", 11 | "children": [ 12 | { 13 | "kind": "Var", 14 | "name": "name", 15 | "printedName": "name", 16 | "children": [ 17 | { 18 | "kind": "TypeNominal", 19 | "name": "String", 20 | "printedName": "Swift.String", 21 | "usr": "s:SS" 22 | } 23 | ], 24 | "declKind": "Var", 25 | "usr": "s:23ProcessServiceContainer0bC0V4nameSSvpZ", 26 | "mangledName": "$s23ProcessServiceContainer0bC0V4nameSSvpZ", 27 | "moduleName": "ProcessServiceContainer", 28 | "static": true, 29 | "declAttributes": [ 30 | "HasInitialValue", 31 | "HasStorage", 32 | "AccessControl", 33 | "RawDocComment" 34 | ], 35 | "isLet": true, 36 | "hasStorage": true, 37 | "accessors": [ 38 | { 39 | "kind": "Accessor", 40 | "name": "Get", 41 | "printedName": "Get()", 42 | "children": [ 43 | { 44 | "kind": "TypeNominal", 45 | "name": "String", 46 | "printedName": "Swift.String", 47 | "usr": "s:SS" 48 | } 49 | ], 50 | "declKind": "Accessor", 51 | "usr": "s:23ProcessServiceContainer0bC0V4nameSSvgZ", 52 | "mangledName": "$s23ProcessServiceContainer0bC0V4nameSSvgZ", 53 | "moduleName": "ProcessServiceContainer", 54 | "static": true, 55 | "implicit": true, 56 | "accessorKind": "get" 57 | } 58 | ] 59 | }, 60 | { 61 | "kind": "Function", 62 | "name": "bootstrap", 63 | "printedName": "bootstrap()", 64 | "children": [ 65 | { 66 | "kind": "TypeNominal", 67 | "name": "Void", 68 | "printedName": "()" 69 | } 70 | ], 71 | "declKind": "Func", 72 | "usr": "s:23ProcessServiceContainer0bC0V9bootstrapyyFZ", 73 | "mangledName": "$s23ProcessServiceContainer0bC0V9bootstrapyyFZ", 74 | "moduleName": "ProcessServiceContainer", 75 | "static": true, 76 | "declAttributes": [ 77 | "AccessControl", 78 | "RawDocComment" 79 | ], 80 | "funcSelfKind": "NonMutating" 81 | } 82 | ], 83 | "declKind": "Struct", 84 | "usr": "s:23ProcessServiceContainer0bC0V", 85 | "mangledName": "$s23ProcessServiceContainer0bC0V", 86 | "moduleName": "ProcessServiceContainer", 87 | "declAttributes": [ 88 | "AccessControl" 89 | ] 90 | } 91 | ], 92 | "json_format_version": 8 93 | }, 94 | "ConstValues": [ 95 | { 96 | "filePath": "\/Users\/matt\/Chime\/Code\/ProcessService\/Xcode Project\/ProcessServiceContainer\/Bootstrap.swift", 97 | "kind": "StringLiteral", 98 | "offset": 101, 99 | "length": 28, 100 | "value": "\"com.chimehq.ProcessService\"" 101 | } 102 | ] 103 | } -------------------------------------------------------------------------------- /Sources/ProcessServiceClient/HostedProcess.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Combine 3 | 4 | import AsyncXPCConnection 5 | import ProcessEnv 6 | import ProcessServiceShared 7 | 8 | enum UnrestrictedProcessError: Error { 9 | case alreadyLaunched(UUID) 10 | case notRunning 11 | case connectionInvalid 12 | } 13 | 14 | /// An interface to a remote ExportedProcessService instance 15 | /// 16 | /// You can use this class to start and control a remote `ExportedProcessService`. 17 | public actor HostedProcess { 18 | public typealias EventSequence = AsyncStream 19 | 20 | private let connection: NSXPCConnection 21 | let parameters: Process.ExecutionParameters 22 | private var state: (UUID, Task)? = nil 23 | 24 | public let eventSequence: EventSequence 25 | private let eventContinuation: EventSequence.Continuation 26 | 27 | public init(named name: String, parameters: Process.ExecutionParameters) { 28 | self.connection = NSXPCConnection.processServiceConnection(named: name) 29 | self.parameters = parameters 30 | 31 | (self.eventSequence, self.eventContinuation) = EventSequence.makeStream() 32 | } 33 | 34 | deinit { 35 | connection.invalidate() 36 | eventContinuation.finish() 37 | 38 | if let (_, task) = state { 39 | task.cancel() 40 | } 41 | } 42 | 43 | public func launch() async throws { 44 | if let uuid = self.state?.0 { 45 | throw UnrestrictedProcessError.alreadyLaunched(uuid) 46 | } 47 | 48 | let uuid = try await connection.withValueErrorCompletion { (service: ProcessServiceXPCProtocol, handler) in 49 | return service.launchProcess(at: URL(fileURLWithPath: parameters.path), 50 | arguments: parameters.arguments, 51 | environment: parameters.environment, 52 | currentDirectoryURL: parameters.currentDirectoryURL, 53 | reply: handler) 54 | } 55 | 56 | guard let client = connection.exportedObject as? ExportedProcessServiceClient else { 57 | throw UnrestrictedProcessError.connectionInvalid 58 | } 59 | 60 | let sequence = await client.processEventSequence(for: uuid) 61 | 62 | let task = Task { [eventContinuation] in 63 | for await event in sequence { 64 | eventContinuation.yield(event) 65 | 66 | if case .terminated = event { 67 | eventContinuation.finish() 68 | break 69 | } 70 | } 71 | } 72 | 73 | self.state = (uuid, task) 74 | } 75 | 76 | public func terminate() async throws { 77 | guard let state = self.state else { 78 | throw UnrestrictedProcessError.notRunning 79 | } 80 | 81 | state.1.cancel() 82 | 83 | try await connection.withErrorCompletion { (service: ProcessServiceXPCProtocol, handler) in 84 | service.terminateProcess(with: state.0, reply: handler) 85 | } 86 | } 87 | 88 | public func write(_ data: Data) async throws { 89 | guard let uuid = self.state?.0 else { 90 | throw UnrestrictedProcessError.notRunning 91 | } 92 | 93 | try await connection.withErrorCompletion { (service: ProcessServiceXPCProtocol, handler) in 94 | service.writeDataToStdin(data, for: uuid, reply: handler) 95 | } 96 | } 97 | 98 | public nonisolated func runAndReadStdout() async throws -> Data { 99 | try await launch() 100 | 101 | let sequence = eventSequence 102 | 103 | return await sequence.reduce(Data(), { partialData, event in 104 | switch event { 105 | case .stdout(let newData): 106 | return partialData + newData 107 | case .stderr, .terminated: 108 | return partialData 109 | } 110 | }) 111 | } 112 | 113 | /// The process ID (PID) of the XPC service itself (not its hosted executable) 114 | public var serviceProcessID: Int { 115 | Int(connection.processIdentifier) 116 | } 117 | } 118 | 119 | extension HostedProcess { 120 | /// Capture the interactive-login shell environment. 121 | /// 122 | /// This function makes use of the `userEnvironment` function 123 | /// in `ProcessEnv`. 124 | public static func userEnvironment(with serviceName: String) async throws -> [String : String] { 125 | let connection = NSXPCConnection.processServiceConnection(named: serviceName) 126 | 127 | return try await connection.withValueErrorCompletion { (service: ProcessServiceXPCProtocol, handler) in 128 | service.captureUserEnvironment(reply: handler) 129 | } 130 | } 131 | 132 | /// Returns parameters that emulate an invocation in the user's shell. 133 | /// 134 | /// See `ProcessEnv` documentation for details. 135 | public static func userShellInvocation(of params: Process.ExecutionParameters, 136 | with serviceName: String) async throws -> Process.ExecutionParameters { 137 | let paramsData = try JSONEncoder().encode(params) 138 | let connection = NSXPCConnection.processServiceConnection(named: serviceName) 139 | 140 | return try await connection.withDecodingCompletion { (service: ProcessServiceXPCProtocol, handler) in 141 | service.userShellInvocation(of: paramsData, reply: handler) 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our 7 | community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, caste, color, religion, or sexual 11 | identity and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the overall 27 | community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or advances of 32 | any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email address, 36 | without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Community leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Community leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official e-mail address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the community leaders responsible for enforcement at 64 | support@chimehq.com. 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 2.1, available at 120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 121 | 122 | Community Impact Guidelines were inspired by 123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 127 | [https://www.contributor-covenant.org/translations][translations]. 128 | 129 | [homepage]: https://www.contributor-covenant.org 130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 131 | [Mozilla CoC]: https://github.com/mozilla/diversity 132 | [FAQ]: https://www.contributor-covenant.org/faq 133 | [translations]: https://www.contributor-covenant.org/translations 134 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | RZnZ6ct3Dhjj8RKmYd6ifiJeQzo= 10 | 11 | 12 | files2 13 | 14 | Headers/ProcessServiceContainer-Swift.h 15 | 16 | hash2 17 | 18 | T8SZSfy4kYg3ZCvyPrCzGXh75Sh7PWahsEsHIGXew5E= 19 | 20 | 21 | Headers/ProcessServiceContainer.h 22 | 23 | hash2 24 | 25 | lc5i70j8zJmrKx6rquySBt4Q8UFxv4sr8NGZhFNVebQ= 26 | 27 | 28 | Modules/ProcessServiceContainer.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo 29 | 30 | hash2 31 | 32 | WzhMvmsHal3SXfuHhcJAp6ulXCRu1DJYo6G1EtOpPWk= 33 | 34 | 35 | Modules/ProcessServiceContainer.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo 36 | 37 | hash2 38 | 39 | XPkBD2P82Uss9wH1aFpuror6xnwsF7urLoEyW1H1EZY= 40 | 41 | 42 | Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.abi.json 43 | 44 | hash2 45 | 46 | nn/YNpN572j458axzwlfAhP54PA15SuVLL5xIzZ7IHc= 47 | 48 | 49 | Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.private.swiftinterface 50 | 51 | hash2 52 | 53 | HIsE/594N6HTlHdAseqobCC1HuzViyJD8QokCqGG8Wc= 54 | 55 | 56 | Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.swiftdoc 57 | 58 | hash2 59 | 60 | m8YsEp4Ghl31bf7LzAvYitjo56gF4meLxpGh4YJlVbQ= 61 | 62 | 63 | Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.swiftinterface 64 | 65 | hash2 66 | 67 | HIsE/594N6HTlHdAseqobCC1HuzViyJD8QokCqGG8Wc= 68 | 69 | 70 | Modules/ProcessServiceContainer.swiftmodule/arm64-apple-macos.swiftmodule 71 | 72 | hash2 73 | 74 | fTWsvNyxlsACU9JEs5Pcu8dtbT96p0HOGbbwRY/KR0c= 75 | 76 | 77 | Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.abi.json 78 | 79 | hash2 80 | 81 | nn/YNpN572j458axzwlfAhP54PA15SuVLL5xIzZ7IHc= 82 | 83 | 84 | Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.private.swiftinterface 85 | 86 | hash2 87 | 88 | LNJvVG4T1GMg3MIs1eAqfyXfsedUP0oPq2W1QG7kokQ= 89 | 90 | 91 | Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.swiftdoc 92 | 93 | hash2 94 | 95 | ZmPeALw4lQNrPiFdVrwSebcpHiX5/grHe1AMUgsoYPg= 96 | 97 | 98 | Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.swiftinterface 99 | 100 | hash2 101 | 102 | LNJvVG4T1GMg3MIs1eAqfyXfsedUP0oPq2W1QG7kokQ= 103 | 104 | 105 | Modules/ProcessServiceContainer.swiftmodule/x86_64-apple-macos.swiftmodule 106 | 107 | hash2 108 | 109 | LW9hJYQ3xNoQyOpoTf6yhPmd/qYA+4UgjdO50Cm4o3Y= 110 | 111 | 112 | Modules/module.modulemap 113 | 114 | hash2 115 | 116 | hkmZUBnCHkWcSciUJEXeeva9WB27l3T4qtE+ALMYSjE= 117 | 118 | 119 | Resources/Info.plist 120 | 121 | hash2 122 | 123 | 1t+jynQseWYIwPz2cicqxbS4+UsRtceEzFeSi0PNlIM= 124 | 125 | 126 | XPCServices/ProcessService.xpc 127 | 128 | cdhash 129 | 130 | TCKzFtWLIZbWe7gw0UZx6ot6KDY= 131 | 132 | requirement 133 | cdhash H"4c22b316d58b2196d67bb830d14671ea8b7a2836" or cdhash H"8ba0698fe3add4fbc540c50ee89e12a513ee478d" 134 | 135 | 136 | rules 137 | 138 | ^Resources/ 139 | 140 | ^Resources/.*\.lproj/ 141 | 142 | optional 143 | 144 | weight 145 | 1000 146 | 147 | ^Resources/.*\.lproj/locversion.plist$ 148 | 149 | omit 150 | 151 | weight 152 | 1100 153 | 154 | ^Resources/Base\.lproj/ 155 | 156 | weight 157 | 1010 158 | 159 | ^version.plist$ 160 | 161 | 162 | rules2 163 | 164 | .*\.dSYM($|/) 165 | 166 | weight 167 | 11 168 | 169 | ^(.*/)?\.DS_Store$ 170 | 171 | omit 172 | 173 | weight 174 | 2000 175 | 176 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 177 | 178 | nested 179 | 180 | weight 181 | 10 182 | 183 | ^.* 184 | 185 | ^Info\.plist$ 186 | 187 | omit 188 | 189 | weight 190 | 20 191 | 192 | ^PkgInfo$ 193 | 194 | omit 195 | 196 | weight 197 | 20 198 | 199 | ^Resources/ 200 | 201 | weight 202 | 20 203 | 204 | ^Resources/.*\.lproj/ 205 | 206 | optional 207 | 208 | weight 209 | 1000 210 | 211 | ^Resources/.*\.lproj/locversion.plist$ 212 | 213 | omit 214 | 215 | weight 216 | 1100 217 | 218 | ^Resources/Base\.lproj/ 219 | 220 | weight 221 | 1010 222 | 223 | ^[^/]+$ 224 | 225 | nested 226 | 227 | weight 228 | 10 229 | 230 | ^embedded\.provisionprofile$ 231 | 232 | weight 233 | 20 234 | 235 | ^version\.plist$ 236 | 237 | weight 238 | 20 239 | 240 | 241 | 242 | 243 | -------------------------------------------------------------------------------- /Sources/ProcessServiceServer/ExportedProcessService.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | import ProcessEnv 4 | import ProcessServiceShared 5 | 6 | enum ProcessServiceError: Error { 7 | case unknownIdentifier(UUID) 8 | } 9 | 10 | extension Process { 11 | struct StdioPipeSet: Hashable, Sendable { 12 | let stdin: Pipe 13 | let stdout: Pipe 14 | let stderr: Pipe 15 | 16 | init(stdin: Pipe, stdout: Pipe, stderr: Pipe) { 17 | self.stdin = stdin 18 | self.stdout = stdout 19 | self.stderr = stderr 20 | } 21 | 22 | init() { 23 | self.init(stdin: Pipe(), stdout: Pipe(), stderr: Pipe()) 24 | } 25 | } 26 | 27 | var stdioPipeSet: StdioPipeSet? { 28 | get { 29 | guard 30 | let inPipe = standardInput as? Pipe, 31 | let outPipe = standardOutput as? Pipe, 32 | let errPipe = standardError as? Pipe 33 | else { 34 | return nil 35 | } 36 | 37 | return StdioPipeSet(stdin: inPipe, stdout: outPipe, stderr: errPipe) 38 | } 39 | set { 40 | standardInput = newValue?.stdin 41 | standardOutput = newValue?.stdout 42 | standardError = newValue?.stderr 43 | } 44 | } 45 | } 46 | 47 | final class ExportedProcessService: @unchecked Sendable { 48 | private var processes: [UUID: Process] = [:] 49 | private let client: ProcessServiceClientXPCProtocol 50 | private let queue = DispatchQueue(label: "com.chimehq.ProcessService.ExportedProcessService") 51 | 52 | public init(client: ProcessServiceClientXPCProtocol) { 53 | self.client = client 54 | } 55 | 56 | private func handleProcessTermination(with uuid: UUID, process: Process) { 57 | let pipeSet = process.stdioPipeSet 58 | let reason = process.terminationReason 59 | 60 | queue.async { 61 | self.finish(with: uuid, pipeSet: pipeSet, reason: reason) 62 | } 63 | } 64 | 65 | private func finish(with uuid: UUID, pipeSet: Process.StdioPipeSet?, reason: Process.TerminationReason) { 66 | pipeSet?.stdin.fileHandleForWriting.writeabilityHandler = nil 67 | pipeSet?.stderr.fileHandleForReading.readabilityHandler = nil 68 | pipeSet?.stdout.fileHandleForReading.readabilityHandler = nil 69 | 70 | try? pipeSet?.stdin.fileHandleForWriting.close() 71 | 72 | if let data = try? pipeSet?.stdout.fileHandleForReading.readToEnd(), data.isEmpty == false { 73 | handleProcessEvent(.stdout(data), for: uuid) 74 | } 75 | 76 | try? pipeSet?.stdout.fileHandleForReading.close() 77 | 78 | if let data = try? pipeSet?.stderr.fileHandleForReading.readToEnd(), data.isEmpty == false { 79 | handleProcessEvent(.stderr(data), for: uuid) 80 | } 81 | 82 | try? pipeSet?.stderr.fileHandleForReading.close() 83 | 84 | self.processes[uuid] = nil 85 | 86 | handleProcessEvent(.terminated(reason), for: uuid) 87 | } 88 | 89 | func terminateProcess(with identifier: UUID) async throws { 90 | try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<(), Error>) in 91 | queue.async { 92 | guard let process = self.processes[identifier] else { 93 | continuation.resume(throwing: ProcessServiceError.unknownIdentifier(identifier)) 94 | 95 | return 96 | } 97 | 98 | process.terminate() 99 | 100 | continuation.resume() 101 | } 102 | } 103 | } 104 | 105 | private func writeDataToStdin(_ data: Data, for identifier: UUID) async throws { 106 | try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<(), Error>) in 107 | queue.async { 108 | let process = self.processes[identifier] 109 | 110 | guard let pipe = process?.standardInput as? Pipe else { 111 | continuation.resume(with: .failure(ProcessServiceError.unknownIdentifier(identifier))) 112 | return 113 | } 114 | 115 | do { 116 | try pipe.fileHandleForWriting.write(contentsOf: data) 117 | 118 | continuation.resume() 119 | } catch { 120 | continuation.resume(with: .failure(error)) 121 | } 122 | 123 | } 124 | } 125 | } 126 | 127 | private func handleProcessEvent(_ event: Process.Event, for uuid: UUID) { 128 | switch event { 129 | case .stdout(let data): 130 | client.launchedProcess(with: uuid, stdoutData: data) 131 | case .stderr(let data): 132 | client.launchedProcess(with: uuid, stderrData: data) 133 | case .terminated(let reason): 134 | client.launchedProcess(with: uuid, terminated: reason.rawValue) 135 | } 136 | } 137 | 138 | private func prepareProcess(with params: Process.ExecutionParameters, uuid: UUID) -> Process { 139 | let process = Process() 140 | 141 | process.parameters = params 142 | 143 | let pipeSet = Process.StdioPipeSet() 144 | 145 | process.stdioPipeSet = pipeSet 146 | 147 | process.terminationHandler = { [weak self] in 148 | self?.handleProcessTermination(with: uuid, process: $0) 149 | } 150 | 151 | pipeSet.stdout.fileHandleForReading.readabilityHandler = { [weak self] handle in 152 | guard let self = self else { 153 | handle.readabilityHandler = nil 154 | return 155 | } 156 | 157 | self.queue.sync { 158 | let data = handle.availableData 159 | if data.isEmpty { 160 | handle.readabilityHandler = nil 161 | return 162 | } 163 | 164 | self.handleProcessEvent(.stdout(data), for: uuid) 165 | } 166 | } 167 | 168 | return process 169 | } 170 | 171 | func launchProcess(with params: Process.ExecutionParameters) async throws -> UUID { 172 | return try await withCheckedThrowingContinuation({ continuation in 173 | self.queue.async { 174 | let uuid = UUID() 175 | let process = self.prepareProcess(with: params, uuid: uuid) 176 | 177 | // this must be set before we launch, so 178 | // we can deal with any data immediately 179 | self.processes[uuid] = process 180 | 181 | do { 182 | try process.run() 183 | 184 | self.processes[uuid] = process 185 | 186 | continuation.resume(returning: uuid) 187 | } catch { 188 | continuation.resume(throwing: error) 189 | } 190 | } 191 | }) 192 | } 193 | } 194 | 195 | extension ExportedProcessService: ProcessServiceXPCProtocol { 196 | nonisolated func launchProcess(at url: URL, arguments: [String], environment: [String : String]?, currentDirectoryURL: URL?, reply: @Sendable @escaping (UUID?, Error?) -> Void) { 197 | let params = Process.ExecutionParameters(path: url.path, 198 | arguments: arguments, 199 | environment: environment, 200 | currentDirectoryURL: currentDirectoryURL) 201 | Task { 202 | do { 203 | let value = try await self.launchProcess(with: params) 204 | 205 | reply(value, nil) 206 | } catch { 207 | reply(nil, error) 208 | } 209 | } 210 | } 211 | 212 | nonisolated func terminateProcess(with identifier: UUID, reply: @Sendable @escaping (Error?) -> Void) { 213 | Task { 214 | do { 215 | try await self.terminateProcess(with: identifier) 216 | 217 | reply(nil) 218 | } catch { 219 | reply(error) 220 | } 221 | } 222 | } 223 | 224 | nonisolated func writeDataToStdin(_ data: Data, for identifier: UUID, reply: @Sendable @escaping (Error?) -> Void) { 225 | Task { 226 | do { 227 | try await self.writeDataToStdin(data, for: identifier) 228 | 229 | reply(nil) 230 | } catch { 231 | reply(error) 232 | } 233 | } 234 | } 235 | 236 | nonisolated func captureUserEnvironment(reply: @escaping ([String : String]?, Error?) -> Void) { 237 | let env = ProcessInfo.processInfo.userEnvironment 238 | 239 | reply(env, nil) 240 | } 241 | 242 | nonisolated func userShellInvocation(of executionParametersData: Data, reply: @escaping (Data?, Error?) -> Void) { 243 | do { 244 | let params = try JSONDecoder().decode(Process.ExecutionParameters.self, from: executionParametersData) 245 | 246 | let userParams = params.userShellInvocation() 247 | 248 | let paramsData = try JSONEncoder().encode(userParams) 249 | 250 | reply(paramsData, nil) 251 | } catch { 252 | reply(nil, error) 253 | } 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /ProcessServiceContainer.xcframework/macos-arm64_x86_64/ProcessServiceContainer.framework/Versions/A/Headers/ProcessServiceContainer-Swift.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | #elif defined(__arm64__) && __arm64__ 3 | // Generated by Apple Swift version 5.9 (swiftlang-5.9.0.120.7 clang-1500.0.34.3) 4 | #ifndef PROCESSSERVICECONTAINER_SWIFT_H 5 | #define PROCESSSERVICECONTAINER_SWIFT_H 6 | #pragma clang diagnostic push 7 | #pragma clang diagnostic ignored "-Wgcc-compat" 8 | 9 | #if !defined(__has_include) 10 | # define __has_include(x) 0 11 | #endif 12 | #if !defined(__has_attribute) 13 | # define __has_attribute(x) 0 14 | #endif 15 | #if !defined(__has_feature) 16 | # define __has_feature(x) 0 17 | #endif 18 | #if !defined(__has_warning) 19 | # define __has_warning(x) 0 20 | #endif 21 | 22 | #if __has_include() 23 | # include 24 | #endif 25 | 26 | #pragma clang diagnostic ignored "-Wauto-import" 27 | #if defined(__OBJC__) 28 | #include 29 | #endif 30 | #if defined(__cplusplus) 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #else 39 | #include 40 | #include 41 | #include 42 | #include 43 | #endif 44 | #if defined(__cplusplus) 45 | #if defined(__arm64e__) && __has_include() 46 | # include 47 | #else 48 | #pragma clang diagnostic push 49 | #pragma clang diagnostic ignored "-Wreserved-macro-identifier" 50 | # ifndef __ptrauth_swift_value_witness_function_pointer 51 | # define __ptrauth_swift_value_witness_function_pointer(x) 52 | # endif 53 | # ifndef __ptrauth_swift_class_method_pointer 54 | # define __ptrauth_swift_class_method_pointer(x) 55 | # endif 56 | #pragma clang diagnostic pop 57 | #endif 58 | #endif 59 | 60 | #if !defined(SWIFT_TYPEDEFS) 61 | # define SWIFT_TYPEDEFS 1 62 | # if __has_include() 63 | # include 64 | # elif !defined(__cplusplus) 65 | typedef uint_least16_t char16_t; 66 | typedef uint_least32_t char32_t; 67 | # endif 68 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 69 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 70 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 71 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 72 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 73 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 74 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 75 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 76 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 77 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 78 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 79 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 80 | #endif 81 | 82 | #if !defined(SWIFT_PASTE) 83 | # define SWIFT_PASTE_HELPER(x, y) x##y 84 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 85 | #endif 86 | #if !defined(SWIFT_METATYPE) 87 | # define SWIFT_METATYPE(X) Class 88 | #endif 89 | #if !defined(SWIFT_CLASS_PROPERTY) 90 | # if __has_feature(objc_class_property) 91 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 92 | # else 93 | # define SWIFT_CLASS_PROPERTY(...) 94 | # endif 95 | #endif 96 | #if !defined(SWIFT_RUNTIME_NAME) 97 | # if __has_attribute(objc_runtime_name) 98 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 99 | # else 100 | # define SWIFT_RUNTIME_NAME(X) 101 | # endif 102 | #endif 103 | #if !defined(SWIFT_COMPILE_NAME) 104 | # if __has_attribute(swift_name) 105 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 106 | # else 107 | # define SWIFT_COMPILE_NAME(X) 108 | # endif 109 | #endif 110 | #if !defined(SWIFT_METHOD_FAMILY) 111 | # if __has_attribute(objc_method_family) 112 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 113 | # else 114 | # define SWIFT_METHOD_FAMILY(X) 115 | # endif 116 | #endif 117 | #if !defined(SWIFT_NOESCAPE) 118 | # if __has_attribute(noescape) 119 | # define SWIFT_NOESCAPE __attribute__((noescape)) 120 | # else 121 | # define SWIFT_NOESCAPE 122 | # endif 123 | #endif 124 | #if !defined(SWIFT_RELEASES_ARGUMENT) 125 | # if __has_attribute(ns_consumed) 126 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) 127 | # else 128 | # define SWIFT_RELEASES_ARGUMENT 129 | # endif 130 | #endif 131 | #if !defined(SWIFT_WARN_UNUSED_RESULT) 132 | # if __has_attribute(warn_unused_result) 133 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 134 | # else 135 | # define SWIFT_WARN_UNUSED_RESULT 136 | # endif 137 | #endif 138 | #if !defined(SWIFT_NORETURN) 139 | # if __has_attribute(noreturn) 140 | # define SWIFT_NORETURN __attribute__((noreturn)) 141 | # else 142 | # define SWIFT_NORETURN 143 | # endif 144 | #endif 145 | #if !defined(SWIFT_CLASS_EXTRA) 146 | # define SWIFT_CLASS_EXTRA 147 | #endif 148 | #if !defined(SWIFT_PROTOCOL_EXTRA) 149 | # define SWIFT_PROTOCOL_EXTRA 150 | #endif 151 | #if !defined(SWIFT_ENUM_EXTRA) 152 | # define SWIFT_ENUM_EXTRA 153 | #endif 154 | #if !defined(SWIFT_CLASS) 155 | # if __has_attribute(objc_subclassing_restricted) 156 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 157 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 158 | # else 159 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 160 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 161 | # endif 162 | #endif 163 | #if !defined(SWIFT_RESILIENT_CLASS) 164 | # if __has_attribute(objc_class_stub) 165 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) 166 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) 167 | # else 168 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) 169 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) 170 | # endif 171 | #endif 172 | #if !defined(SWIFT_PROTOCOL) 173 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 174 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 175 | #endif 176 | #if !defined(SWIFT_EXTENSION) 177 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 178 | #endif 179 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 180 | # if __has_attribute(objc_designated_initializer) 181 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 182 | # else 183 | # define OBJC_DESIGNATED_INITIALIZER 184 | # endif 185 | #endif 186 | #if !defined(SWIFT_ENUM_ATTR) 187 | # if __has_attribute(enum_extensibility) 188 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) 189 | # else 190 | # define SWIFT_ENUM_ATTR(_extensibility) 191 | # endif 192 | #endif 193 | #if !defined(SWIFT_ENUM) 194 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 195 | # if __has_feature(generalized_swift_name) 196 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 197 | # else 198 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) 199 | # endif 200 | #endif 201 | #if !defined(SWIFT_UNAVAILABLE) 202 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 203 | #endif 204 | #if !defined(SWIFT_UNAVAILABLE_MSG) 205 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 206 | #endif 207 | #if !defined(SWIFT_AVAILABILITY) 208 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 209 | #endif 210 | #if !defined(SWIFT_WEAK_IMPORT) 211 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import)) 212 | #endif 213 | #if !defined(SWIFT_DEPRECATED) 214 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 215 | #endif 216 | #if !defined(SWIFT_DEPRECATED_MSG) 217 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 218 | #endif 219 | #if !defined(SWIFT_DEPRECATED_OBJC) 220 | # if __has_feature(attribute_diagnose_if_objc) 221 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) 222 | # else 223 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) 224 | # endif 225 | #endif 226 | #if defined(__OBJC__) 227 | #if !defined(IBSegueAction) 228 | # define IBSegueAction 229 | #endif 230 | #endif 231 | #if !defined(SWIFT_EXTERN) 232 | # if defined(__cplusplus) 233 | # define SWIFT_EXTERN extern "C" 234 | # else 235 | # define SWIFT_EXTERN extern 236 | # endif 237 | #endif 238 | #if !defined(SWIFT_CALL) 239 | # define SWIFT_CALL __attribute__((swiftcall)) 240 | #endif 241 | #if !defined(SWIFT_INDIRECT_RESULT) 242 | # define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) 243 | #endif 244 | #if !defined(SWIFT_CONTEXT) 245 | # define SWIFT_CONTEXT __attribute__((swift_context)) 246 | #endif 247 | #if !defined(SWIFT_ERROR_RESULT) 248 | # define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) 249 | #endif 250 | #if defined(__cplusplus) 251 | # define SWIFT_NOEXCEPT noexcept 252 | #else 253 | # define SWIFT_NOEXCEPT 254 | #endif 255 | #if !defined(SWIFT_C_INLINE_THUNK) 256 | # if __has_attribute(always_inline) 257 | # if __has_attribute(nodebug) 258 | # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) 259 | # else 260 | # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) 261 | # endif 262 | # else 263 | # define SWIFT_C_INLINE_THUNK inline 264 | # endif 265 | #endif 266 | #if defined(_WIN32) 267 | #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) 268 | # define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) 269 | #endif 270 | #else 271 | #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) 272 | # define SWIFT_IMPORT_STDLIB_SYMBOL 273 | #endif 274 | #endif 275 | #if defined(__OBJC__) 276 | #if __has_feature(objc_modules) 277 | #if __has_warning("-Watimport-in-framework-header") 278 | #pragma clang diagnostic ignored "-Watimport-in-framework-header" 279 | #endif 280 | #endif 281 | 282 | #endif 283 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 284 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 285 | #if __has_warning("-Wpragma-clang-attribute") 286 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute" 287 | #endif 288 | #pragma clang diagnostic ignored "-Wunknown-pragmas" 289 | #pragma clang diagnostic ignored "-Wnullability" 290 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" 291 | 292 | #if __has_attribute(external_source_symbol) 293 | # pragma push_macro("any") 294 | # undef any 295 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="ProcessServiceContainer",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) 296 | # pragma pop_macro("any") 297 | #endif 298 | 299 | #if defined(__OBJC__) 300 | #endif 301 | #if __has_attribute(external_source_symbol) 302 | # pragma clang attribute pop 303 | #endif 304 | #if defined(__cplusplus) 305 | #endif 306 | #pragma clang diagnostic pop 307 | #endif 308 | 309 | #elif defined(__x86_64__) && __x86_64__ 310 | // Generated by Apple Swift version 5.9 (swiftlang-5.9.0.120.7 clang-1500.0.34.3) 311 | #ifndef PROCESSSERVICECONTAINER_SWIFT_H 312 | #define PROCESSSERVICECONTAINER_SWIFT_H 313 | #pragma clang diagnostic push 314 | #pragma clang diagnostic ignored "-Wgcc-compat" 315 | 316 | #if !defined(__has_include) 317 | # define __has_include(x) 0 318 | #endif 319 | #if !defined(__has_attribute) 320 | # define __has_attribute(x) 0 321 | #endif 322 | #if !defined(__has_feature) 323 | # define __has_feature(x) 0 324 | #endif 325 | #if !defined(__has_warning) 326 | # define __has_warning(x) 0 327 | #endif 328 | 329 | #if __has_include() 330 | # include 331 | #endif 332 | 333 | #pragma clang diagnostic ignored "-Wauto-import" 334 | #if defined(__OBJC__) 335 | #include 336 | #endif 337 | #if defined(__cplusplus) 338 | #include 339 | #include 340 | #include 341 | #include 342 | #include 343 | #include 344 | #include 345 | #else 346 | #include 347 | #include 348 | #include 349 | #include 350 | #endif 351 | #if defined(__cplusplus) 352 | #if defined(__arm64e__) && __has_include() 353 | # include 354 | #else 355 | #pragma clang diagnostic push 356 | #pragma clang diagnostic ignored "-Wreserved-macro-identifier" 357 | # ifndef __ptrauth_swift_value_witness_function_pointer 358 | # define __ptrauth_swift_value_witness_function_pointer(x) 359 | # endif 360 | # ifndef __ptrauth_swift_class_method_pointer 361 | # define __ptrauth_swift_class_method_pointer(x) 362 | # endif 363 | #pragma clang diagnostic pop 364 | #endif 365 | #endif 366 | 367 | #if !defined(SWIFT_TYPEDEFS) 368 | # define SWIFT_TYPEDEFS 1 369 | # if __has_include() 370 | # include 371 | # elif !defined(__cplusplus) 372 | typedef uint_least16_t char16_t; 373 | typedef uint_least32_t char32_t; 374 | # endif 375 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 376 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 377 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 378 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 379 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 380 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 381 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 382 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 383 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 384 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 385 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 386 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 387 | #endif 388 | 389 | #if !defined(SWIFT_PASTE) 390 | # define SWIFT_PASTE_HELPER(x, y) x##y 391 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 392 | #endif 393 | #if !defined(SWIFT_METATYPE) 394 | # define SWIFT_METATYPE(X) Class 395 | #endif 396 | #if !defined(SWIFT_CLASS_PROPERTY) 397 | # if __has_feature(objc_class_property) 398 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 399 | # else 400 | # define SWIFT_CLASS_PROPERTY(...) 401 | # endif 402 | #endif 403 | #if !defined(SWIFT_RUNTIME_NAME) 404 | # if __has_attribute(objc_runtime_name) 405 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 406 | # else 407 | # define SWIFT_RUNTIME_NAME(X) 408 | # endif 409 | #endif 410 | #if !defined(SWIFT_COMPILE_NAME) 411 | # if __has_attribute(swift_name) 412 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 413 | # else 414 | # define SWIFT_COMPILE_NAME(X) 415 | # endif 416 | #endif 417 | #if !defined(SWIFT_METHOD_FAMILY) 418 | # if __has_attribute(objc_method_family) 419 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 420 | # else 421 | # define SWIFT_METHOD_FAMILY(X) 422 | # endif 423 | #endif 424 | #if !defined(SWIFT_NOESCAPE) 425 | # if __has_attribute(noescape) 426 | # define SWIFT_NOESCAPE __attribute__((noescape)) 427 | # else 428 | # define SWIFT_NOESCAPE 429 | # endif 430 | #endif 431 | #if !defined(SWIFT_RELEASES_ARGUMENT) 432 | # if __has_attribute(ns_consumed) 433 | # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) 434 | # else 435 | # define SWIFT_RELEASES_ARGUMENT 436 | # endif 437 | #endif 438 | #if !defined(SWIFT_WARN_UNUSED_RESULT) 439 | # if __has_attribute(warn_unused_result) 440 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 441 | # else 442 | # define SWIFT_WARN_UNUSED_RESULT 443 | # endif 444 | #endif 445 | #if !defined(SWIFT_NORETURN) 446 | # if __has_attribute(noreturn) 447 | # define SWIFT_NORETURN __attribute__((noreturn)) 448 | # else 449 | # define SWIFT_NORETURN 450 | # endif 451 | #endif 452 | #if !defined(SWIFT_CLASS_EXTRA) 453 | # define SWIFT_CLASS_EXTRA 454 | #endif 455 | #if !defined(SWIFT_PROTOCOL_EXTRA) 456 | # define SWIFT_PROTOCOL_EXTRA 457 | #endif 458 | #if !defined(SWIFT_ENUM_EXTRA) 459 | # define SWIFT_ENUM_EXTRA 460 | #endif 461 | #if !defined(SWIFT_CLASS) 462 | # if __has_attribute(objc_subclassing_restricted) 463 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 464 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 465 | # else 466 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 467 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 468 | # endif 469 | #endif 470 | #if !defined(SWIFT_RESILIENT_CLASS) 471 | # if __has_attribute(objc_class_stub) 472 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) 473 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) 474 | # else 475 | # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) 476 | # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) 477 | # endif 478 | #endif 479 | #if !defined(SWIFT_PROTOCOL) 480 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 481 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 482 | #endif 483 | #if !defined(SWIFT_EXTENSION) 484 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 485 | #endif 486 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 487 | # if __has_attribute(objc_designated_initializer) 488 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 489 | # else 490 | # define OBJC_DESIGNATED_INITIALIZER 491 | # endif 492 | #endif 493 | #if !defined(SWIFT_ENUM_ATTR) 494 | # if __has_attribute(enum_extensibility) 495 | # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) 496 | # else 497 | # define SWIFT_ENUM_ATTR(_extensibility) 498 | # endif 499 | #endif 500 | #if !defined(SWIFT_ENUM) 501 | # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 502 | # if __has_feature(generalized_swift_name) 503 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type 504 | # else 505 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) 506 | # endif 507 | #endif 508 | #if !defined(SWIFT_UNAVAILABLE) 509 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 510 | #endif 511 | #if !defined(SWIFT_UNAVAILABLE_MSG) 512 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 513 | #endif 514 | #if !defined(SWIFT_AVAILABILITY) 515 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 516 | #endif 517 | #if !defined(SWIFT_WEAK_IMPORT) 518 | # define SWIFT_WEAK_IMPORT __attribute__((weak_import)) 519 | #endif 520 | #if !defined(SWIFT_DEPRECATED) 521 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 522 | #endif 523 | #if !defined(SWIFT_DEPRECATED_MSG) 524 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 525 | #endif 526 | #if !defined(SWIFT_DEPRECATED_OBJC) 527 | # if __has_feature(attribute_diagnose_if_objc) 528 | # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) 529 | # else 530 | # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) 531 | # endif 532 | #endif 533 | #if defined(__OBJC__) 534 | #if !defined(IBSegueAction) 535 | # define IBSegueAction 536 | #endif 537 | #endif 538 | #if !defined(SWIFT_EXTERN) 539 | # if defined(__cplusplus) 540 | # define SWIFT_EXTERN extern "C" 541 | # else 542 | # define SWIFT_EXTERN extern 543 | # endif 544 | #endif 545 | #if !defined(SWIFT_CALL) 546 | # define SWIFT_CALL __attribute__((swiftcall)) 547 | #endif 548 | #if !defined(SWIFT_INDIRECT_RESULT) 549 | # define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) 550 | #endif 551 | #if !defined(SWIFT_CONTEXT) 552 | # define SWIFT_CONTEXT __attribute__((swift_context)) 553 | #endif 554 | #if !defined(SWIFT_ERROR_RESULT) 555 | # define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) 556 | #endif 557 | #if defined(__cplusplus) 558 | # define SWIFT_NOEXCEPT noexcept 559 | #else 560 | # define SWIFT_NOEXCEPT 561 | #endif 562 | #if !defined(SWIFT_C_INLINE_THUNK) 563 | # if __has_attribute(always_inline) 564 | # if __has_attribute(nodebug) 565 | # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) 566 | # else 567 | # define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) 568 | # endif 569 | # else 570 | # define SWIFT_C_INLINE_THUNK inline 571 | # endif 572 | #endif 573 | #if defined(_WIN32) 574 | #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) 575 | # define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) 576 | #endif 577 | #else 578 | #if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) 579 | # define SWIFT_IMPORT_STDLIB_SYMBOL 580 | #endif 581 | #endif 582 | #if defined(__OBJC__) 583 | #if __has_feature(objc_modules) 584 | #if __has_warning("-Watimport-in-framework-header") 585 | #pragma clang diagnostic ignored "-Watimport-in-framework-header" 586 | #endif 587 | #endif 588 | 589 | #endif 590 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 591 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 592 | #if __has_warning("-Wpragma-clang-attribute") 593 | # pragma clang diagnostic ignored "-Wpragma-clang-attribute" 594 | #endif 595 | #pragma clang diagnostic ignored "-Wunknown-pragmas" 596 | #pragma clang diagnostic ignored "-Wnullability" 597 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" 598 | 599 | #if __has_attribute(external_source_symbol) 600 | # pragma push_macro("any") 601 | # undef any 602 | # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="ProcessServiceContainer",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) 603 | # pragma pop_macro("any") 604 | #endif 605 | 606 | #if defined(__OBJC__) 607 | #endif 608 | #if __has_attribute(external_source_symbol) 609 | # pragma clang attribute pop 610 | #endif 611 | #if defined(__cplusplus) 612 | #endif 613 | #pragma clang diagnostic pop 614 | #endif 615 | 616 | #else 617 | #error unsupported Swift architecture 618 | #endif 619 | -------------------------------------------------------------------------------- /Xcode Project/ProcessServiceExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C93C614828F6D35200176126 /* Bootstrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = C93C614728F6D35200176126 /* Bootstrap.swift */; }; 11 | C94A3FA228F6C75300188226 /* ProcessServiceContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = C94A3FA128F6C75300188226 /* ProcessServiceContainer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | C94A3FA528F6C75300188226 /* ProcessServiceContainer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C94A3F9F28F6C75300188226 /* ProcessServiceContainer.framework */; }; 13 | C94A3FA728F6C75300188226 /* ProcessServiceContainer.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C94A3F9F28F6C75300188226 /* ProcessServiceContainer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | C94A3FAD28F6C84800188226 /* ProcessService.xpc in CopyFiles */ = {isa = PBXBuildFile; fileRef = C9DCF9AA28DA3F10009ACED7 /* ProcessService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 15 | C9DCF99728DA3E94009ACED7 /* ProcessServiceExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DCF99628DA3E94009ACED7 /* ProcessServiceExampleApp.swift */; }; 16 | C9DCF99928DA3E94009ACED7 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DCF99828DA3E94009ACED7 /* ContentView.swift */; }; 17 | C9DCF99B28DA3E95009ACED7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9DCF99A28DA3E95009ACED7 /* Assets.xcassets */; }; 18 | C9DCF99E28DA3E95009ACED7 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9DCF99D28DA3E95009ACED7 /* Preview Assets.xcassets */; }; 19 | C9DCF9B128DA3F10009ACED7 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DCF9B028DA3F10009ACED7 /* main.swift */; }; 20 | C9DCF9B528DA3F10009ACED7 /* ProcessService.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = C9DCF9AA28DA3F10009ACED7 /* ProcessService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 21 | C9DCF9C028DA4029009ACED7 /* ProcessServiceServer in Frameworks */ = {isa = PBXBuildFile; productRef = C9DCF9BF28DA4029009ACED7 /* ProcessServiceServer */; }; 22 | C9DCF9C228DA407B009ACED7 /* ProcessServiceClient in Frameworks */ = {isa = PBXBuildFile; productRef = C9DCF9C128DA407B009ACED7 /* ProcessServiceClient */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | C94A3FA328F6C75300188226 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = C9DCF98B28DA3E94009ACED7 /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = C94A3F9E28F6C75300188226; 31 | remoteInfo = ProcessServiceContainer; 32 | }; 33 | C9DCF9B328DA3F10009ACED7 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = C9DCF98B28DA3E94009ACED7 /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = C9DCF9A928DA3F10009ACED7; 38 | remoteInfo = ProcessService; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXCopyFilesBuildPhase section */ 43 | C94A3FA628F6C75300188226 /* Embed Frameworks */ = { 44 | isa = PBXCopyFilesBuildPhase; 45 | buildActionMask = 2147483647; 46 | dstPath = ""; 47 | dstSubfolderSpec = 10; 48 | files = ( 49 | C94A3FA728F6C75300188226 /* ProcessServiceContainer.framework in Embed Frameworks */, 50 | ); 51 | name = "Embed Frameworks"; 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | C94A3FAC28F6C83E00188226 /* CopyFiles */ = { 55 | isa = PBXCopyFilesBuildPhase; 56 | buildActionMask = 2147483647; 57 | dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; 58 | dstSubfolderSpec = 16; 59 | files = ( 60 | C94A3FAD28F6C84800188226 /* ProcessService.xpc in CopyFiles */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | C9DCF9B928DA3F10009ACED7 /* Embed XPC Services */ = { 65 | isa = PBXCopyFilesBuildPhase; 66 | buildActionMask = 2147483647; 67 | dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; 68 | dstSubfolderSpec = 16; 69 | files = ( 70 | C9DCF9B528DA3F10009ACED7 /* ProcessService.xpc in Embed XPC Services */, 71 | ); 72 | name = "Embed XPC Services"; 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXCopyFilesBuildPhase section */ 76 | 77 | /* Begin PBXFileReference section */ 78 | C93C614728F6D35200176126 /* Bootstrap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bootstrap.swift; sourceTree = ""; }; 79 | C94A3F9F28F6C75300188226 /* ProcessServiceContainer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ProcessServiceContainer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | C94A3FA128F6C75300188226 /* ProcessServiceContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcessServiceContainer.h; sourceTree = ""; }; 81 | C94A3FAB28F6C76E00188226 /* ProcessServiceContainer.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ProcessServiceContainer.xcconfig; sourceTree = ""; }; 82 | C9D36FFB290060660050984D /* ProcessService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ProcessService.entitlements; sourceTree = ""; }; 83 | C9DCF99328DA3E94009ACED7 /* ProcessServiceExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ProcessServiceExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 84 | C9DCF99628DA3E94009ACED7 /* ProcessServiceExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProcessServiceExampleApp.swift; sourceTree = ""; }; 85 | C9DCF99828DA3E94009ACED7 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 86 | C9DCF99A28DA3E95009ACED7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 87 | C9DCF99D28DA3E95009ACED7 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 88 | C9DCF99F28DA3E95009ACED7 /* ProcessServiceExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ProcessServiceExample.entitlements; sourceTree = ""; }; 89 | C9DCF9A528DA3EAB009ACED7 /* ProcessService */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = ProcessService; path = ..; sourceTree = ""; }; 90 | C9DCF9AA28DA3F10009ACED7 /* ProcessService.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = ProcessService.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; 91 | C9DCF9B028DA3F10009ACED7 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 92 | C9DCF9B228DA3F10009ACED7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 93 | /* End PBXFileReference section */ 94 | 95 | /* Begin PBXFrameworksBuildPhase section */ 96 | C94A3F9C28F6C75300188226 /* Frameworks */ = { 97 | isa = PBXFrameworksBuildPhase; 98 | buildActionMask = 2147483647; 99 | files = ( 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | C9DCF99028DA3E94009ACED7 /* Frameworks */ = { 104 | isa = PBXFrameworksBuildPhase; 105 | buildActionMask = 2147483647; 106 | files = ( 107 | C94A3FA528F6C75300188226 /* ProcessServiceContainer.framework in Frameworks */, 108 | C9DCF9C228DA407B009ACED7 /* ProcessServiceClient in Frameworks */, 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | C9DCF9A728DA3F10009ACED7 /* Frameworks */ = { 113 | isa = PBXFrameworksBuildPhase; 114 | buildActionMask = 2147483647; 115 | files = ( 116 | C9DCF9C028DA4029009ACED7 /* ProcessServiceServer in Frameworks */, 117 | ); 118 | runOnlyForDeploymentPostprocessing = 0; 119 | }; 120 | /* End PBXFrameworksBuildPhase section */ 121 | 122 | /* Begin PBXGroup section */ 123 | C94A3FA028F6C75300188226 /* ProcessServiceContainer */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | C94A3FA128F6C75300188226 /* ProcessServiceContainer.h */, 127 | C94A3FAB28F6C76E00188226 /* ProcessServiceContainer.xcconfig */, 128 | C93C614728F6D35200176126 /* Bootstrap.swift */, 129 | ); 130 | path = ProcessServiceContainer; 131 | sourceTree = ""; 132 | }; 133 | C9DCF98A28DA3E94009ACED7 = { 134 | isa = PBXGroup; 135 | children = ( 136 | C9DCF9A528DA3EAB009ACED7 /* ProcessService */, 137 | C9DCF99528DA3E94009ACED7 /* ProcessServiceExample */, 138 | C9DCF9AB28DA3F10009ACED7 /* ProcessService */, 139 | C94A3FA028F6C75300188226 /* ProcessServiceContainer */, 140 | C9DCF99428DA3E94009ACED7 /* Products */, 141 | C9DCF9BE28DA4029009ACED7 /* Frameworks */, 142 | ); 143 | sourceTree = ""; 144 | }; 145 | C9DCF99428DA3E94009ACED7 /* Products */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | C9DCF99328DA3E94009ACED7 /* ProcessServiceExample.app */, 149 | C9DCF9AA28DA3F10009ACED7 /* ProcessService.xpc */, 150 | C94A3F9F28F6C75300188226 /* ProcessServiceContainer.framework */, 151 | ); 152 | name = Products; 153 | sourceTree = ""; 154 | }; 155 | C9DCF99528DA3E94009ACED7 /* ProcessServiceExample */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | C9DCF99628DA3E94009ACED7 /* ProcessServiceExampleApp.swift */, 159 | C9DCF99828DA3E94009ACED7 /* ContentView.swift */, 160 | C9DCF99A28DA3E95009ACED7 /* Assets.xcassets */, 161 | C9DCF99F28DA3E95009ACED7 /* ProcessServiceExample.entitlements */, 162 | C9DCF99C28DA3E95009ACED7 /* Preview Content */, 163 | ); 164 | path = ProcessServiceExample; 165 | sourceTree = ""; 166 | }; 167 | C9DCF99C28DA3E95009ACED7 /* Preview Content */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | C9DCF99D28DA3E95009ACED7 /* Preview Assets.xcassets */, 171 | ); 172 | path = "Preview Content"; 173 | sourceTree = ""; 174 | }; 175 | C9DCF9AB28DA3F10009ACED7 /* ProcessService */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | C9D36FFB290060660050984D /* ProcessService.entitlements */, 179 | C9DCF9B028DA3F10009ACED7 /* main.swift */, 180 | C9DCF9B228DA3F10009ACED7 /* Info.plist */, 181 | ); 182 | path = ProcessService; 183 | sourceTree = ""; 184 | }; 185 | C9DCF9BE28DA4029009ACED7 /* Frameworks */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | ); 189 | name = Frameworks; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXGroup section */ 193 | 194 | /* Begin PBXHeadersBuildPhase section */ 195 | C94A3F9A28F6C75300188226 /* Headers */ = { 196 | isa = PBXHeadersBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | C94A3FA228F6C75300188226 /* ProcessServiceContainer.h in Headers */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXHeadersBuildPhase section */ 204 | 205 | /* Begin PBXNativeTarget section */ 206 | C94A3F9E28F6C75300188226 /* ProcessServiceContainer */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = C94A3FAA28F6C75300188226 /* Build configuration list for PBXNativeTarget "ProcessServiceContainer" */; 209 | buildPhases = ( 210 | C94A3F9A28F6C75300188226 /* Headers */, 211 | C94A3F9B28F6C75300188226 /* Sources */, 212 | C94A3F9C28F6C75300188226 /* Frameworks */, 213 | C94A3F9D28F6C75300188226 /* Resources */, 214 | C94A3FAC28F6C83E00188226 /* CopyFiles */, 215 | ); 216 | buildRules = ( 217 | ); 218 | dependencies = ( 219 | ); 220 | name = ProcessServiceContainer; 221 | packageProductDependencies = ( 222 | ); 223 | productName = ProcessServiceContainer; 224 | productReference = C94A3F9F28F6C75300188226 /* ProcessServiceContainer.framework */; 225 | productType = "com.apple.product-type.framework"; 226 | }; 227 | C9DCF99228DA3E94009ACED7 /* ProcessServiceExample */ = { 228 | isa = PBXNativeTarget; 229 | buildConfigurationList = C9DCF9A228DA3E95009ACED7 /* Build configuration list for PBXNativeTarget "ProcessServiceExample" */; 230 | buildPhases = ( 231 | C9DCF98F28DA3E94009ACED7 /* Sources */, 232 | C9DCF99028DA3E94009ACED7 /* Frameworks */, 233 | C9DCF99128DA3E94009ACED7 /* Resources */, 234 | C9DCF9B928DA3F10009ACED7 /* Embed XPC Services */, 235 | C94A3FA628F6C75300188226 /* Embed Frameworks */, 236 | ); 237 | buildRules = ( 238 | ); 239 | dependencies = ( 240 | C9DCF9BB28DA3F68009ACED7 /* PBXTargetDependency */, 241 | C9DCF9B428DA3F10009ACED7 /* PBXTargetDependency */, 242 | C94A3FA428F6C75300188226 /* PBXTargetDependency */, 243 | ); 244 | name = ProcessServiceExample; 245 | packageProductDependencies = ( 246 | C9DCF9C128DA407B009ACED7 /* ProcessServiceClient */, 247 | ); 248 | productName = ProcessServiceExample; 249 | productReference = C9DCF99328DA3E94009ACED7 /* ProcessServiceExample.app */; 250 | productType = "com.apple.product-type.application"; 251 | }; 252 | C9DCF9A928DA3F10009ACED7 /* ProcessService */ = { 253 | isa = PBXNativeTarget; 254 | buildConfigurationList = C9DCF9B628DA3F10009ACED7 /* Build configuration list for PBXNativeTarget "ProcessService" */; 255 | buildPhases = ( 256 | C9DCF9A628DA3F10009ACED7 /* Sources */, 257 | C9DCF9A728DA3F10009ACED7 /* Frameworks */, 258 | C9DCF9A828DA3F10009ACED7 /* Resources */, 259 | ); 260 | buildRules = ( 261 | ); 262 | dependencies = ( 263 | C9DCF9BD28DA4024009ACED7 /* PBXTargetDependency */, 264 | ); 265 | name = ProcessService; 266 | packageProductDependencies = ( 267 | C9DCF9BF28DA4029009ACED7 /* ProcessServiceServer */, 268 | ); 269 | productName = ProcessService; 270 | productReference = C9DCF9AA28DA3F10009ACED7 /* ProcessService.xpc */; 271 | productType = "com.apple.product-type.xpc-service"; 272 | }; 273 | /* End PBXNativeTarget section */ 274 | 275 | /* Begin PBXProject section */ 276 | C9DCF98B28DA3E94009ACED7 /* Project object */ = { 277 | isa = PBXProject; 278 | attributes = { 279 | BuildIndependentTargetsInParallel = 1; 280 | LastSwiftUpdateCheck = 1400; 281 | LastUpgradeCheck = 1410; 282 | TargetAttributes = { 283 | C94A3F9E28F6C75300188226 = { 284 | CreatedOnToolsVersion = 14.1; 285 | LastSwiftMigration = 1410; 286 | }; 287 | C9DCF99228DA3E94009ACED7 = { 288 | CreatedOnToolsVersion = 14.0; 289 | }; 290 | C9DCF9A928DA3F10009ACED7 = { 291 | CreatedOnToolsVersion = 14.0; 292 | }; 293 | }; 294 | }; 295 | buildConfigurationList = C9DCF98E28DA3E94009ACED7 /* Build configuration list for PBXProject "ProcessServiceExample" */; 296 | compatibilityVersion = "Xcode 14.0"; 297 | developmentRegion = en; 298 | hasScannedForEncodings = 0; 299 | knownRegions = ( 300 | en, 301 | Base, 302 | ); 303 | mainGroup = C9DCF98A28DA3E94009ACED7; 304 | productRefGroup = C9DCF99428DA3E94009ACED7 /* Products */; 305 | projectDirPath = ""; 306 | projectRoot = ""; 307 | targets = ( 308 | C9DCF99228DA3E94009ACED7 /* ProcessServiceExample */, 309 | C9DCF9A928DA3F10009ACED7 /* ProcessService */, 310 | C94A3F9E28F6C75300188226 /* ProcessServiceContainer */, 311 | ); 312 | }; 313 | /* End PBXProject section */ 314 | 315 | /* Begin PBXResourcesBuildPhase section */ 316 | C94A3F9D28F6C75300188226 /* Resources */ = { 317 | isa = PBXResourcesBuildPhase; 318 | buildActionMask = 2147483647; 319 | files = ( 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | C9DCF99128DA3E94009ACED7 /* Resources */ = { 324 | isa = PBXResourcesBuildPhase; 325 | buildActionMask = 2147483647; 326 | files = ( 327 | C9DCF99E28DA3E95009ACED7 /* Preview Assets.xcassets in Resources */, 328 | C9DCF99B28DA3E95009ACED7 /* Assets.xcassets in Resources */, 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | }; 332 | C9DCF9A828DA3F10009ACED7 /* Resources */ = { 333 | isa = PBXResourcesBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | /* End PBXResourcesBuildPhase section */ 340 | 341 | /* Begin PBXSourcesBuildPhase section */ 342 | C94A3F9B28F6C75300188226 /* Sources */ = { 343 | isa = PBXSourcesBuildPhase; 344 | buildActionMask = 2147483647; 345 | files = ( 346 | C93C614828F6D35200176126 /* Bootstrap.swift in Sources */, 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | }; 350 | C9DCF98F28DA3E94009ACED7 /* Sources */ = { 351 | isa = PBXSourcesBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | C9DCF99928DA3E94009ACED7 /* ContentView.swift in Sources */, 355 | C9DCF99728DA3E94009ACED7 /* ProcessServiceExampleApp.swift in Sources */, 356 | ); 357 | runOnlyForDeploymentPostprocessing = 0; 358 | }; 359 | C9DCF9A628DA3F10009ACED7 /* Sources */ = { 360 | isa = PBXSourcesBuildPhase; 361 | buildActionMask = 2147483647; 362 | files = ( 363 | C9DCF9B128DA3F10009ACED7 /* main.swift in Sources */, 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | }; 367 | /* End PBXSourcesBuildPhase section */ 368 | 369 | /* Begin PBXTargetDependency section */ 370 | C94A3FA428F6C75300188226 /* PBXTargetDependency */ = { 371 | isa = PBXTargetDependency; 372 | target = C94A3F9E28F6C75300188226 /* ProcessServiceContainer */; 373 | targetProxy = C94A3FA328F6C75300188226 /* PBXContainerItemProxy */; 374 | }; 375 | C9DCF9B428DA3F10009ACED7 /* PBXTargetDependency */ = { 376 | isa = PBXTargetDependency; 377 | target = C9DCF9A928DA3F10009ACED7 /* ProcessService */; 378 | targetProxy = C9DCF9B328DA3F10009ACED7 /* PBXContainerItemProxy */; 379 | }; 380 | C9DCF9BB28DA3F68009ACED7 /* PBXTargetDependency */ = { 381 | isa = PBXTargetDependency; 382 | productRef = C9DCF9BA28DA3F68009ACED7 /* ProcessServiceClient */; 383 | }; 384 | C9DCF9BD28DA4024009ACED7 /* PBXTargetDependency */ = { 385 | isa = PBXTargetDependency; 386 | productRef = C9DCF9BC28DA4024009ACED7 /* ProcessServiceServer */; 387 | }; 388 | /* End PBXTargetDependency section */ 389 | 390 | /* Begin XCBuildConfiguration section */ 391 | C94A3FA828F6C75300188226 /* Debug */ = { 392 | isa = XCBuildConfiguration; 393 | baseConfigurationReference = C94A3FAB28F6C76E00188226 /* ProcessServiceContainer.xcconfig */; 394 | buildSettings = { 395 | CLANG_ENABLE_MODULES = YES; 396 | CODE_SIGN_STYLE = Automatic; 397 | COMBINE_HIDPI_IMAGES = YES; 398 | CURRENT_PROJECT_VERSION = 1; 399 | DEAD_CODE_STRIPPING = YES; 400 | DEFINES_MODULE = YES; 401 | DYLIB_COMPATIBILITY_VERSION = 1; 402 | DYLIB_CURRENT_VERSION = 1; 403 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 404 | GENERATE_INFOPLIST_FILE = YES; 405 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 406 | LD_RUNPATH_SEARCH_PATHS = ( 407 | "$(inherited)", 408 | "@executable_path/../Frameworks", 409 | "@loader_path/Frameworks", 410 | ); 411 | MARKETING_VERSION = 1.0; 412 | PRODUCT_BUNDLE_IDENTIFIER = com.chimehq.ProcessServiceContainer; 413 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 414 | SKIP_INSTALL = YES; 415 | SWIFT_EMIT_LOC_STRINGS = YES; 416 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 417 | SWIFT_VERSION = 5.0; 418 | VERSIONING_SYSTEM = "apple-generic"; 419 | VERSION_INFO_PREFIX = ""; 420 | }; 421 | name = Debug; 422 | }; 423 | C94A3FA928F6C75300188226 /* Release */ = { 424 | isa = XCBuildConfiguration; 425 | baseConfigurationReference = C94A3FAB28F6C76E00188226 /* ProcessServiceContainer.xcconfig */; 426 | buildSettings = { 427 | CLANG_ENABLE_MODULES = YES; 428 | CODE_SIGN_STYLE = Automatic; 429 | COMBINE_HIDPI_IMAGES = YES; 430 | CURRENT_PROJECT_VERSION = 1; 431 | DEAD_CODE_STRIPPING = YES; 432 | DEFINES_MODULE = YES; 433 | DYLIB_COMPATIBILITY_VERSION = 1; 434 | DYLIB_CURRENT_VERSION = 1; 435 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 436 | GENERATE_INFOPLIST_FILE = YES; 437 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 438 | LD_RUNPATH_SEARCH_PATHS = ( 439 | "$(inherited)", 440 | "@executable_path/../Frameworks", 441 | "@loader_path/Frameworks", 442 | ); 443 | MARKETING_VERSION = 1.0; 444 | PRODUCT_BUNDLE_IDENTIFIER = com.chimehq.ProcessServiceContainer; 445 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 446 | SKIP_INSTALL = YES; 447 | SWIFT_EMIT_LOC_STRINGS = YES; 448 | SWIFT_VERSION = 5.0; 449 | VERSIONING_SYSTEM = "apple-generic"; 450 | VERSION_INFO_PREFIX = ""; 451 | }; 452 | name = Release; 453 | }; 454 | C9DCF9A028DA3E95009ACED7 /* Debug */ = { 455 | isa = XCBuildConfiguration; 456 | buildSettings = { 457 | ALWAYS_SEARCH_USER_PATHS = NO; 458 | CLANG_ANALYZER_NONNULL = YES; 459 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 460 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 461 | CLANG_ENABLE_MODULES = YES; 462 | CLANG_ENABLE_OBJC_ARC = YES; 463 | CLANG_ENABLE_OBJC_WEAK = YES; 464 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 465 | CLANG_WARN_BOOL_CONVERSION = YES; 466 | CLANG_WARN_COMMA = YES; 467 | CLANG_WARN_CONSTANT_CONVERSION = YES; 468 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 469 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 470 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 471 | CLANG_WARN_EMPTY_BODY = YES; 472 | CLANG_WARN_ENUM_CONVERSION = YES; 473 | CLANG_WARN_INFINITE_RECURSION = YES; 474 | CLANG_WARN_INT_CONVERSION = YES; 475 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 476 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 477 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 478 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 479 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 480 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 481 | CLANG_WARN_STRICT_PROTOTYPES = YES; 482 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 483 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 484 | CLANG_WARN_UNREACHABLE_CODE = YES; 485 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 486 | COPY_PHASE_STRIP = NO; 487 | DEAD_CODE_STRIPPING = YES; 488 | DEBUG_INFORMATION_FORMAT = dwarf; 489 | ENABLE_STRICT_OBJC_MSGSEND = YES; 490 | ENABLE_TESTABILITY = YES; 491 | GCC_C_LANGUAGE_STANDARD = gnu11; 492 | GCC_DYNAMIC_NO_PIC = NO; 493 | GCC_NO_COMMON_BLOCKS = YES; 494 | GCC_OPTIMIZATION_LEVEL = 0; 495 | GCC_PREPROCESSOR_DEFINITIONS = ( 496 | "DEBUG=1", 497 | "$(inherited)", 498 | ); 499 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 500 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 501 | GCC_WARN_UNDECLARED_SELECTOR = YES; 502 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 503 | GCC_WARN_UNUSED_FUNCTION = YES; 504 | GCC_WARN_UNUSED_VARIABLE = YES; 505 | MACOSX_DEPLOYMENT_TARGET = 11.0; 506 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 507 | MTL_FAST_MATH = YES; 508 | ONLY_ACTIVE_ARCH = YES; 509 | SDKROOT = macosx; 510 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 511 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 512 | }; 513 | name = Debug; 514 | }; 515 | C9DCF9A128DA3E95009ACED7 /* Release */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | ALWAYS_SEARCH_USER_PATHS = NO; 519 | CLANG_ANALYZER_NONNULL = YES; 520 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 521 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 522 | CLANG_ENABLE_MODULES = YES; 523 | CLANG_ENABLE_OBJC_ARC = YES; 524 | CLANG_ENABLE_OBJC_WEAK = YES; 525 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 526 | CLANG_WARN_BOOL_CONVERSION = YES; 527 | CLANG_WARN_COMMA = YES; 528 | CLANG_WARN_CONSTANT_CONVERSION = YES; 529 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 530 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 531 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 532 | CLANG_WARN_EMPTY_BODY = YES; 533 | CLANG_WARN_ENUM_CONVERSION = YES; 534 | CLANG_WARN_INFINITE_RECURSION = YES; 535 | CLANG_WARN_INT_CONVERSION = YES; 536 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 537 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 538 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 539 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 540 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 541 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 542 | CLANG_WARN_STRICT_PROTOTYPES = YES; 543 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 544 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 545 | CLANG_WARN_UNREACHABLE_CODE = YES; 546 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 547 | COPY_PHASE_STRIP = NO; 548 | DEAD_CODE_STRIPPING = YES; 549 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 550 | ENABLE_NS_ASSERTIONS = NO; 551 | ENABLE_STRICT_OBJC_MSGSEND = YES; 552 | GCC_C_LANGUAGE_STANDARD = gnu11; 553 | GCC_NO_COMMON_BLOCKS = YES; 554 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 555 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 556 | GCC_WARN_UNDECLARED_SELECTOR = YES; 557 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 558 | GCC_WARN_UNUSED_FUNCTION = YES; 559 | GCC_WARN_UNUSED_VARIABLE = YES; 560 | MACOSX_DEPLOYMENT_TARGET = 11.0; 561 | MTL_ENABLE_DEBUG_INFO = NO; 562 | MTL_FAST_MATH = YES; 563 | SDKROOT = macosx; 564 | SWIFT_COMPILATION_MODE = wholemodule; 565 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 566 | }; 567 | name = Release; 568 | }; 569 | C9DCF9A328DA3E95009ACED7 /* Debug */ = { 570 | isa = XCBuildConfiguration; 571 | buildSettings = { 572 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 573 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 574 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 575 | CODE_SIGN_ENTITLEMENTS = ProcessServiceExample/ProcessServiceExample.entitlements; 576 | CODE_SIGN_IDENTITY = "-"; 577 | CODE_SIGN_STYLE = Automatic; 578 | COMBINE_HIDPI_IMAGES = YES; 579 | CURRENT_PROJECT_VERSION = 1; 580 | DEAD_CODE_STRIPPING = YES; 581 | DEVELOPMENT_ASSET_PATHS = "\"ProcessServiceExample/Preview Content\""; 582 | ENABLE_PREVIEWS = YES; 583 | GENERATE_INFOPLIST_FILE = YES; 584 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 585 | LD_RUNPATH_SEARCH_PATHS = ( 586 | "$(inherited)", 587 | "@executable_path/../Frameworks", 588 | ); 589 | MACOSX_DEPLOYMENT_TARGET = 12.0; 590 | MARKETING_VERSION = 1.0; 591 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.ProcessServiceExample; 592 | PRODUCT_NAME = "$(TARGET_NAME)"; 593 | SWIFT_EMIT_LOC_STRINGS = YES; 594 | SWIFT_VERSION = 5.0; 595 | }; 596 | name = Debug; 597 | }; 598 | C9DCF9A428DA3E95009ACED7 /* Release */ = { 599 | isa = XCBuildConfiguration; 600 | buildSettings = { 601 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 602 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 603 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 604 | CODE_SIGN_ENTITLEMENTS = ProcessServiceExample/ProcessServiceExample.entitlements; 605 | CODE_SIGN_IDENTITY = "-"; 606 | CODE_SIGN_STYLE = Automatic; 607 | COMBINE_HIDPI_IMAGES = YES; 608 | CURRENT_PROJECT_VERSION = 1; 609 | DEAD_CODE_STRIPPING = YES; 610 | DEVELOPMENT_ASSET_PATHS = "\"ProcessServiceExample/Preview Content\""; 611 | ENABLE_PREVIEWS = YES; 612 | GENERATE_INFOPLIST_FILE = YES; 613 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 614 | LD_RUNPATH_SEARCH_PATHS = ( 615 | "$(inherited)", 616 | "@executable_path/../Frameworks", 617 | ); 618 | MACOSX_DEPLOYMENT_TARGET = 12.0; 619 | MARKETING_VERSION = 1.0; 620 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.ProcessServiceExample; 621 | PRODUCT_NAME = "$(TARGET_NAME)"; 622 | SWIFT_EMIT_LOC_STRINGS = YES; 623 | SWIFT_VERSION = 5.0; 624 | }; 625 | name = Release; 626 | }; 627 | C9DCF9B728DA3F10009ACED7 /* Debug */ = { 628 | isa = XCBuildConfiguration; 629 | buildSettings = { 630 | CODE_SIGN_ENTITLEMENTS = ProcessService/ProcessService.entitlements; 631 | CODE_SIGN_IDENTITY = "-"; 632 | CODE_SIGN_STYLE = Automatic; 633 | COMBINE_HIDPI_IMAGES = YES; 634 | CURRENT_PROJECT_VERSION = 1; 635 | DEAD_CODE_STRIPPING = YES; 636 | ENABLE_HARDENED_RUNTIME = YES; 637 | GENERATE_INFOPLIST_FILE = YES; 638 | INFOPLIST_FILE = ProcessService/Info.plist; 639 | INFOPLIST_KEY_CFBundleDisplayName = ProcessService; 640 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 641 | MARKETING_VERSION = 1.0; 642 | PRODUCT_BUNDLE_IDENTIFIER = com.chimehq.ProcessService; 643 | PRODUCT_NAME = "$(TARGET_NAME)"; 644 | SKIP_INSTALL = YES; 645 | SWIFT_EMIT_LOC_STRINGS = YES; 646 | SWIFT_VERSION = 5.0; 647 | }; 648 | name = Debug; 649 | }; 650 | C9DCF9B828DA3F10009ACED7 /* Release */ = { 651 | isa = XCBuildConfiguration; 652 | buildSettings = { 653 | CODE_SIGN_ENTITLEMENTS = ProcessService/ProcessService.entitlements; 654 | CODE_SIGN_IDENTITY = "-"; 655 | CODE_SIGN_STYLE = Automatic; 656 | COMBINE_HIDPI_IMAGES = YES; 657 | CURRENT_PROJECT_VERSION = 1; 658 | DEAD_CODE_STRIPPING = YES; 659 | ENABLE_HARDENED_RUNTIME = YES; 660 | GENERATE_INFOPLIST_FILE = YES; 661 | INFOPLIST_FILE = ProcessService/Info.plist; 662 | INFOPLIST_KEY_CFBundleDisplayName = ProcessService; 663 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 664 | MARKETING_VERSION = 1.0; 665 | PRODUCT_BUNDLE_IDENTIFIER = com.chimehq.ProcessService; 666 | PRODUCT_NAME = "$(TARGET_NAME)"; 667 | SKIP_INSTALL = YES; 668 | SWIFT_EMIT_LOC_STRINGS = YES; 669 | SWIFT_VERSION = 5.0; 670 | }; 671 | name = Release; 672 | }; 673 | /* End XCBuildConfiguration section */ 674 | 675 | /* Begin XCConfigurationList section */ 676 | C94A3FAA28F6C75300188226 /* Build configuration list for PBXNativeTarget "ProcessServiceContainer" */ = { 677 | isa = XCConfigurationList; 678 | buildConfigurations = ( 679 | C94A3FA828F6C75300188226 /* Debug */, 680 | C94A3FA928F6C75300188226 /* Release */, 681 | ); 682 | defaultConfigurationIsVisible = 0; 683 | defaultConfigurationName = Release; 684 | }; 685 | C9DCF98E28DA3E94009ACED7 /* Build configuration list for PBXProject "ProcessServiceExample" */ = { 686 | isa = XCConfigurationList; 687 | buildConfigurations = ( 688 | C9DCF9A028DA3E95009ACED7 /* Debug */, 689 | C9DCF9A128DA3E95009ACED7 /* Release */, 690 | ); 691 | defaultConfigurationIsVisible = 0; 692 | defaultConfigurationName = Release; 693 | }; 694 | C9DCF9A228DA3E95009ACED7 /* Build configuration list for PBXNativeTarget "ProcessServiceExample" */ = { 695 | isa = XCConfigurationList; 696 | buildConfigurations = ( 697 | C9DCF9A328DA3E95009ACED7 /* Debug */, 698 | C9DCF9A428DA3E95009ACED7 /* Release */, 699 | ); 700 | defaultConfigurationIsVisible = 0; 701 | defaultConfigurationName = Release; 702 | }; 703 | C9DCF9B628DA3F10009ACED7 /* Build configuration list for PBXNativeTarget "ProcessService" */ = { 704 | isa = XCConfigurationList; 705 | buildConfigurations = ( 706 | C9DCF9B728DA3F10009ACED7 /* Debug */, 707 | C9DCF9B828DA3F10009ACED7 /* Release */, 708 | ); 709 | defaultConfigurationIsVisible = 0; 710 | defaultConfigurationName = Release; 711 | }; 712 | /* End XCConfigurationList section */ 713 | 714 | /* Begin XCSwiftPackageProductDependency section */ 715 | C9DCF9BA28DA3F68009ACED7 /* ProcessServiceClient */ = { 716 | isa = XCSwiftPackageProductDependency; 717 | productName = ProcessServiceClient; 718 | }; 719 | C9DCF9BC28DA4024009ACED7 /* ProcessServiceServer */ = { 720 | isa = XCSwiftPackageProductDependency; 721 | productName = ProcessServiceServer; 722 | }; 723 | C9DCF9BF28DA4029009ACED7 /* ProcessServiceServer */ = { 724 | isa = XCSwiftPackageProductDependency; 725 | productName = ProcessServiceServer; 726 | }; 727 | C9DCF9C128DA407B009ACED7 /* ProcessServiceClient */ = { 728 | isa = XCSwiftPackageProductDependency; 729 | productName = ProcessServiceClient; 730 | }; 731 | /* End XCSwiftPackageProductDependency section */ 732 | }; 733 | rootObject = C9DCF98B28DA3E94009ACED7 /* Project object */; 734 | } 735 | --------------------------------------------------------------------------------