build.sh 5.7 KB

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