refactor: shell optimizations

This commit is contained in:
Zac 2023-07-23 11:35:27 -05:00 committed by GitHub
parent 1c0c30e6d6
commit 79baded01d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 112 additions and 167 deletions

View file

@ -30,7 +30,7 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then
if [[ "${OS_NAME}" == "osx" ]]; then
yarn gulp "vscode-darwin-${VSCODE_ARCH}-min-ci"
find "../VSCode-darwin-${VSCODE_ARCH}" -exec touch {} \;
find "../VSCode-darwin-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
VSCODE_PLATFORM="darwin"
elif [[ "${OS_NAME}" == "windows" ]]; then
@ -48,7 +48,7 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then
else # linux
yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
find "../VSCode-linux-${VSCODE_ARCH}" -exec touch {} \;
find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
VSCODE_PLATFORM="linux"
fi

View file

@ -49,7 +49,7 @@ fi
sed -i "s|@@PRODUCT_UPGRADE_CODE@@|${PRODUCT_UPGRADE_CODE}|g" .\\includes\\vscodium-variables.wxi
sed -i "s|@@PRODUCT_NAME@@|${PRODUCT_NAME}|g" .\\vscodium.xsl
find i18n -name '*.wxl' -exec sed -i "s|@@PRODUCT_NAME@@|${PRODUCT_NAME}|g" {} \;
find i18n -name '*.wxl' -print0 | xargs -0 sed -i "s|@@PRODUCT_NAME@@|${PRODUCT_NAME}|g"
BuildSetupTranslationTransform() {
local CULTURE=${1}

View file

@ -5,10 +5,10 @@ set -e
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "Will not build because no GITHUB_TOKEN defined"
exit
exit 0
fi
APP_NAME_LC=$( echo "${APP_NAME}" | awk '{print tolower($0)}' )
APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )"
GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${ASSETS_REPOSITORY}/releases/latest" )
LATEST_VERSION=$( echo "${GITHUB_RESPONSE}" | jq -c -r '.tag_name' )
@ -58,21 +58,21 @@ if [[ "${ASSETS}" != "null" ]]; then
fi
fi
if [[ -z $( contains "${APP_NAME}-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if contains "${APP_NAME}-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"; then
echo "Building on MacOS because we have no ZIP"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi
if [[ -z $( contains ".${VSCODE_ARCH}.${RELEASE_VERSION}.dmg" ) ]]; then
if contains ".${VSCODE_ARCH}.${RELEASE_VERSION}.dmg"; then
echo "Building on MacOS because we have no DMG"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DMG="no"
fi
if [[ -z $( contains "${APP_NAME_LC}-reh-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME_LC}-reh-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz"; then
echo "Building on MacOS because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -86,21 +86,21 @@ if [[ "${ASSETS}" != "null" ]]; then
# windows-arm64
if [[ "${VSCODE_ARCH}" == "arm64" ]]; then
if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"; then
echo "Building on Windows arm64 because we have no system setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"; then
echo "Building on Windows arm64 because we have no user setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"; then
echo "Building on Windows arm64 because we have no zip"
export SHOULD_BUILD="yes"
else
@ -115,42 +115,42 @@ if [[ "${ASSETS}" != "null" ]]; then
# windows-ia32
elif [[ "${VSCODE_ARCH}" == "ia32" ]]; then
if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"; then
echo "Building on Windows ia32 because we have no system setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"; then
echo "Building on Windows ia32 because we have no user setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"; then
echo "Building on Windows ia32 because we have no zip"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
if contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi"; then
echo "Building on Windows ia32 because we have no msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
if contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi"; then
echo "Building on Windows ia32 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi
if [[ -z $( contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Windows ia32 because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -163,42 +163,42 @@ if [[ "${ASSETS}" != "null" ]]; then
# windows-x64
else
if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"; then
echo "Building on Windows x64 because we have no system setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
if contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe"; then
echo "Building on Windows x64 because we have no user setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
if contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip"; then
echo "Building on Windows x64 because we have no zip"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
if contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi"; then
echo "Building on Windows x64 because we have no msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi
if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
if contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi"; then
echo "Building on Windows x64 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi
if [[ -z $( contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Windows x64 because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -213,28 +213,28 @@ if [[ "${ASSETS}" != "null" ]]; then
# linux-arm64
if [[ "${VSCODE_ARCH}" == "arm64" ]]; then
if [[ -z $( contains "arm64.deb" ) ]]; then
if contains "arm64.deb"; then
echo "Building on Linux arm64 because we have no DEB"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi
if [[ -z $( contains "aarch64.rpm" ) ]]; then
if contains "aarch64.rpm"; then
echo "Building on Linux arm64 because we have no RPM"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "${APP_NAME}-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME}-linux-arm64-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Linux arm64 because we have no TAR"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
if [[ -z $( contains "${APP_NAME_LC}-reh-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME_LC}-reh-linux-arm64-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Linux arm64 because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -249,28 +249,28 @@ if [[ "${ASSETS}" != "null" ]]; then
# linux-armhf
elif [[ "${VSCODE_ARCH}" == "armhf" ]]; then
if [[ -z $( contains "armhf.deb" ) ]]; then
if contains "armhf.deb"; then
echo "Building on Linux arm because we have no DEB"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi
if [[ -z $( contains "armv7hl.rpm" ) ]]; then
if contains "armv7hl.rpm"; then
echo "Building on Linux arm because we have no RPM"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "${APP_NAME}-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME}-linux-armhf-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Linux arm because we have no TAR"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
if [[ -z $( contains "${APP_NAME_LC}-reh-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME_LC}-reh-linux-armhf-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Linux arm because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -290,7 +290,7 @@ if [[ "${ASSETS}" != "null" ]]; then
SHOULD_BUILD_RPM="no"
SHOULD_BUILD_TAR="no"
if [[ -z $( contains "${APP_NAME_LC}-reh-linux-ppc64le-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME_LC}-reh-linux-ppc64le-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Linux PowerPC64LE because we have no REH archive"
export SHOULD_BUILD="yes"
else
@ -303,35 +303,35 @@ if [[ "${ASSETS}" != "null" ]]; then
# linux-x64
else
if [[ -z $( contains "amd64.deb" ) ]]; then
if contains "amd64.deb"; then
echo "Building on Linux x64 because we have no DEB"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi
if [[ -z $( contains "x86_64.rpm" ) ]]; then
if contains "x86_64.rpm"; then
echo "Building on Linux x64 because we have no RPM"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "${APP_NAME}-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME}-linux-x64-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Linux x64 because we have no TAR"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
if [[ -z $( contains "x86_64.AppImage" ) ]]; then
if contains "x86_64.AppImage"; then
echo "Building on Linux x64 because we have no AppImage"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_APPIMAGE="no"
fi
if [[ -z $( contains "${APP_NAME_LC}-reh-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
if contains "${APP_NAME_LC}-reh-linux-x64-${RELEASE_VERSION}.tar.gz"; then
echo "Building on Linux x64 because we have no REH archive"
export SHOULD_BUILD="yes"
else

View file

@ -24,7 +24,7 @@ check_programs() { # {{{
for arg in "$@"; do
if ! command -v "${arg}" &> /dev/null; then
echo "${arg} could not be found"
exit
exit 0
fi
done
} # }}}
@ -37,7 +37,7 @@ SRC_PREFIX=""
VSCODE_PREFIX=""
build_darwin_main() { # {{{
if [ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/darwin/code.icns" ]; then
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/darwin/code.icns" ]]; then
rsvg-convert -w 655 -h 655 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite "code_logo.png" -gravity center "icons/template_macos.png" "code_1024.png"
convert "code_1024.png" -resize 512x512 code_512.png
@ -57,7 +57,7 @@ build_darwin_types() { # {{{
if [[ -f "${file}" ]]; then
name=$(basename "${file}" '.icns')
if [[ ${name} != 'code' ]] && [ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/darwin/${name}.icns" ]; then
if [[ "${name}" != 'code' ]] && [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/darwin/${name}.icns" ]]; then
icns2png -x -s 512x512 "${file}" -o .
composite -blend 100% -geometry +323+365 "icons/corner_512.png" "${name}_512x512x32.png" "${name}.png"
@ -100,6 +100,28 @@ build_windows_main() { # {{{
fi
} # }}}
build_windows_type() {
local FILE_PATH IMG_SIZE IMG_BG_COLOR LOGO_SIZE GRAVITY
FILE_PATH="$1"
IMG_SIZE="$2"
IMG_BG_COLOR="$3"
LOGO_SIZE="$4"
GRAVITY="$5"
if [[ ! -f "${FILE_PATH}" ]]; then
if [[ "${FILE_PATH##*.}" == "png" ]]; then
convert -size "${IMG_SIZE}" "${IMG_BG_COLOR}" PNG32:"${FILE_PATH}"
else
convert -size "${IMG_SIZE}" "${IMG_BG_COLOR}" "${FILE_PATH}"
fi
rsvg-convert -w "${LOGO_SIZE}" -h "${LOGO_SIZE}" "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity "${GRAVITY}" "code_logo.png" "${FILE_PATH}" "${FILE_PATH}"
fi
}
build_windows_types() { # {{{
mkdir -p "${SRC_PREFIX}src/${QUALITY}/resources/win32"
@ -109,7 +131,7 @@ build_windows_types() { # {{{
if [[ -f "${file}" ]]; then
name=$(basename "${file}" '.ico')
if [[ ${name} != 'code' ]] && [ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/${name}.ico" ]; then
if [[ "${name}" != 'code' ]] && [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/${name}.ico" ]]; then
icotool -x -w 256 "${file}"
composite -geometry +150+185 "code_logo.png" "${name}_9_256x256x32.png" "${name}.png"
@ -121,99 +143,24 @@ build_windows_types() { # {{{
fi
done
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_70x70.png" ]]; then
convert -size 70x70 canvas:transparent PNG32:"${SRC_PREFIX}src/${QUALITY}/resources/win32/code_70x70.png"
rsvg-convert -w 45 -h 45 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_70x70.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_70x70.png"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_150x150.png" ]]; then
convert -size 150x150 canvas:transparent PNG32:"${SRC_PREFIX}src/${QUALITY}/resources/win32/code_150x150.png"
rsvg-convert -w 64 -h 64 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -geometry +44+25 "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_150x150.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_150x150.png"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-100.bmp" ]]; then
convert -size 164x314 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-100.bmp"
rsvg-convert -w 126 -h 126 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-100.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-100.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-125.bmp" ]]; then
convert -size 192x386 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-125.bmp"
rsvg-convert -w 147 -h 147 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-125.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-125.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-150.bmp" ]]; then
convert -size 246x459 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-150.bmp"
rsvg-convert -w 190 -h 190 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-150.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-150.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-175.bmp" ]]; then
convert -size 273x556 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-175.bmp"
rsvg-convert -w 211 -h 211 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-175.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-175.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-200.bmp" ]]; then
convert -size 328x604 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-200.bmp"
rsvg-convert -w 255 -h 255 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-200.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-200.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-225.bmp" ]]; then
convert -size 355x700 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-225.bmp"
rsvg-convert -w 273 -h 273 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-225.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-225.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-250.bmp" ]]; then
convert -size 410x797 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-250.bmp"
rsvg-convert -w 317 -h 317 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-250.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-250.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-100.bmp" ]]; then
convert -size 55x55 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-100.bmp"
rsvg-convert -w 44 -h 44 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-100.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-100.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-125.bmp" ]]; then
convert -size 64x68 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-125.bmp"
rsvg-convert -w 52 -h 52 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-125.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-125.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-150.bmp" ]]; then
convert -size 83x80 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-150.bmp"
rsvg-convert -w 63 -h 63 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-150.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-150.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-175.bmp" ]]; then
convert -size 92x97 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-175.bmp"
rsvg-convert -w 76 -h 76 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-175.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-175.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-200.bmp" ]]; then
convert -size 110x106 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-200.bmp"
rsvg-convert -w 86 -h 86 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-200.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-200.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-225.bmp" ]]; then
convert -size 119x123 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-225.bmp"
rsvg-convert -w 103 -h 103 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-225.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-225.bmp"
fi
if [[ ! -f "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-250.bmp" ]]; then
convert -size 138x140 xc:white "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-250.bmp"
rsvg-convert -w 116 -h 116 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -gravity center "code_logo.png" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-250.bmp" "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-250.bmp"
fi
if [[ ! -f "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-banner.bmp" ]]; then
convert -size 493x58 xc:white "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-banner.bmp"
rsvg-convert -w 50 -h 50 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -geometry +438+6 "code_logo.png" "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-banner.bmp" "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-banner.bmp"
fi
if [[ ! -f "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-dialog.bmp" ]]; then
convert -size 493x312 xc:white "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-dialog.bmp"
rsvg-convert -w 120 -h 120 "icons/${QUALITY}/codium_cnl.svg" -o "code_logo.png"
composite -geometry +22+152 "code_logo.png" "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-dialog.bmp" "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-dialog.bmp"
fi
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_70x70.png" "70x70" "canvas:transparent" "45" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/code_150x150.png" "150x150" "canvas:transparent" "64" "+44+25"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-100.bmp" "164x314" "xc:white" "126" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-125.bmp" "192x386" "xc:white" "147" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-150.bmp" "246x459" "xc:white" "190" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-175.bmp" "273x556" "xc:white" "211" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-200.bmp" "328x604" "xc:white" "255" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-225.bmp" "355x700" "xc:white" "273" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-big-250.bmp" "410x797" "xc:white" "317" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-100.bmp" "55x55" "xc:white" "44" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-125.bmp" "64x68" "xc:white" "52" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-150.bmp" "83x80" "xc:white" "63" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-175.bmp" "92x97" "xc:white" "76" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-200.bmp" "110x106" "xc:white" "86" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-225.bmp" "119x123" "xc:white" "103" "center"
build_windows_type "${SRC_PREFIX}src/${QUALITY}/resources/win32/inno-small-250.bmp" "138x140" "xc:white" "116" "center"
build_windows_type "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-banner.bmp" "493x58" "xc:white" "50" "+438+6"
build_windows_type "${SRC_PREFIX}build/windows/msi/resources/${QUALITY}/wix-dialog.bmp" "493x312" "xc:white" "120" "+22+152"
rm code_logo.png
} # }}}

View file

@ -3,7 +3,7 @@
set -e
APP_NAME_LC=$( echo "${APP_NAME}" | awk '{print tolower($0)}' )
APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )"
npm install -g checksum
@ -180,8 +180,7 @@ fi
cd assets
for FILE in *
do
for FILE in *; do
if [[ -f "${FILE}" ]]; then
sum_file "${FILE}"
fi

View file

@ -25,7 +25,7 @@ for file in ../patches/*.patch; do
if [[ -f "${file}" ]]; then
echo applying patch: "${file}";
if ! git apply --ignore-whitespace "${file}"; then
echo failed to apply patch "${file}" 1>&2
echo failed to apply patch "${file}" >&2
fi
fi
done
@ -35,7 +35,7 @@ if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
if [[ -f "${file}" ]]; then
echo applying patch: "${file}";
if ! git apply --ignore-whitespace "${file}"; then
echo failed to apply patch "${file}" 1>&2
echo failed to apply patch "${file}" >&2
fi
fi
done
@ -45,7 +45,7 @@ for file in ../patches/user/*.patch; do
if [[ -f "${file}" ]]; then
echo applying user patch: "${file}";
if ! git apply --ignore-whitespace "${file}"; then
echo failed to apply patch "${file}" 1>&2
echo failed to apply patch "${file}" >&2
fi
fi
done
@ -99,7 +99,7 @@ setpath_json() {
}
# product.json
cp product.json product.json.bak
cp product.json{,.bak}
setpath "product" "checksumFailMoreInfoUrl" "https://go.microsoft.com/fwlink/?LinkId=828886"
setpath "product" "documentationUrl" "https://go.microsoft.com/fwlink/?LinkID=533484#vscode"
@ -169,13 +169,12 @@ else
fi
jsonTmp=$( jq -s '.[0] * .[1]' product.json ../product.json )
echo "${jsonTmp}" > ../product.json
unset jsonTmp
echo "${jsonTmp}" > ../product.json && unset jsonTmp
cat product.json
# package.json
cp package.json package.json.bak
cp package.json{,.bak}
setpath "package" "version" "$( echo "${RELEASE_VERSION}" | sed -n -E "s/^(.*)\.([0-9]+)(-insider)?$/\1/p" )"
setpath "package" "release" "$( echo "${RELEASE_VERSION}" | sed -n -E "s/^(.*)\.([0-9]+)(-insider)?$/\2/p" )"

View file

@ -30,8 +30,7 @@ cd assets
set +e
for FILE in *
do
for FILE in *; do
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
echo "::group::Uploading '${FILE}' at $( date "+%T" )"
gh release upload --repo "${ASSETS_REPOSITORY}" "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
@ -40,8 +39,7 @@ do
echo "exit: ${EXIT_STATUS}"
if (( "${EXIT_STATUS}" )); then
for (( i=0; i<10; i++ ))
do
for (( i=0; i<10; i++ )); do
github-release delete --owner "${REPOSITORY_OWNER}" --repo "${REPOSITORY_NAME}" --tag "${RELEASE_VERSION}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
sleep $(( 15 * (i + 1)))

View file

@ -4,12 +4,12 @@ set -e
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Will not update version JSON because we did not build"
exit
exit 0
fi
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "Will not update insider.json because no GITHUB_TOKEN defined"
exit
exit 0
fi
jsonTmp=$( jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. "insider.json" | .tag=$tag | .commit=$commit' )

View file

@ -12,23 +12,25 @@ NLS=workbench.settings.enableNaturalLanguageSearch
. ../utils.sh
update_setting () {
local FILENAME="${2}"
local FILENAME SETTING LINE_NUM IN_SETTING FOUND DEFAULT_TRUE_TO_FALSE
FILENAME="${2}"
# check that the file exists
if [ ! -f "${FILENAME}" ]; then
if [[ ! -f "${FILENAME}" ]]; then
echo "File to update setting in does not exist ${FILENAME}"
return
fi
# go through lines of file, looking for block that contains setting
local SETTING="${1}"
local LINE_NUM=0
SETTING="${1}"
LINE_NUM=0
while read -r line; do
local LINE_NUM=$(( LINE_NUM + 1 ))
LINE_NUM=$(( LINE_NUM + 1 ))
if [[ "${line}" == *"${SETTING}"* ]]; then
local IN_SETTING=1
IN_SETTING=1
fi
if [[ ("${line}" == *"${DEFAULT_TRUE}"* || "${line}" == *"${DEFAULT_ON}"*) && "${IN_SETTING}" == "1" ]]; then
local FOUND=1
FOUND=1
break
fi
done < "${FILENAME}"
@ -40,9 +42,9 @@ update_setting () {
# construct line-aware replacement string
if [[ "${line}" == *"${DEFAULT_TRUE}"* ]]; then
local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_TRUE}/${DEFAULT_FALSE}/"
DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_TRUE}/${DEFAULT_FALSE}/"
else
local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_ON}/${DEFAULT_OFF}/"
DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_ON}/${DEFAULT_OFF}/"
fi
replace "${DEFAULT_TRUE_TO_FALSE}" "${FILENAME}"

View file

@ -5,12 +5,12 @@ set -e
if [[ "${SHOULD_BUILD}" != "yes" && "${FORCE_UPDATE}" != "true" ]]; then
echo "Will not update version JSON because we did not build"
exit
exit 0
fi
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "Will not update version JSON because no GITHUB_TOKEN defined"
exit
exit 0
fi
if [[ "${FORCE_UPDATE}" == "true" ]]; then
@ -19,12 +19,12 @@ fi
if [[ -z "${BUILD_SOURCEVERSION}" ]]; then
echo "Will not update version JSON because no BUILD_SOURCEVERSION defined"
exit
exit 0
fi
if [[ "${VSCODE_ARCH}" == "ppc64le" ]]; then
echo "Skip ppc64le since only reh is published"
exit
exit 0
fi
# {
@ -98,7 +98,7 @@ updateLatestVersion() {
echo "CURRENT_VERSION: ${CURRENT_VERSION}"
if [[ "${CURRENT_VERSION}" == "${RELEASE_VERSION}" && "${FORCE_UPDATE}" != "true" ]]; then
return
return 0
fi
fi