Инструкции по сборке
Follow the guidelines below for building Electron itself, for the purposes of creating custom Electron binaries. For bundling and distributing your app code with the prebuilt Electron binaries, see the application distribution guide.
Системные требования
Перед началом проверьте требования сборки для вашей системы
Build Tools
Electron's Build Tools automate much of the setup for compiling Electron from source with different configurations and build targets. If you wish to set up the environment manually, the instructions are listed below.
Electron uses GN for project generation and ninja for building. Project configurations can be found in the .gn
and .gni
files.
GN Files
The following gn
files contain the main rules for building Electron:
BUILD.gn
defines how Electron itself is built and includes the default configurations for linking with Chromium.build/args/{testing,release,all}.gn
contain the default build arguments for building Electron.
Требования для GN
Вам нужно будет установить depot_tools
, набор инструментов, используемый для извлечения Chromium и его зависимостей.
Также, для Windows вам потребуется добавить переменную среды DEPOT_TOOLS_WIN_TOOLCHAIN=0
. Чтобы это сделать, откройте Панель управления
→ Система и безопасность
→ Система
→ Дополнительные п араметры системы
и добавьте системную переменную DEPOT_TOOLS_WIN_TOOLCHAIN
со значением 0
. Она говорит depot_tools
использовать вашу локальную версию Visual Studio (по умолчанию, depot_tools
попробует загрузить приватную Google версию к которой имеют доступ только Гугловцы).
Setting up the git cache
If you plan on checking out Electron more than once (for example, to have multiple parallel directories checked out to different branches), using the git cache will speed up subsequent calls to gclient
. To do this, set a GIT_CACHE_PATH
environment variable:
$ export GIT_CACHE_PATH="${HOME}/.git_cache"
$ mkdir -p "${GIT_CACHE_PATH}"
# Это будет использовать примерно 16 гигабайт.