MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / prepareBuild

Function prepareBuild

scripts/devtools_build.mjs:301–318  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

299 * @returns the GN args for the `target`.
300 */
301export async function prepareBuild(target) {
302 const outDir = path.join(rootPath(), 'out', target);
303
304 // Prepare the build directory first.
305 const outDirStat = await fs.stat(outDir).catch(() => null);
306 if (!outDirStat?.isDirectory()) {
307 // Use GN to (optionally create and) initialize the |outDir|.
308 try {
309 const gnExe = vpython3ExecutablePath();
310 const gnArgs = [gnPyPath(), '-q', 'gen', outDir];
311 await spawn(gnExe, gnArgs);
312 } catch (cause) {
313 throw new BuildError(BuildStep.GN, { cause, outDir, target });
314 }
315 }
316
317 return await gnArgsForTarget(target);
318}
319
320/** @type Map<string, Promise<Map<string, string>>> */
321const gnArgsCache = new Map();

Callers 1

run_build.mjsFile · 0.90

Calls 6

rootPathFunction · 0.90
vpython3ExecutablePathFunction · 0.90
gnPyPathFunction · 0.90
spawnFunction · 0.85
gnArgsForTargetFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected