MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / createCleanExecutor

Function createCleanExecutor

src/mcp/tools/utilities/clean.ts:154–243  ·  view source on GitHub ↗
(
  executor: CommandExecutor,
)

Source from the content-addressed store, hash-verified

152}
153
154export function createCleanExecutor(
155 executor: CommandExecutor,
156): NonStreamingExecutor<CleanParams, CleanResult> {
157 return async (params) => {
158 if (params.workspacePath && !params.scheme) {
159 const message = 'scheme is required when workspacePath is provided.';
160 return createCleanResult(
161 params,
162 'FAILED',
163 {
164 warnings: [],
165 errors: [{ message }],
166 },
167 message,
168 );
169 }
170
171 const cleanPlatform = resolveCleanPlatform(params);
172 if (!cleanPlatform) {
173 const message = `Unsupported platform: "${params.platform ?? 'iOS'}".`;
174 return createCleanResult(
175 params,
176 'FAILED',
177 {
178 warnings: [],
179 errors: [{ message }],
180 },
181 message,
182 );
183 }
184
185 const configuration = params.configuration ?? 'Debug';
186 const stderrChunks: string[] = [];
187
188 try {
189 const response = await executeXcodeBuildCommand(
190 {
191 projectPath: params.projectPath,
192 workspacePath: params.workspacePath,
193 scheme: params.scheme ?? '',
194 configuration,
195 derivedDataPath: params.derivedDataPath,
196 extraArgs: params.extraArgs,
197 },
198 {
199 platform: cleanPlatform,
200 logPrefix: 'Clean',
201 },
202 params.preferXcodebuild ?? false,
203 'clean',
204 executor,
205 {
206 onStderr: (chunk) => {
207 stderrChunks.push(chunk);
208 },
209 },
210 );
211

Callers 1

cleanLogicFunction · 0.85

Calls 7

executeXcodeBuildCommandFunction · 0.90
createBasicDiagnosticsFunction · 0.90
toErrorMessageFunction · 0.90
createCleanResultFunction · 0.85
resolveCleanPlatformFunction · 0.85
extractStderrErrorLinesFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected