build.sh 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. function keep_alive() {
  3. while true; do
  4. echo .
  5. read -t 60 < /proc/self/fd/1 > /dev/null 2>&1
  6. done
  7. }
  8. if [[ "$SHOULD_BUILD" == "yes" ]]; then
  9. export BUILD_SOURCEVERSION=$LATEST_MS_COMMIT
  10. echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}"
  11. echo "BUILD_SOURCEVERSION: ${BUILD_SOURCEVERSION}"
  12. cp -rp src/* vscode/
  13. cd vscode
  14. export npm_config_arch="$BUILDARCH"
  15. export npm_config_target_arch="$BUILDARCH"
  16. ../update_settings.sh
  17. # apply patches
  18. patch -u src/vs/platform/update/electron-main/updateService.win32.ts -i ../patches/update-cache-path.patch
  19. yarn
  20. yarn postinstall
  21. mv product.json product.json.bak
  22. # set fields in product.json
  23. tipsAndTricksUrl='setpath(["tipsAndTricksUrl"]; "https://go.microsoft.com/fwlink/?linkid=852118")'
  24. twitterUrl='setpath(["twitterUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533687")'
  25. requestFeatureUrl='setpath(["requestFeatureUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533482")'
  26. documentationUrl='setpath(["documentationUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533484#vscode")'
  27. introductoryVideosUrl='setpath(["introductoryVideosUrl"]; "https://go.microsoft.com/fwlink/?linkid=832146")'
  28. 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"])'
  29. updateUrl='setpath(["updateUrl"]; "https://vscodium.now.sh")'
  30. releaseNotesUrl='setpath(["releaseNotesUrl"]; "https://go.microsoft.com/fwlink/?LinkID=533483#vscode")'
  31. keyboardShortcutsUrlMac='setpath(["keyboardShortcutsUrlMac"]; "https://go.microsoft.com/fwlink/?linkid=832143")'
  32. keyboardShortcutsUrlLinux='setpath(["keyboardShortcutsUrlLinux"]; "https://go.microsoft.com/fwlink/?linkid=832144")'
  33. keyboardShortcutsUrlWin='setpath(["keyboardShortcutsUrlWin"]; "https://go.microsoft.com/fwlink/?linkid=832145")'
  34. quality='setpath(["quality"]; "stable")'
  35. 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"})'
  36. nameShort='setpath(["nameShort"]; "VSCodium")'
  37. nameLong='setpath(["nameLong"]; "VSCodium")'
  38. linuxIconName='setpath(["linuxIconName"]; "vscodium")'
  39. applicationName='setpath(["applicationName"]; "codium")'
  40. win32MutexName='setpath(["win32MutexName"]; "vscodium")'
  41. win32DirName='setpath(["win32DirName"]; "VSCodium")'
  42. win32NameVersion='setpath(["win32NameVersion"]; "VSCodium")'
  43. win32RegValueName='setpath(["win32RegValueName"]; "VSCodium")'
  44. win32AppUserModelId='setpath(["win32AppUserModelId"]; "Microsoft.VSCodium")'
  45. win32ShellNameShort='setpath(["win32ShellNameShort"]; "VSCodium")'
  46. win32x64UserAppId='setpath (["win32x64UserAppId"]; "{{2E1F05D1-C245-4562-81EE-28188DB6FD17}")'
  47. urlProtocol='setpath(["urlProtocol"]; "vscodium")'
  48. extensionAllowedProposedApi='setpath(["extensionAllowedProposedApi"]; getpath(["extensionAllowedProposedApi"]) + ["ms-vsliveshare.vsliveshare"])'
  49. 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}"
  50. cat product.json.bak | jq "${product_json_changes}" > product.json
  51. cat product.json
  52. ../undo_telemetry.sh
  53. export NODE_ENV=production
  54. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  55. # microsoft adds their apt repo to sources
  56. # unless the app name is code-oss
  57. # as we are renaming the application to vscodium
  58. # we need to edit a line in the post install template
  59. sed -i "s/code-oss/codium/" resources/linux/debian/postinst.template
  60. fi
  61. # this task is very slow on mac, so using a keep alive to keep travis alive
  62. keep_alive &
  63. KA_PID=$!
  64. yarn gulp compile-build
  65. yarn gulp compile-extensions-build
  66. yarn gulp minify-vscode
  67. yarn gulp minify-vscode-reh
  68. yarn gulp minify-vscode-reh-web
  69. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  70. npm install --global create-dmg
  71. yarn gulp vscode-darwin-min-ci
  72. yarn gulp vscode-reh-darwin-min-ci
  73. yarn gulp vscode-reh-web-darwin-min-ci
  74. elif [[ "$CI_WINDOWS" == "True" ]]; then
  75. cp LICENSE.txt LICENSE.rtf # windows build expects rtf license
  76. yarn gulp "vscode-win32-${BUILDARCH}-min-ci"
  77. yarn gulp "vscode-reh-win32-${BUILDARCH}-min-ci"
  78. yarn gulp "vscode-reh-web-win32-${BUILDARCH}-min-ci"
  79. yarn gulp "vscode-win32-${BUILDARCH}-code-helper"
  80. yarn gulp "vscode-win32-${BUILDARCH}-inno-updater"
  81. yarn gulp "vscode-win32-${BUILDARCH}-archive"
  82. yarn gulp "vscode-win32-${BUILDARCH}-system-setup"
  83. yarn gulp "vscode-win32-${BUILDARCH}-user-setup"
  84. else # linux
  85. yarn gulp vscode-linux-${BUILDARCH}-min-ci
  86. yarn gulp vscode-reh-linux-${BUILDARCH}-min-ci
  87. yarn gulp vscode-reh-web-linux-${BUILDARCH}-min-ci
  88. yarn gulp "vscode-linux-${BUILDARCH}-build-deb"
  89. if [[ "$BUILDARCH" != "arm64" ]]; then
  90. yarn gulp "vscode-linux-${BUILDARCH}-build-rpm"
  91. fi
  92. . ../create_appimage.sh
  93. fi
  94. kill $KA_PID
  95. cd ..
  96. fi