From a799513b2ee287aafe5d7a3c93dbbdff698890ed Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:06:15 -0400 Subject: [PATCH] docs: update build docs,support Powershell on Windows (#41882) * docs: update build docs,support Powershell on Windows Co-authored-by: nashaofu * chore: fix capitalization Co-authored-by: nashaofu --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: nashaofu --- docs/development/build-instructions-gn.md | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/development/build-instructions-gn.md b/docs/development/build-instructions-gn.md index acf7cf048ac4c..7cc709cddbec1 100644 --- a/docs/development/build-instructions-gn.md +++ b/docs/development/build-instructions-gn.md @@ -110,20 +110,49 @@ $ export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools On Windows: ```sh +# cmd $ cd src $ set CHROMIUM_BUILDTOOLS_PATH=%cd%\buildtools + +# PowerShell +$ cd src +$ $env:CHROMIUM_BUILDTOOLS_PATH = "$(Get-Location)\buildtools" ``` **To generate Testing build config of Electron:** +On Linux & MacOS + +```sh +$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")" +``` + +On Windows: + ```sh +# cmd $ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")" + +# PowerShell +gn gen out/Testing --args="import(\`"//electron/build/args/testing.gn\`")" ``` **To generate Release build config of Electron:** +On Linux & MacOS + +```sh +$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")" +``` + +On Windows: + ```sh +# cmd $ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")" + +# PowerShell +$ gn gen out/Release --args="import(\`"//electron/build/args/release.gn\`")" ``` **Note:** This will generate a `out/Testing` or `out/Release` build directory under `src/` with the testing or release build depending upon the configuration passed above. You can replace `Testing|Release` with another names, but it should be a subdirectory of `out`.