如何获取分支代码,如electron v3.1.6和依赖铬代码?
这是关于电子官方给出的get code.But,它得到了最新的代码。
mkdir电子-gn && cd电子-gn gclient配置\--名称“源/电子”\--非托管\ https://github.com/electron/electron gclient同步--with_branch_heads --with_tags
发布于 2019-11-01 03:39:48
注意,--unmanaged选项允许您更改远程(存储库)和/或分支& gclient不会对此做任何事情。(如果我理解正确的话。)
来自gclient config --help
--非托管覆盖默认行为,使gclient不接触主解决方案成为可能(gclient将检出非托管依赖项,但永远不会同步它们)
因此,您可以进入src/electron文件夹并签出您喜欢的任何分支。下面是我基于official build instructions (YMMV)为此创建的脚本。
#!/bin/bash
GN_DIR=${HOME}/tmp/electron-gn
SRC_DIR=$GN_DIR/src
ELECTRON_REPO_URL=https://github.com/user/electron
ELECTRON_REPO_BRANCH=some_branch
# mkdir -p $HOME/tmp
# cd $HOME/tmp
# git clone https://chromium.googlesource.com/chromium/tools/depot_tools
DEPOT_TOOLS_DIR=${HOME}/tmp/depot_tools
# Add depot_tools to PATH if not already there (need gclient, gn, ninja, cipd, etc.)
[[ ":$PATH:" != *":${DEPOT_TOOLS_DIR}:"* ]] && export PATH="${PATH}:${DEPOT_TOOLS_DIR}"
export GIT_CACHE_PATH="${HOME}/.git_cache"
export SCCACHE_BUCKET="electronjs-sccache-ci"
export SCCACHE_TWO_TIER=true
export CHROMIUM_BUILDTOOLS_PATH=$SRC_DIR/buildtools
export GN_EXTRA_ARGS="${GN_EXTRA_ARGS} cc_wrapper=\"${SRC_DIR}/electron/external_binaries/sccache\""
echo "Configuring environment with gclient"
cd $GN_DIR
gclient config --name "src/electron" --unmanaged $ELECTRON_REPO_URL
gclient sync --with_branch_heads --with_tags
echo "Making sure electron repo is tracking with $ELECTRON_REPO_URL"
cd src/electron
git checkout $ELECTRON_REPO_BRANCH
#git branch --set-upstream-to=origin/$ELECTRON_REPO_BRANCH
git pull
cd -
echo "Making sure electron repo is up to date"
cd src/electron
git pull
gclient sync -f
cd -
cd $SRC_DIR
echo "Generating config"
gn gen out/Debug --args="import(\"//electron/build/args/debug.gn\") $GN_EXTRA_ARGS"
echo "Building"
ninja -C out/Debug electronhttps://stackoverflow.com/questions/55912819
复制相似问题