How electron/build-tools works
Project type and purpose
• This is a Node-based, command-line interface (CLI) tool (“build-tools”) that wraps and orchestrates the various upstream build systems and dependencies needed to fetch, configure, and compile Electron (and its Chromium/Node dependencies).
• Its primary purpose is to present a unified “e” command with subcommands (init, sync, build, test, debug, etc.) and to manage per-build configurations.
File structure
• Top-level directories and files
• src/ – all source code:
– e-*.js – each CLI subcommand implementation (e-init, e-sync, e-build, …)
– download.js, evm-config.js – core bootstrapping and config loader
– _e/ – shell script wrappers
– siso/ – support for generating shell autocompletion and cross-platform shims
– utils/ – modules encapsulating calls to git, depot-tools, gclient, GN, ninja, reclient, logging, file-system helpers, etc.
• example-configs/ – sample YAML config files for different build profiles (testing, release, chromium)
• tests/ – unit tests for commands and config loader
• .github/workflows/ – CI definitions (linting, testing, semantic releases)
• package.json, schema (evm-config.schema.json), lint/prettier configs – project config and dependency declarations
README for additional insights
• The tool wraps:
• git (source control)
• Depot Tools (gclient, gn)
• ninja (build)
• reclient (remote build acceleration)
• Python (for some depot-tools scripts)
• Native debuggers (gdb/lldb)
• It manages “build configurations” (akin to nvm’s contexts) stored in simple files and environment variables.
• Core user flows: init → sync → build → use/debug/test.