build-version.patch 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  2. index 595d0ce..99bfe30 100644
  3. --- a/build/gulpfile.reh.js
  4. +++ b/build/gulpfile.reh.js
  5. @@ -290,4 +290,5 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  6. const name = product.nameShort;
  7. + const release = packageJson.release;
  8. const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' })
  9. - .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined }));
  10. + .pipe(json({ name, version, release, dependencies: undefined, optionalDependencies: undefined }));
  11. @@ -296,3 +297,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  12. const productJsonStream = gulp.src(['product.json'], { base: '.' })
  13. - .pipe(json({ commit, date, version }));
  14. + .pipe(json({ commit, date, version, release }));
  15. diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
  16. index e1507e0..9a12a12 100644
  17. --- a/build/gulpfile.vscode.js
  18. +++ b/build/gulpfile.vscode.js
  19. @@ -233,3 +233,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  20. - let version = packageJson.version;
  21. + let version = packageJson.version
  22. const quality = product.quality;
  23. @@ -241,3 +241,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  24. const name = product.nameShort;
  25. - const packageJsonUpdates = { name, version };
  26. + const release = packageJson.release;
  27. + const packageJsonUpdates = { name, version, release };
  28. @@ -252,3 +253,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  29. const date = new Date().toISOString();
  30. - const productJsonUpdate = { commit, date, checksums, version };
  31. + const productJsonUpdate = { commit, date, checksums, version, release };
  32. diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js
  33. index 8c2b62f..303fb16 100644
  34. --- a/build/gulpfile.vscode.linux.js
  35. +++ b/build/gulpfile.vscode.linux.js
  36. @@ -24,4 +24,2 @@ const commit = getVersion(root);
  37. -const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
  38. -
  39. /**
  40. @@ -86,3 +84,3 @@ function prepareDebPackage(arch) {
  41. .pipe(replace('@@NAME@@', product.applicationName))
  42. - .pipe(replace('@@VERSION@@', packageJson.version + '-' + linuxPackageRevision))
  43. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  44. .pipe(replace('@@ARCHITECTURE@@', debArch))
  45. @@ -194,4 +192,3 @@ function prepareRpmPackage(arch) {
  46. .pipe(replace('@@ICON@@', product.linuxIconName))
  47. - .pipe(replace('@@VERSION@@', packageJson.version))
  48. - .pipe(replace('@@RELEASE@@', linuxPackageRevision))
  49. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  50. .pipe(replace('@@ARCHITECTURE@@', rpmArch))
  51. @@ -270,3 +267,3 @@ function prepareSnapPackage(arch) {
  52. .pipe(replace('@@NAME@@', product.applicationName))
  53. - .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
  54. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  55. // Possible run-on values https://snapcraft.io/docs/architectures
  56. diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
  57. index 5adfdfb..d6ddead 100644
  58. --- a/build/gulpfile.vscode.win32.js
  59. +++ b/build/gulpfile.vscode.win32.js
  60. @@ -90,4 +90,4 @@ function buildWin32Setup(arch, target) {
  61. DirName: product.win32DirName,
  62. - Version: pkg.version,
  63. - RawVersion: pkg.version.replace(/-\w+$/, ''),
  64. + Version: `${pkg.version}.${pkg.release}`,
  65. + RawVersion: `${pkg.version.replace(/-\w+$/, '')}.${pkg.release}`,
  66. NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
  67. diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
  68. index 3a57612..d26a55b 100644
  69. --- a/src/vs/base/common/product.ts
  70. +++ b/src/vs/base/common/product.ts
  71. @@ -58,2 +58,3 @@ export interface IProductConfiguration {
  72. readonly version: string;
  73. + readonly release: string;
  74. readonly date?: string;
  75. diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  76. index 0be311f..d6c4a18 100644
  77. --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
  78. +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  79. @@ -224,3 +224,3 @@ export class DiagnosticsService implements IDiagnosticsService {
  80. const output: string[] = [];
  81. - output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  82. + output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  83. output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
  84. diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
  85. index 467e11c..8e7d474 100644
  86. --- a/src/vs/platform/product/common/product.ts
  87. +++ b/src/vs/platform/product/common/product.ts
  88. @@ -43,6 +43,7 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
  89. if (!product.version) {
  90. - const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };
  91. + const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string, release: string };
  92. Object.assign(product, {
  93. - version: pkg.version
  94. + version: pkg.version,
  95. + release: pkg.release
  96. });
  97. diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  98. index c064ebc..72a9fa9 100644
  99. --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  100. +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  101. @@ -22,2 +22,3 @@ import { defaultButtonStyles, defaultCheckboxStyles, defaultDialogStyles, defaul
  102. import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver';
  103. +import { getReleaseString } from 'vs/workbench/common/release';
  104. @@ -79,2 +80,4 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  105. const detailString = (useAgo: boolean): string => {
  106. + const releaseString = getReleaseString();
  107. +
  108. return localize('aboutDetail',
  109. @@ -85,3 +88,3 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  110. navigator.userAgent
  111. - );
  112. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  113. };
  114. diff --git a/src/vs/workbench/common/release.ts b/src/vs/workbench/common/release.ts
  115. new file mode 100644
  116. index 0000000..2a8ea57
  117. --- /dev/null
  118. +++ b/src/vs/workbench/common/release.ts
  119. @@ -0,0 +1,14 @@
  120. +import { language } from 'vs/base/common/platform';
  121. +
  122. +const DEFAULT_LABEL = 'Release:';
  123. +const LABELS: { [key: string]: string } = {
  124. + 'en': DEFAULT_LABEL,
  125. + 'fr': 'Révision :',
  126. + 'ru': 'Релиз:',
  127. + 'zh-hans': '发布版本:',
  128. + 'zh-hant': '發布版本:',
  129. +};
  130. +
  131. +export function getReleaseString(): string {
  132. + return LABELS[language] ?? DEFAULT_LABEL;
  133. +}
  134. diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  135. index f2cc82a..700d81a 100644
  136. --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  137. +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  138. @@ -14,2 +14,3 @@ import { IProductService } from 'vs/platform/product/common/productService';
  139. import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
  140. +import { getReleaseString } from 'vs/workbench/common/release';
  141. import { getActiveWindow } from 'vs/base/browser/dom';
  142. @@ -80,2 +81,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  143. const osProps = await this.nativeHostService.getOSProperties();
  144. + const releaseString = getReleaseString();
  145. @@ -93,3 +95,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  146. `${osProps.type} ${osProps.arch} ${osProps.release}${isLinuxSnap ? ' snap' : ''}`
  147. - );
  148. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  149. };