vscodium/build/build.sh

92 lines
2.0 KiB
Bash
Raw Normal View History

2022-08-29 16:13:25 +03:00
#!/bin/bash
### Windows
# to run with Bash: "C:\Program Files\Git\bin\bash.exe" ./build/build.sh
###
2022-10-06 23:15:41 +03:00
export APP_NAME="VSCodium"
2022-08-29 22:56:51 +03:00
export CI_BUILD="no"
export SHOULD_BUILD="yes"
export SKIP_BUILD="no"
2022-10-06 23:15:41 +03:00
export SKIP_ASSETS="yes"
2022-08-29 16:13:25 +03:00
export VSCODE_LATEST="no"
export VSCODE_QUALITY="stable"
while getopts ":ilop" opt; do
2022-08-29 16:13:25 +03:00
case "$opt" in
i)
export VSCODE_QUALITY="insider"
;;
l)
export VSCODE_LATEST="yes"
;;
o)
export SKIP_BUILD="yes"
;;
p)
2022-10-06 23:15:41 +03:00
export SKIP_ASSETS="no"
;;
2022-08-29 16:13:25 +03:00
esac
done
case "${OSTYPE}" in
darwin*)
export OS_NAME="osx"
;;
msys* | cygwin*)
export OS_NAME="windows"
;;
*)
export OS_NAME="linux"
;;
esac
UNAME_ARCH=$( uname -m )
if [[ "${UNAME_ARCH}" == "arm64" ]]; then
export VSCODE_ARCH="arm64"
else
export VSCODE_ARCH="x64"
fi
echo "OS_NAME=\"${OS_NAME}\""
echo "SKIP_BUILD=\"${SKIP_BUILD}\""
2022-10-06 23:15:41 +03:00
echo "SKIP_ASSETS=\"${SKIP_ASSETS}\""
echo "VSCODE_ARCH=\"${VSCODE_ARCH}\""
echo "VSCODE_LATEST=\"${VSCODE_LATEST}\""
echo "VSCODE_QUALITY=\"${VSCODE_QUALITY}\""
2022-08-29 16:13:25 +03:00
if [[ "${SKIP_BUILD}" == "no" ]]; then
rm -rf vscode* VSCode*
. get_repo.sh
2022-11-04 14:48:12 +03:00
. version.sh
# save variables for later
echo "MS_TAG=\"${MS_TAG}\"" > build.env
echo "MS_COMMIT=\"${MS_COMMIT}\"" >> build.env
echo "RELEASE_VERSION=\"${RELEASE_VERSION}\"" >> build.env
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\"" >> build.env
2022-08-29 16:13:25 +03:00
. build.sh
if [[ "${VSCODE_QUALITY}" == "insider" && "${VSCODE_LATEST}" == "yes" ]]; then
echo "$( cat "insider.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )" > "insider.json"
fi
else
. build.env
2022-08-29 16:13:25 +03:00
echo "MS_TAG=\"${MS_TAG}\""
echo "MS_COMMIT=\"${MS_COMMIT}\""
echo "RELEASE_VERSION=\"${RELEASE_VERSION}\""
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""
fi
2022-10-06 23:15:41 +03:00
if [[ "${SKIP_ASSETS}" == "no" ]]; then
if [[ "${OS_NAME}" == "windows" ]]; then
rm -rf build/windows/msi/releasedir
fi
2022-10-06 23:15:41 +03:00
. prepare_assets.sh
fi