diff --git a/Daemon/BuildManager.swift b/Daemon/BuildManager.swift index 7e4290d..4b7c642 100644 --- a/Daemon/BuildManager.swift +++ b/Daemon/BuildManager.swift @@ -23,7 +23,7 @@ final class BuildSession: @unchecked Sendable { guard let data = try? JSONEncoder().encode(message), let text = String(data: data, encoding: .utf8) else { return } lock.lock(); let snap = clients; lock.unlock() - for ws in snap where !ws.isClosed { ws.send(text) } + for ws in snap where !ws.isClosed { let w = ws; Task { try? await w.send(text) } } } @discardableResult diff --git a/Daemon/DaemonController.swift b/Daemon/DaemonController.swift index d9345f6..a51d924 100644 --- a/Daemon/DaemonController.swift +++ b/Daemon/DaemonController.swift @@ -47,6 +47,7 @@ struct DaemonLogLine: Identifiable { } @Observable +@MainActor final class DaemonController { var serverState: ServerState = .stopped var connectedClients: [ConnectedClient] = [] @@ -58,14 +59,21 @@ final class DaemonController { init(preferences: AppPreferences) { self.preferences = preferences } + // LoggingSystem can only be bootstrapped once per process lifetime. + // Guard with a static flag so restarts don't crash NIO's internal storage box. + private static var loggingBootstrapped = false + func start() async { guard !serverState.isRunning else { return } serverState = .starting appendLog("Starting PadXcode daemon on port \(preferences.port)…", level: .info) do { var env = try Environment.detect() - try LoggingSystem.bootstrap(from: &env) - let app = Application(env) + if !DaemonController.loggingBootstrapped { + try LoggingSystem.bootstrap(from: &env) + DaemonController.loggingBootstrapped = true + } + let app = try await Application.make(env) app.http.server.configuration.hostname = "0.0.0.0" app.http.server.configuration.port = preferences.port try configure(app, controller: self) @@ -83,7 +91,7 @@ final class DaemonController { func stop() async { guard serverState.isRunning else { return } appendLog("Stopping daemon…", level: .info) - await vaporApp?.asyncShutdown() + try? await vaporApp?.asyncShutdown() vaporApp = nil; serverState = .stopped; connectedClients = [] appendLog("Daemon stopped.", level: .info) } diff --git a/Daemon/LSPProxy.swift b/Daemon/LSPProxy.swift index 1e6aa2e..e82c463 100644 --- a/Daemon/LSPProxy.swift +++ b/Daemon/LSPProxy.swift @@ -43,12 +43,12 @@ actor LSPProxy { let messages = extractJSONBodies(from: data) for msg in messages { guard let text = String(data: msg, encoding: .utf8) else { continue } - for ws in clients where !ws.isClosed { ws.send(text) } + for ws in clients where !ws.isClosed { let w = ws; Task { try? await w.send(text) } } } } private func broadcastStatus(_ s: String) { - for ws in clients where !ws.isClosed { ws.send(#"{"padxcode_status":"\#(s)"}"#) } + for ws in clients where !ws.isClosed { let w = ws; let msg = #"{"padxcode_status":"\#(s)"}"#; Task { try? await w.send(msg) } } } private func extractJSONBodies(from data: Data) -> [Data] { diff --git a/Daemon/PreBuildRunner.swift b/Daemon/PreBuildRunner.swift index 88730a4..a520a3a 100644 --- a/Daemon/PreBuildRunner.swift +++ b/Daemon/PreBuildRunner.swift @@ -27,8 +27,9 @@ final class PreBuildRunner { p.environment = env let out = Pipe(); let err = Pipe() p.standardOutput = out; p.standardError = err - var timedOut = false - let wd = DispatchWorkItem { timedOut = true; p.terminate() + final class TimedOutBox { var value = false } + let timedOutBox = TimedOutBox() + let wd = DispatchWorkItem { timedOutBox.value = true; p.terminate() session.broadcast(BuildLogMessage(type: .stderr, text: "⏱ Hook '\(hook.name)' timed out.", exitCode: nil)) } DispatchQueue.global().asyncAfter(deadline: .now() + .seconds(hook.timeoutSeconds), execute: wd) @@ -47,7 +48,7 @@ final class PreBuildRunner { } p.terminationHandler = { proc in wd.cancel() - g.notify(queue: .global()) { cont.resume(returning: proc.terminationStatus == 0 && !timedOut) } + g.notify(queue: .global()) { cont.resume(returning: proc.terminationStatus == 0 && !timedOutBox.value) } } do { try p.run() } catch { diff --git a/Daemon/routes.swift b/Daemon/routes.swift index 83a0e12..1daf90b 100644 --- a/Daemon/routes.swift +++ b/Daemon/routes.swift @@ -87,7 +87,7 @@ func routes(_ app: Application) throws { app.webSocket("build", "stream", ":sessionId") { req, ws async in guard let sid = req.parameters.get("sessionId"), let session = await BuildSessionStore.shared.session(for: sid) else { - ws.send(#"{"type":"stderr","text":"Unknown session.","exitCode":-1}"#) + try? await ws.send(#"{"type":"stderr","text":"Unknown session.","exitCode":-1}"#) try? await ws.close() return } @@ -189,7 +189,7 @@ private func runBuildPipeline( let ddPath = "/tmp/padxcode-derived-\(abs(request.projectPath.hashValue))" let teamID = loadTeamID() - var args = projectArg + [ + let args = projectArg + [ "-scheme", request.scheme, "-destination", request.destination, "-configuration", request.configuration, diff --git a/PadXcodeDaemon.xcodeproj/project.pbxproj b/PadXcodeDaemon.xcodeproj/project.pbxproj new file mode 100644 index 0000000..55dc6aa --- /dev/null +++ b/PadXcodeDaemon.xcodeproj/project.pbxproj @@ -0,0 +1,439 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + 1B6A53333ADE88D27E193DAF /* MenuBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15255A727EB7B9AE155AF08 /* MenuBarView.swift */; }; + 1D0729C238EF2340F425CBEF /* Setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC3B5F8E7CE925E0253CC87 /* Setup.swift */; }; + 3B514E5E11E532D6D83D2EB6 /* DaemonController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB419157DD86DA847DDAEF24 /* DaemonController.swift */; }; + 3BAB259291C30EBC6467FEB5 /* DaemonStartupValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0AF818883682630070DC58E /* DaemonStartupValidator.swift */; }; + 3DF5168029CD2350925BBE71 /* DaemonLogWindowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CEAAFE243EE7D46DA03814A /* DaemonLogWindowView.swift */; }; + 4259E7DAFF6FFFDC9A30586F /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = C50869843830B3A4FFEE7853 /* Models.swift */; }; + 44F3AD560D7FEB8B3E561938 /* AppPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = C10E3F42DD5F533A4D619E70 /* AppPreferences.swift */; }; + 56C6C2631AAF1BAC7FED7101 /* LSPProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F963173D95BB0EAD72FA34 /* LSPProxy.swift */; }; + AC206C8AFBF320BF415BD0D7 /* DaemonSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA955F827B9885BF83868479 /* DaemonSettingsView.swift */; }; + B3CC9EE3D46085287CFBA724 /* BuildManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 034262CCE3AF0F6848BD64B4 /* BuildManager.swift */; }; + BFF05264DBA7DAA9AA1E636E /* Vapor in Frameworks */ = {isa = PBXBuildFile; productRef = 45D3B3290761A848F13B231C /* Vapor */; }; + C67E517D8E6A987EFAB951B2 /* routes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 246FF7AD109555D46919B8CC /* routes.swift */; }; + C6A5644FA5D18B9BC5DA5CB4 /* PreBuildRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92230516F53BB02DF04FB13C /* PreBuildRunner.swift */; }; + E29649F27603E1FEA7C03CCB /* PadXcodeDaemonApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CB0717ABE6309094BB5EDE /* PadXcodeDaemonApp.swift */; }; + F177C85DD553A8E0BE469868 /* DeviceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38610E65DCF293138C0AF0AA /* DeviceManager.swift */; }; + F36FC42736240D6F427A34E8 /* configure.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD285422D4F9DA8BF11FEDF9 /* configure.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 034262CCE3AF0F6848BD64B4 /* BuildManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildManager.swift; sourceTree = ""; }; + 246FF7AD109555D46919B8CC /* routes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = routes.swift; sourceTree = ""; }; + 32F963173D95BB0EAD72FA34 /* LSPProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LSPProxy.swift; sourceTree = ""; }; + 38610E65DCF293138C0AF0AA /* DeviceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceManager.swift; sourceTree = ""; }; + 3E7929609E3195F4999953E2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 3EA5BF4FA2338D1085F5FFED /* PadXcodeDaemon.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PadXcodeDaemon.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7CEAAFE243EE7D46DA03814A /* DaemonLogWindowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaemonLogWindowView.swift; sourceTree = ""; }; + 92230516F53BB02DF04FB13C /* PreBuildRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreBuildRunner.swift; sourceTree = ""; }; + 9AC3B5F8E7CE925E0253CC87 /* Setup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Setup.swift; sourceTree = ""; }; + A5CB0717ABE6309094BB5EDE /* PadXcodeDaemonApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PadXcodeDaemonApp.swift; sourceTree = ""; }; + AD285422D4F9DA8BF11FEDF9 /* configure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = configure.swift; sourceTree = ""; }; + C10E3F42DD5F533A4D619E70 /* AppPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppPreferences.swift; sourceTree = ""; }; + C15255A727EB7B9AE155AF08 /* MenuBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuBarView.swift; sourceTree = ""; }; + C50869843830B3A4FFEE7853 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + CA955F827B9885BF83868479 /* DaemonSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaemonSettingsView.swift; sourceTree = ""; }; + D0AF818883682630070DC58E /* DaemonStartupValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaemonStartupValidator.swift; sourceTree = ""; }; + FB419157DD86DA847DDAEF24 /* DaemonController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaemonController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1418A8CB4A52579C5B219E01 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BFF05264DBA7DAA9AA1E636E /* Vapor in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0A21B5225C3C9A96438FBAF9 /* UI */ = { + isa = PBXGroup; + children = ( + 7CEAAFE243EE7D46DA03814A /* DaemonLogWindowView.swift */, + CA955F827B9885BF83868479 /* DaemonSettingsView.swift */, + C15255A727EB7B9AE155AF08 /* MenuBarView.swift */, + ); + path = UI; + sourceTree = ""; + }; + 4A44A5A57FB7321EB559FF0D /* Daemon */ = { + isa = PBXGroup; + children = ( + 034262CCE3AF0F6848BD64B4 /* BuildManager.swift */, + AD285422D4F9DA8BF11FEDF9 /* configure.swift */, + FB419157DD86DA847DDAEF24 /* DaemonController.swift */, + D0AF818883682630070DC58E /* DaemonStartupValidator.swift */, + 38610E65DCF293138C0AF0AA /* DeviceManager.swift */, + 32F963173D95BB0EAD72FA34 /* LSPProxy.swift */, + C50869843830B3A4FFEE7853 /* Models.swift */, + 92230516F53BB02DF04FB13C /* PreBuildRunner.swift */, + 246FF7AD109555D46919B8CC /* routes.swift */, + 9AC3B5F8E7CE925E0253CC87 /* Setup.swift */, + ); + path = Daemon; + sourceTree = ""; + }; + 51BC908BBF37E5CC2F08CF99 /* Products */ = { + isa = PBXGroup; + children = ( + 3EA5BF4FA2338D1085F5FFED /* PadXcodeDaemon.app */, + ); + name = Products; + sourceTree = ""; + }; + E9DAE6B1D26A70FB2A667B50 /* Preferences */ = { + isa = PBXGroup; + children = ( + C10E3F42DD5F533A4D619E70 /* AppPreferences.swift */, + ); + path = Preferences; + sourceTree = ""; + }; + F22661C748C8E28CB121EB51 = { + isa = PBXGroup; + children = ( + FDAAE564F78B03A018B8AE18 /* App */, + 4A44A5A57FB7321EB559FF0D /* Daemon */, + E9DAE6B1D26A70FB2A667B50 /* Preferences */, + 0A21B5225C3C9A96438FBAF9 /* UI */, + 51BC908BBF37E5CC2F08CF99 /* Products */, + ); + sourceTree = ""; + }; + FDAAE564F78B03A018B8AE18 /* App */ = { + isa = PBXGroup; + children = ( + 3E7929609E3195F4999953E2 /* Info.plist */, + A5CB0717ABE6309094BB5EDE /* PadXcodeDaemonApp.swift */, + ); + path = App; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + ABE87B3C7636957D1A544F00 /* PadXcodeDaemon */ = { + isa = PBXNativeTarget; + buildConfigurationList = 100A9A4BABA7FF9382033998 /* Build configuration list for PBXNativeTarget "PadXcodeDaemon" */; + buildPhases = ( + BA90D4A52795991570822DB4 /* SwiftLint (optional) */, + D843E4BC4962B18D4CEF6896 /* Sources */, + 1418A8CB4A52579C5B219E01 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PadXcodeDaemon; + packageProductDependencies = ( + 45D3B3290761A848F13B231C /* Vapor */, + ); + productName = PadXcodeDaemon; + productReference = 3EA5BF4FA2338D1085F5FFED /* PadXcodeDaemon.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 98748342E09229F37FF71755 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1500; + TargetAttributes = { + ABE87B3C7636957D1A544F00 = { + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 180A2CD21BD43F9EE8E4F649 /* Build configuration list for PBXProject "PadXcodeDaemon" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + Base, + en, + ); + mainGroup = F22661C748C8E28CB121EB51; + minimizedProjectReferenceProxies = 1; + packageReferences = ( + 488F7B44CBC16B080F74A5E4 /* XCRemoteSwiftPackageReference "vapor" */, + ); + preferredProjectObjectVersion = 77; + productRefGroup = 51BC908BBF37E5CC2F08CF99 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + ABE87B3C7636957D1A544F00 /* PadXcodeDaemon */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + BA90D4A52795991570822DB4 /* SwiftLint (optional) */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "SwiftLint (optional)"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if which swiftlint > /dev/null; then\n swiftlint\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D843E4BC4962B18D4CEF6896 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 44F3AD560D7FEB8B3E561938 /* AppPreferences.swift in Sources */, + B3CC9EE3D46085287CFBA724 /* BuildManager.swift in Sources */, + 3B514E5E11E532D6D83D2EB6 /* DaemonController.swift in Sources */, + 3DF5168029CD2350925BBE71 /* DaemonLogWindowView.swift in Sources */, + AC206C8AFBF320BF415BD0D7 /* DaemonSettingsView.swift in Sources */, + 3BAB259291C30EBC6467FEB5 /* DaemonStartupValidator.swift in Sources */, + F177C85DD553A8E0BE469868 /* DeviceManager.swift in Sources */, + 56C6C2631AAF1BAC7FED7101 /* LSPProxy.swift in Sources */, + 1B6A53333ADE88D27E193DAF /* MenuBarView.swift in Sources */, + 4259E7DAFF6FFFDC9A30586F /* Models.swift in Sources */, + E29649F27603E1FEA7C03CCB /* PadXcodeDaemonApp.swift in Sources */, + C6A5644FA5D18B9BC5DA5CB4 /* PreBuildRunner.swift in Sources */, + 1D0729C238EF2340F425CBEF /* Setup.swift in Sources */, + F36FC42736240D6F427A34E8 /* configure.swift in Sources */, + C67E517D8E6A987EFAB951B2 /* routes.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 06E291A8A5AC3F52DE9BE434 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = PadXcodeDaemon.entitlements; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = E9C9AGS9K6; + INFOPLIST_FILE = App/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 14.0; + SDKROOT = macosx; + }; + name = Release; + }; + 8F34E43F0510978FD5A1B56E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 14.0; + MARKETING_VERSION = 1.0.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = ca.dallasgroot.PadXcodeDaemon; + PRODUCT_NAME = PadXcodeDaemon; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.9; + }; + name = Release; + }; + ADFC073DAD442B1EF0D0B191 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = PadXcodeDaemon.entitlements; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = E9C9AGS9K6; + INFOPLIST_FILE = App/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 14.0; + SDKROOT = macosx; + }; + name = Debug; + }; + D5E2326F7EE5A874159D618E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "DEBUG=1", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 14.0; + MARKETING_VERSION = 1.0.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = ca.dallasgroot.PadXcodeDaemon; + PRODUCT_NAME = PadXcodeDaemon; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.9; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 100A9A4BABA7FF9382033998 /* Build configuration list for PBXNativeTarget "PadXcodeDaemon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ADFC073DAD442B1EF0D0B191 /* Debug */, + 06E291A8A5AC3F52DE9BE434 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + 180A2CD21BD43F9EE8E4F649 /* Build configuration list for PBXProject "PadXcodeDaemon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D5E2326F7EE5A874159D618E /* Debug */, + 8F34E43F0510978FD5A1B56E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 488F7B44CBC16B080F74A5E4 /* XCRemoteSwiftPackageReference "vapor" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/vapor/vapor.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 4.99.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 45D3B3290761A848F13B231C /* Vapor */ = { + isa = XCSwiftPackageProductDependency; + package = 488F7B44CBC16B080F74A5E4 /* XCRemoteSwiftPackageReference "vapor" */; + productName = Vapor; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 98748342E09229F37FF71755 /* Project object */; +} diff --git a/PadXcodeDaemon.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/PadXcodeDaemon.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/PadXcodeDaemon.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/PadXcodeDaemon.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/PadXcodeDaemon.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..d034570 --- /dev/null +++ b/PadXcodeDaemon.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,267 @@ +{ + "originHash" : "2c13b66e45ccca8ad633ea9b5beb846babe35a4b10a9226e1279c92a3017165f", + "pins" : [ + { + "identity" : "async-http-client", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/async-http-client.git", + "state" : { + "revision" : "3a5b74a58782c3b4c1f0bc75e9b67b10c2494e8f", + "version" : "1.33.1" + } + }, + { + "identity" : "async-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/async-kit.git", + "state" : { + "revision" : "6bbb83cbf9d886623a967a965c8fb1b73e6566f9", + "version" : "1.22.0" + } + }, + { + "identity" : "console-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/console-kit.git", + "state" : { + "revision" : "32ad16dfc7677b927b225595ed18f3debb32f577", + "version" : "4.16.0" + } + }, + { + "identity" : "multipart-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/multipart-kit.git", + "state" : { + "revision" : "3498e60218e6003894ff95192d756e238c01f44e", + "version" : "4.7.1" + } + }, + { + "identity" : "routing-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/routing-kit.git", + "state" : { + "revision" : "1a10ccea61e4248effd23b6e814999ce7bdf0ee0", + "version" : "4.9.3" + } + }, + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms.git", + "state" : { + "revision" : "87e50f483c54e6efd60e885f7f5aa946cee68023", + "version" : "1.2.1" + } + }, + { + "identity" : "swift-asn1", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-asn1.git", + "state" : { + "revision" : "9f542610331815e29cc3821d3b6f488db8715517", + "version" : "1.6.0" + } + }, + { + "identity" : "swift-async-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-async-algorithms.git", + "state" : { + "revision" : "9d349bcc328ac3c31ce40e746b5882742a0d1272", + "version" : "1.1.3" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "b601256eab081c0f92f059e12818ac1d4f178ff7", + "version" : "1.3.0" + } + }, + { + "identity" : "swift-certificates", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-certificates.git", + "state" : { + "revision" : "24ccdeeeed4dfaae7955fcac9dbf5489ed4f1a25", + "version" : "1.18.0" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "6675bc0ff86e61436e615df6fc5174e043e57924", + "version" : "1.4.1" + } + }, + { + "identity" : "swift-configuration", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-configuration.git", + "state" : { + "revision" : "be76c4ad929eb6c4bcaf3351799f2adf9e6848a9", + "version" : "1.2.0" + } + }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "bb4ba815dab96d4edc1e0b86d7b9acf9ff973a84", + "version" : "4.3.1" + } + }, + { + "identity" : "swift-distributed-tracing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-distributed-tracing.git", + "state" : { + "revision" : "dc4030184203ffafbb2ec614352487235d747fe0", + "version" : "1.4.1" + } + }, + { + "identity" : "swift-http-structured-headers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-structured-headers.git", + "state" : { + "revision" : "76d7627bd88b47bf5a0f8497dd244885960dde0b", + "version" : "1.6.0" + } + }, + { + "identity" : "swift-http-types", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-types.git", + "state" : { + "revision" : "45eb0224913ea070ec4fba17291b9e7ecf4749ca", + "version" : "1.5.1" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log.git", + "state" : { + "revision" : "8c0f217f01000dd30f60d6e536569ad4e74291f9", + "version" : "1.11.0" + } + }, + { + "identity" : "swift-metrics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-metrics.git", + "state" : { + "revision" : "f17c111cec972c2a4922cef38cf64f76f7e87886", + "version" : "2.8.0" + } + }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "558f24a4647193b5a0e2104031b71c55d31ff83a", + "version" : "2.97.1" + } + }, + { + "identity" : "swift-nio-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-extras.git", + "state" : { + "revision" : "abcf5312eb8ed2fb11916078aef7c46b06f20813", + "version" : "1.33.0" + } + }, + { + "identity" : "swift-nio-http2", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-http2.git", + "state" : { + "revision" : "6d8d596f0a9bfebb925733003731fe2d749b7e02", + "version" : "1.42.0" + } + }, + { + "identity" : "swift-nio-ssl", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-ssl.git", + "state" : { + "revision" : "df9c3406028e3297246e6e7081977a167318b692", + "version" : "2.36.1" + } + }, + { + "identity" : "swift-nio-transport-services", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-transport-services.git", + "state" : { + "revision" : "60c3e187154421171721c1a38e800b390680fb5d", + "version" : "1.26.0" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics.git", + "state" : { + "revision" : "0c0290ff6b24942dadb83a929ffaaa1481df04a2", + "version" : "1.1.1" + } + }, + { + "identity" : "swift-service-context", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-service-context.git", + "state" : { + "revision" : "d0997351b0c7779017f88e7a93bc30a1878d7f29", + "version" : "1.3.0" + } + }, + { + "identity" : "swift-service-lifecycle", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/swift-service-lifecycle.git", + "state" : { + "revision" : "9829955b385e5bb88128b73f1b8389e9b9c3191a", + "version" : "2.11.0" + } + }, + { + "identity" : "swift-system", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-system.git", + "state" : { + "revision" : "7c6ad0fc39d0763e0b699210e4124afd5041c5df", + "version" : "1.6.4" + } + }, + { + "identity" : "vapor", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/vapor.git", + "state" : { + "revision" : "cfd8f434843ac7850e2d97f46c1aa5ddb906cf1c", + "version" : "4.121.4" + } + }, + { + "identity" : "websocket-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/websocket-kit.git", + "state" : { + "revision" : "90bbbdab3ede12c803cfbe91646f291c092517a3", + "version" : "2.16.2" + } + } + ], + "version" : 3 +} diff --git a/PadXcodeDaemon.xcodeproj/project.xcworkspace/xcuserdata/dallasgroot.xcuserdatad/UserInterfaceState.xcuserstate b/PadXcodeDaemon.xcodeproj/project.xcworkspace/xcuserdata/dallasgroot.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..cb0b64d Binary files /dev/null and b/PadXcodeDaemon.xcodeproj/project.xcworkspace/xcuserdata/dallasgroot.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/PadXcodeDaemon.xcodeproj/xcuserdata/dallasgroot.xcuserdatad/xcschemes/xcschememanagement.plist b/PadXcodeDaemon.xcodeproj/xcuserdata/dallasgroot.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..1e94f2e --- /dev/null +++ b/PadXcodeDaemon.xcodeproj/xcuserdata/dallasgroot.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + PadXcodeDaemon.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/UI/DaemonLogWindowView.swift b/UI/DaemonLogWindowView.swift index 4c9abd1..51d956a 100644 --- a/UI/DaemonLogWindowView.swift +++ b/UI/DaemonLogWindowView.swift @@ -16,8 +16,6 @@ struct DaemonLogWindowView: View { var body: some View { VStack(spacing:0) { HStack(spacing:10) { - ForEach(["All",nil,"info",DaemonLogLine.Level.info,"success",DaemonLogLine.Level.success, - "warning",DaemonLogLine.Level.warning,"error",DaemonLogLine.Level.error] as [Any], id:\.self) { _ in EmptyView() } HStack(spacing:4) { levelBtn("All", nil) levelBtn("Info", .info)