build.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env bash
  2. # shellcheck disable=SC1091
  3. set -ex
  4. . version.sh
  5. if [[ "${SHOULD_BUILD}" == "yes" ]]; then
  6. echo "MS_COMMIT=\"${MS_COMMIT}\""
  7. . prepare_vscode.sh
  8. cd vscode || { echo "'vscode' dir not found"; exit 1; }
  9. export NODE_OPTIONS="--max-old-space-size=8192"
  10. npm run monaco-compile-check
  11. npm run valid-layers-check
  12. npm run gulp compile-build-without-mangling
  13. npm run gulp compile-extension-media
  14. npm run gulp compile-extensions-build
  15. npm run gulp minify-vscode
  16. if [[ "${OS_NAME}" == "osx" ]]; then
  17. # remove win32 node modules
  18. rm -f .build/extensions/ms-vscode.js-debug/src/win32-app-container-tokens.*.node
  19. # generate Group Policy definitions
  20. node build/lib/policies darwin
  21. npm run gulp "vscode-darwin-${VSCODE_ARCH}-min-ci"
  22. find "../VSCode-darwin-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
  23. . ../build_cli.sh
  24. VSCODE_PLATFORM="darwin"
  25. elif [[ "${OS_NAME}" == "windows" ]]; then
  26. # generate Group Policy definitions
  27. node build/lib/policies win32
  28. # in CI, packaging will be done by a different job
  29. if [[ "${CI_BUILD}" == "no" ]]; then
  30. . ../build/windows/rtf/make.sh
  31. npm run gulp "vscode-win32-${VSCODE_ARCH}-min-ci"
  32. if [[ "${VSCODE_ARCH}" != "x64" ]]; then
  33. SHOULD_BUILD_REH="no"
  34. SHOULD_BUILD_REH_WEB="no"
  35. fi
  36. . ../build_cli.sh
  37. fi
  38. VSCODE_PLATFORM="win32"
  39. else # linux
  40. # remove win32 node modules
  41. rm -f .build/extensions/ms-vscode.js-debug/src/win32-app-container-tokens.*.node
  42. # in CI, packaging will be done by a different job
  43. if [[ "${CI_BUILD}" == "no" ]]; then
  44. npm run gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
  45. find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c
  46. . ../build_cli.sh
  47. fi
  48. VSCODE_PLATFORM="linux"
  49. fi
  50. if [[ "${SHOULD_BUILD_REH}" != "no" ]]; then
  51. npm run gulp minify-vscode-reh
  52. npm run gulp "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci"
  53. fi
  54. if [[ "${SHOULD_BUILD_REH_WEB}" != "no" ]]; then
  55. npm run gulp minify-vscode-reh-web
  56. npm run gulp "vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci"
  57. fi
  58. cd ..
  59. fi