47 lines
1.4 KiB
Bash
Executable File
47 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
||
|
||
set -ex
|
||
|
||
#添加参数clean,清理编译出的所有内容
|
||
if [ "$1" == "clean" ];then
|
||
git clean -fdx -e '*.deb' -e '*.rpm' #清除新建or添加的文件
|
||
# git reset --hard #清除修改的文件
|
||
exit 0
|
||
fi
|
||
|
||
#修改yarn.lock中地址
|
||
# NPM_URL='https://registry.yarnpkg.com'
|
||
# NPM_LOCAL_SEVER="http://kylinos.zz.gitea.com:3000"
|
||
|
||
# for i in $(find -name yarn.lock); do
|
||
# sed -i "s#${NPM_URL}#${NPM_LOCAL_SEVER}#g" $i
|
||
# done
|
||
|
||
#设置环境变量,构建软件包时,可不下载 electron二进制和 playwright browser包
|
||
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
|
||
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||
|
||
#start build
|
||
#CHILD_CONCURRENCY 控制并行运行以构建节点模块的子进程的数量。
|
||
#将此数字设置为 1 将导致节点模块按顺序构建,这可以避免使用 node-gyp 的 Windows 上的链接器错误。
|
||
# CHILD_CONCURRENCY=1 yarn --frozen-lockfile --check-files --network-timeout 180000
|
||
yarn --frozen-lockfile --check-files --network-timeout 180000
|
||
|
||
#关闭telemetry,node_modules也会有地址
|
||
./close_telemetry.sh
|
||
#检查
|
||
yarn monaco-compile-check
|
||
yarn valid-layers-check
|
||
#编译
|
||
yarn gulp compile-build
|
||
yarn gulp compile-extension-media
|
||
yarn gulp compile-extensions-build
|
||
#压缩代码
|
||
yarn gulp minify-vscode
|
||
yarn gulp "vscode-linux-x64-min-ci" #this will download electron,need change code.
|
||
#打包
|
||
yarn gulp "vscode-linux-x64-build-deb"
|
||
cp .build/linux/deb/*/deb/*.deb .
|
||
|
||
echo "done"
|