( executor: CommandExecutor, )
| 71 | type BuildMacOSResult = BuildResultDomainResult; |
| 72 | |
| 73 | export function createBuildMacOSExecutor( |
| 74 | executor: CommandExecutor, |
| 75 | ): StreamingExecutor<BuildMacOSParams, BuildMacOSResult> { |
| 76 | return async (params, ctx) => { |
| 77 | const configuration = params.configuration ?? 'Debug'; |
| 78 | const started = createDomainStreamingPipeline('build_macos', 'BUILD', ctx, 'build-result'); |
| 79 | const buildResult = await executeXcodeBuildCommand( |
| 80 | { ...params, configuration }, |
| 81 | { |
| 82 | platform: XcodePlatform.macOS, |
| 83 | arch: params.arch, |
| 84 | logPrefix: 'macOS Build', |
| 85 | }, |
| 86 | params.preferXcodebuild ?? false, |
| 87 | 'build', |
| 88 | executor, |
| 89 | undefined, |
| 90 | started.pipeline, |
| 91 | ); |
| 92 | |
| 93 | let bundleId: string | undefined; |
| 94 | if (!buildResult.isError) { |
| 95 | try { |
| 96 | const appPath = await resolveAppPathFromBuildSettings( |
| 97 | { |
| 98 | projectPath: params.projectPath, |
| 99 | workspacePath: params.workspacePath, |
| 100 | scheme: params.scheme, |
| 101 | configuration, |
| 102 | platform: XcodePlatform.macOS, |
| 103 | derivedDataPath: params.derivedDataPath, |
| 104 | extraArgs: params.extraArgs, |
| 105 | }, |
| 106 | executor, |
| 107 | ); |
| 108 | |
| 109 | const plistResult = await executor( |
| 110 | ['defaults', 'read', `${appPath}/Contents/Info`, 'CFBundleIdentifier'], |
| 111 | 'Extract Bundle ID', |
| 112 | false, |
| 113 | ); |
| 114 | if (plistResult.success && plistResult.output) { |
| 115 | bundleId = plistResult.output.trim(); |
| 116 | } |
| 117 | } catch { |
| 118 | // bundle ID is informational only |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | return createBuildDomainResult({ |
| 123 | started, |
| 124 | succeeded: !buildResult.isError, |
| 125 | target: 'macos', |
| 126 | artifacts: { |
| 127 | ...(bundleId ? { bundleId } : {}), |
| 128 | buildLogPath: started.pipeline.logPath, |
| 129 | }, |
| 130 | fallbackErrorMessages: collectFallbackErrorMessages(started, [], buildResult.content), |
no test coverage detected