2
0

build.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. set -e
  3. function keep_alive_small() {
  4. while true; do
  5. echo .
  6. read -t 60 < /proc/self/fd/1 > /dev/null 2>&1
  7. done
  8. }
  9. function keep_alive() {
  10. while true; do
  11. date
  12. sleep 60
  13. done
  14. }
  15. if [[ "$SHOULD_BUILD" == "yes" ]]; then
  16. export BUILD_SOURCEVERSION=$LATEST_MS_COMMIT
  17. echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}"
  18. echo "BUILD_SOURCEVERSION: ${BUILD_SOURCEVERSION}"
  19. export npm_config_arch="$BUILDARCH"
  20. export npm_config_target_arch="$BUILDARCH"
  21. ./prepare_vscode.sh
  22. cd vscode || exit
  23. # these tasks are very slow, so using a keep alive to keep travis alive
  24. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  25. keep_alive_small &
  26. else
  27. keep_alive &
  28. fi
  29. KA_PID=$!
  30. yarn gulp hygiene
  31. yarn monaco-compile-check
  32. yarn valid-layers-check
  33. yarn gulp compile-build
  34. yarn gulp compile-extensions-build
  35. yarn gulp minify-vscode
  36. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  37. npm install --global create-dmg
  38. yarn gulp vscode-darwin-min-ci
  39. elif [[ "$CI_WINDOWS" == "True" ]]; then
  40. cp LICENSE.txt LICENSE.rtf # windows build expects rtf license
  41. yarn gulp "vscode-win32-${BUILDARCH}-min-ci"
  42. yarn gulp "vscode-win32-${BUILDARCH}-code-helper"
  43. yarn gulp "vscode-win32-${BUILDARCH}-inno-updater"
  44. yarn gulp "vscode-win32-${BUILDARCH}-archive"
  45. yarn gulp "vscode-win32-${BUILDARCH}-system-setup"
  46. yarn gulp "vscode-win32-${BUILDARCH}-user-setup"
  47. else # linux
  48. yarn gulp vscode-linux-${BUILDARCH}-min-ci
  49. yarn gulp "vscode-linux-${BUILDARCH}-build-deb"
  50. if [[ "$BUILDARCH" == "x64" ]]; then
  51. yarn gulp "vscode-linux-${BUILDARCH}-build-rpm"
  52. fi
  53. . ../create_appimage.sh
  54. fi
  55. kill $KA_PID
  56. cd ..
  57. fi