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

Function build

scripts/devtools_build.mjs:433–460  ·  view source on GitHub ↗
(target, options = {})

Source from the content-addressed store, hash-verified

431 * @returns a `BuildResult` with statistics for the build.
432 */
433export async function build(target, options = {}) {
434 const startTime = performance.now();
435 const outDir = path.join(rootPath(), 'out', target);
436
437 // Build just the devtools-frontend resources in |outDir|. This is important
438 // since we might be running in a full Chromium checkout and certainly don't
439 // want to build all of Chromium first.
440 const buildTargets = await computeBuildTargetsForFiles(
441 target,
442 options.filenames,
443 );
444 try {
445 const autoninjaExe = vpython3ExecutablePath();
446 const autoninjaArgs = [autoninjaPyPath(), '-C', outDir, ...buildTargets];
447 await spawn(autoninjaExe, autoninjaArgs, {
448 signal: options.signal,
449 });
450 } catch (cause) {
451 if (cause.name === 'AbortError') {
452 throw cause;
453 }
454 throw new BuildError(BuildStep.AUTONINJA, { cause, outDir, target });
455 }
456
457 // Report the build result.
458 const time = (performance.now() - startTime) / 1000;
459 return { time };
460}

Callers 3

run_build.mjsFile · 0.90
watchRebuildFunction · 0.90
Log.test.tsFile · 0.85

Calls 6

rootPathFunction · 0.90
vpython3ExecutablePathFunction · 0.90
autoninjaPyPathFunction · 0.90
spawnFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected