MCPcopy Create free account
hub / github.com/expo/expo / xcodebuildAsync

Method xcodebuildAsync

tools/src/prebuilds/XcodeProject.ts:139–161  ·  view source on GitHub ↗

* Generic function spawning `xcodebuild` process.

(args: string[], settings?: XcodebuildSettings)

Source from the content-addressed store, hash-verified

137 * Generic function spawning `xcodebuild` process.
138 */
139 async xcodebuildAsync(args: string[], settings?: XcodebuildSettings) {
140 // `xcodebuild` writes error details to stdout but we don't want to pollute our output if nothing wrong happens.
141 // Spawn it quietly, capture stdout + stderr, and print them only on failure.
142 const finalArgs = ['-quiet', ...args];
143
144 if (settings) {
145 finalArgs.unshift(
146 ...Object.entries(settings).map(([key, value]) => {
147 return `${key}=${parseXcodeSettingsValue(value)}`;
148 })
149 );
150 }
151 try {
152 await spawnAsync('xcodebuild', finalArgs, {
153 cwd: this.rootDir,
154 stdio: ['ignore', 'pipe', 'pipe'],
155 });
156 } catch (e) {
157 // Print formatted Xcode logs (merged from stdout and stderr).
158 process.stdout.write(formatXcodeBuildOutput((e.stdout ?? '') + (e.stderr ?? '')));
159 throw e;
160 }
161 }
162
163 /**
164 * Cleans shared derived data directory.

Callers 2

buildFrameworkAsyncMethod · 0.95
buildXcframeworkAsyncMethod · 0.95

Calls 6

spawnAsyncFunction · 0.90
formatXcodeBuildOutputFunction · 0.90
parseXcodeSettingsValueFunction · 0.85
entriesMethod · 0.65
writeMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected