зеркало из https://github.com/electron/electron.git
build: update devcontainer and use latest codespaces features (#36422)
* build: update devcontainer to latest build image * build: add update-content-command * build: set good vscode config * build: be less noisy in update command * build: only run sync in prebuild environment * build: list env vars * build: run sync always
This commit is contained in:
Родитель
c6d6af2551
Коммит
2751c2b07f
|
@ -4,14 +4,13 @@ Welcome to the Codespaces Electron Developer Environment.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
Upon creation of your codespace you should have [build tools](https://github.com/electron/build-tools) installed and an initialized gclient checkout of Electron. In order to build electron you'll need to run the following commands.
|
Upon creation of your codespace you should have [build tools](https://github.com/electron/build-tools) installed and an initialized gclient checkout of Electron. In order to build electron you'll need to run the following command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
e sync -vv
|
|
||||||
e build
|
e build
|
||||||
```
|
```
|
||||||
|
|
||||||
The initial sync will take approximately ~30 minutes and the build will take ~8 minutes. Incremental syncs and incremental builds are substantially quicker.
|
The initial build will take ~8 minutes. Incremental builds are substantially quicker. If you pull changes from upstream that touch either the `patches` folder or the `DEPS` folder you will have to run `e sync` in order to keep your checkout up to date.
|
||||||
|
|
||||||
## Directory Structure
|
## Directory Structure
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
"service": "buildtools",
|
"service": "buildtools",
|
||||||
"onCreateCommand": ".devcontainer/on-create-command.sh",
|
"onCreateCommand": ".devcontainer/on-create-command.sh",
|
||||||
|
"updateContentCommand": ".devcontainer/update-content-command.sh",
|
||||||
"workspaceFolder": "/workspaces/gclient/src/electron",
|
"workspaceFolder": "/workspaces/gclient/src/electron",
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"joeleinbinder.mojom-language",
|
"joeleinbinder.mojom-language",
|
||||||
|
@ -11,14 +12,28 @@
|
||||||
"mutantdino.resourcemonitor",
|
"mutantdino.resourcemonitor",
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"shakram02.bash-beautify",
|
"shakram02.bash-beautify",
|
||||||
"marshallofsound.gnls-electron"
|
"marshallofsound.gnls-electron",
|
||||||
|
"CircleCI.circleci"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"bashBeautify.tabSize": 2,
|
||||||
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
"[gn]": {
|
"[gn]": {
|
||||||
"editor.formatOnSave": true
|
"editor.formatOnSave": true
|
||||||
},
|
},
|
||||||
"editor.tabSize": 2,
|
"[javascript]": {
|
||||||
"bashBeautify.tabSize": 2
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"javascript.preferences.quoteStyle": "single",
|
||||||
|
"typescript.preferences.quoteStyle": "single"
|
||||||
},
|
},
|
||||||
"forwardPorts": [8088, 6080, 5901],
|
"forwardPorts": [8088, 6080, 5901],
|
||||||
"portsAttributes": {
|
"portsAttributes": {
|
||||||
|
@ -36,8 +51,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hostRequirements": {
|
"hostRequirements": {
|
||||||
"storage": "32gb",
|
"storage": "128gb",
|
||||||
"cpus": 8
|
"cpus": 16
|
||||||
},
|
},
|
||||||
"remoteUser": "builduser"
|
"remoteUser": "builduser",
|
||||||
|
"customizations": {
|
||||||
|
"codespaces": {
|
||||||
|
"openFiles": [
|
||||||
|
".devcontainer/README.md"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@ version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
buildtools:
|
buildtools:
|
||||||
image: ghcr.io/electron/devcontainer:27db4a3e3512bfd2e47f58cea69922da0835f1d9
|
image: ghcr.io/electron/devcontainer:3d8d44d0f15b05bef6149e448f9cc522111847e9
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ..:/workspaces/gclient/src/electron:cached
|
- ..:/workspaces/gclient/src/electron:cached
|
||||||
|
|
|
@ -10,6 +10,7 @@ export PATH="$PATH:$buildtools/src"
|
||||||
|
|
||||||
# Create the persisted buildtools config folder
|
# Create the persisted buildtools config folder
|
||||||
mkdir -p $buildtools_configs
|
mkdir -p $buildtools_configs
|
||||||
|
mkdir -p $gclient_root/.git-cache
|
||||||
rm -f $buildtools/configs
|
rm -f $buildtools/configs
|
||||||
ln -s $buildtools_configs $buildtools/configs
|
ln -s $buildtools_configs $buildtools/configs
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
buildtools=$HOME/.electron_build_tools
|
||||||
|
|
||||||
|
export PATH="$PATH:$buildtools/src"
|
||||||
|
|
||||||
|
# Sync latest
|
||||||
|
e d gclient sync --with_branch_heads --with_tags
|
Загрузка…
Ссылка в новой задаче