build.sh 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #!/bin/bash
  2. function keep_alive_small() {
  3. while true; do
  4. echo .
  5. read -t 60 < /proc/self/fd/1 > /dev/null 2>&1
  6. done
  7. }
  8. function keep_alive() {
  9. while true; do
  10. date
  11. sleep 60
  12. done
  13. }
  14. if [[ "$SHOULD_BUILD" == "yes" ]]; then
  15. export BUILD_SOURCEVERSION=$LATEST_MS_COMMIT
  16. echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}"
  17. echo "BUILD_SOURCEVERSION: ${BUILD_SOURCEVERSION}"
  18. cp -rp src/* vscode/
  19. cd vscode || exit
  20. export npm_config_arch="$BUILDARCH"
  21. export npm_config_target_arch="$BUILDARCH"
  22. ../update_settings.sh
  23. # apply patches
  24. patch -u src/vs/platform/update/electron-main/updateService.win32.ts -i ../patches/update-cache-path.patch
  25. yarn --frozen-lockfile
  26. yarn postinstall
  27. mv product.json product.json.bak
  28. # set fields in product.json
  29. tipsAndTricksUrl='setpath(["tipsAndTricksUrl"]; "https://go.microsoft.com/fwlink/?linkid=852118")'
  30. twitterUrl='setpath(["twitterUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533687")'
  31. requestFeatureUrl='setpath(["requestFeatureUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533482")'
  32. documentationUrl='setpath(["documentationUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533484#vscode")'
  33. introductoryVideosUrl='setpath(["introductoryVideosUrl"]; "https://go.microsoft.com/fwlink/?linkid=832146")'
  34. extensionAllowedBadgeProviders='setpath(["extensionAllowedBadgeProviders"]; ["api.bintray.com", "api.travis-ci.com", "api.travis-ci.org", "app.fossa.io", "badge.fury.io", "badge.waffle.io", "badgen.net", "badges.frapsoft.com", "badges.gitter.im", "badges.greenkeeper.io", "cdn.travis-ci.com", "cdn.travis-ci.org", "ci.appveyor.com", "circleci.com", "cla.opensource.microsoft.com", "codacy.com", "codeclimate.com", "codecov.io", "coveralls.io", "david-dm.org", "deepscan.io", "dev.azure.com", "flat.badgen.net", "gemnasium.com", "githost.io", "gitlab.com", "godoc.org", "goreportcard.com", "img.shields.io", "isitmaintained.com", "marketplace.visualstudio.com", "nodesecurity.io", "opencollective.com", "snyk.io", "travis-ci.com", "travis-ci.org", "visualstudio.com", "vsmarketplacebadge.apphb.com", "www.bithound.io", "www.versioneye.com"])'
  35. updateUrl='setpath(["updateUrl"]; "https://vscodium.now.sh")'
  36. releaseNotesUrl='setpath(["releaseNotesUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533483#vscode")'
  37. keyboardShortcutsUrlMac='setpath(["keyboardShortcutsUrlMac"]; "https://go.microsoft.com/fwlink/?linkid=832143")'
  38. keyboardShortcutsUrlLinux='setpath(["keyboardShortcutsUrlLinux"]; "https://go.microsoft.com/fwlink/?linkid=832144")'
  39. keyboardShortcutsUrlWin='setpath(["keyboardShortcutsUrlWin"]; "https://go.microsoft.com/fwlink/?linkid=832145")'
  40. quality='setpath(["quality"]; "stable")'
  41. extensionsGallery='setpath(["extensionsGallery"]; {"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", "itemUrl": "https://marketplace.visualstudio.com/items"})'
  42. nameShort='setpath(["nameShort"]; "VSCodium")'
  43. nameLong='setpath(["nameLong"]; "VSCodium")'
  44. linuxIconName='setpath(["linuxIconName"]; "vscodium")'
  45. applicationName='setpath(["applicationName"]; "codium")'
  46. win32MutexName='setpath(["win32MutexName"]; "vscodium")'
  47. win32DirName='setpath(["win32DirName"]; "VSCodium")'
  48. win32NameVersion='setpath(["win32NameVersion"]; "VSCodium")'
  49. win32RegValueName='setpath(["win32RegValueName"]; "VSCodium")'
  50. win32AppUserModelId='setpath(["win32AppUserModelId"]; "Microsoft.VSCodium")'
  51. win32ShellNameShort='setpath(["win32ShellNameShort"]; "VSCodium")'
  52. win32x64UserAppId='setpath (["win32x64UserAppId"]; "{{2E1F05D1-C245-4562-81EE-28188DB6FD17}")'
  53. urlProtocol='setpath(["urlProtocol"]; "vscodium")'
  54. extensionAllowedProposedApi='setpath(["extensionAllowedProposedApi"]; getpath(["extensionAllowedProposedApi"]) + ["ms-vsliveshare.vsliveshare"])'
  55. product_json_changes="${tipsAndTricksUrl} | ${twitterUrl} | ${requestFeatureUrl} | ${documentationUrl} | ${introductoryVideosUrl} | ${extensionAllowedBadgeProviders} | ${updateUrl} | ${releaseNotesUrl} | ${keyboardShortcutsUrlMac} | ${keyboardShortcutsUrlLinux} | ${keyboardShortcutsUrlWin} | ${quality} | ${extensionsGallery} | ${nameShort} | ${nameLong} | ${linuxIconName} | ${applicationName} | ${win32MutexName} | ${win32DirName} | ${win32NameVersion} | ${win32RegValueName} | ${win32AppUserModelId} | ${win32ShellNameShort} | ${win32x64UserAppId} | ${urlProtocol} | ${extensionAllowedProposedApi}"
  56. cat product.json.bak | jq "${product_json_changes}" > product.json
  57. cat product.json
  58. ../undo_telemetry.sh
  59. export NODE_ENV=production
  60. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  61. # microsoft adds their apt repo to sources
  62. # unless the app name is code-oss
  63. # as we are renaming the application to vscodium
  64. # we need to edit a line in the post install template
  65. sed -i "s/code-oss/codium/" resources/linux/debian/postinst.template
  66. fi
  67. # these tasks are very slow, so using a keep alive to keep travis alive
  68. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  69. keep_alive_small &
  70. else
  71. keep_alive &
  72. fi
  73. KA_PID=$!
  74. yarn gulp compile-build
  75. yarn gulp compile-extensions-build
  76. yarn gulp minify-vscode
  77. yarn gulp minify-vscode-reh
  78. yarn gulp minify-vscode-reh-web
  79. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  80. npm install --global create-dmg
  81. yarn gulp vscode-darwin-min-ci
  82. yarn gulp vscode-reh-darwin-min-ci
  83. yarn gulp vscode-reh-web-darwin-min-ci
  84. elif [[ "$CI_WINDOWS" == "True" ]]; then
  85. cp LICENSE.txt LICENSE.rtf # windows build expects rtf license
  86. yarn gulp "vscode-win32-${BUILDARCH}-min-ci"
  87. yarn gulp "vscode-reh-win32-${BUILDARCH}-min-ci"
  88. yarn gulp "vscode-reh-web-win32-${BUILDARCH}-min-ci"
  89. yarn gulp "vscode-win32-${BUILDARCH}-code-helper"
  90. yarn gulp "vscode-win32-${BUILDARCH}-inno-updater"
  91. yarn gulp "vscode-win32-${BUILDARCH}-archive"
  92. yarn gulp "vscode-win32-${BUILDARCH}-system-setup"
  93. yarn gulp "vscode-win32-${BUILDARCH}-user-setup"
  94. else # linux
  95. yarn gulp vscode-linux-${BUILDARCH}-min-ci
  96. yarn gulp vscode-reh-linux-${BUILDARCH}-min-ci
  97. yarn gulp vscode-reh-web-linux-${BUILDARCH}-min-ci
  98. yarn gulp "vscode-linux-${BUILDARCH}-build-deb"
  99. if [[ "$BUILDARCH" == "x64" ]]; then
  100. yarn gulp "vscode-linux-${BUILDARCH}-build-rpm"
  101. fi
  102. . ../create_appimage.sh
  103. fi
  104. kill $KA_PID
  105. cd ..
  106. fi