зеркало из https://github.com/electron/electron.git
build: use GIT_CACHE_PATH (#14165)
* build: add GIT_CACHE_PATH The merge at https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1105473 was to specify git cache entirely from the environment variable [and] removal of the general --cache-dir option from gclient * docs: document GIT_CACHE_PATH in GN build * fix: try to fix appveyor-gn env syntax
This commit is contained in:
Родитель
59d6c1e063
Коммит
51b76f0635
|
@ -154,6 +154,7 @@ gn-build-steps: &gn-build-steps
|
||||||
command: |
|
command: |
|
||||||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
echo 'export PATH="$PATH:'"$PWD"'/depot_tools"' >> $BASH_ENV
|
echo 'export PATH="$PATH:'"$PWD"'/depot_tools"' >> $BASH_ENV
|
||||||
|
echo 'export GIT_CACHE_PATH="$HOME/.gclient-cache"' >> $BASH_ENV
|
||||||
- checkout:
|
- checkout:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -168,7 +169,7 @@ gn-build-steps: &gn-build-steps
|
||||||
gclient config \
|
gclient config \
|
||||||
--name "src/electron" \
|
--name "src/electron" \
|
||||||
--unmanaged \
|
--unmanaged \
|
||||||
--cache-dir "$HOME/.gclient-cache" \
|
--cache-dir "${GIT_CACHE_PATH}" \
|
||||||
$GCLIENT_EXTRA_ARGS \
|
$GCLIENT_EXTRA_ARGS \
|
||||||
"$CIRCLE_REPOSITORY_URL"
|
"$CIRCLE_REPOSITORY_URL"
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ branches:
|
||||||
build_cloud: libcc-20
|
build_cloud: libcc-20
|
||||||
image: libcc-20-vs2017-15.4.5
|
image: libcc-20-vs2017-15.4.5
|
||||||
environment:
|
environment:
|
||||||
|
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
|
||||||
DISABLE_CRASH_REPORTER_TESTS: true
|
DISABLE_CRASH_REPORTER_TESTS: true
|
||||||
ELECTRON_ENABLE_LOGGING: true
|
ELECTRON_ENABLE_LOGGING: true
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -24,7 +25,7 @@ build_script:
|
||||||
gclient config
|
gclient config
|
||||||
--name "src\electron"
|
--name "src\electron"
|
||||||
--unmanaged
|
--unmanaged
|
||||||
--cache-dir "C:\Users\electron\libcc_cache"
|
--cache-dir "${GIT_CACHE_PATH}"
|
||||||
"https://github.com/electron/electron"
|
"https://github.com/electron/electron"
|
||||||
- gclient sync --with_branch_heads --with_tags
|
- gclient sync --with_branch_heads --with_tags
|
||||||
- cd src
|
- cd src
|
||||||
|
|
|
@ -29,6 +29,19 @@ try to download a Google-internal version that only Googlers have access to).
|
||||||
|
|
||||||
## Getting the Code
|
## Getting the Code
|
||||||
|
|
||||||
|
### Using a Git cache (optional step)
|
||||||
|
|
||||||
|
`gclient` fetches about 16G worth of repository data. If you plan on building
|
||||||
|
more than once, consider using its cache feature to make future calls faster:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ export GIT_CACHE_PATH="$HOME/.git_cache"
|
||||||
|
$ mkdir -p "$GIT_CACHE_PATH"
|
||||||
|
# This will take about 16G.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Getting the code with gclient
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ mkdir electron-gn && cd electron-gn
|
$ mkdir electron-gn && cd electron-gn
|
||||||
$ gclient config \
|
$ gclient config \
|
||||||
|
|
|
@ -11,11 +11,12 @@ phases:
|
||||||
name: Setup_depot_tools
|
name: Setup_depot_tools
|
||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
|
export GIT_CACHE_PATH="/Users/electron/libcc_cache"
|
||||||
set -ex
|
set -ex
|
||||||
gclient config \
|
gclient config \
|
||||||
--name "src/electron" \
|
--name "src/electron" \
|
||||||
--unmanaged \
|
--unmanaged \
|
||||||
--cache-dir "/Users/electron/libcc_cache" \
|
--cache-dir "${GIT_CACHE_PATH}" \
|
||||||
"https://github.com/electron/electron"
|
"https://github.com/electron/electron"
|
||||||
mkdir src
|
mkdir src
|
||||||
git clone https://github.com/electron/electron src/electron
|
git clone https://github.com/electron/electron src/electron
|
||||||
|
|
Загрузка…
Ссылка в новой задаче