version-0-release.patch 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  2. index e0df76f..04354d8 100644
  3. --- a/build/gulpfile.reh.js
  4. +++ b/build/gulpfile.reh.js
  5. @@ -310,2 +310,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  6. const name = product.nameShort;
  7. + const release = packageJson.release;
  8. @@ -313,3 +314,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  9. const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' })
  10. - .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined, type: 'module' }))
  11. + .pipe(json({ name, version, release, dependencies: undefined, optionalDependencies: undefined, type: 'module' }))
  12. .pipe(es.through(function (file) {
  13. @@ -321,3 +322,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  14. const productJsonStream = gulp.src(['product.json'], { base: '.' })
  15. - .pipe(json({ commit, date: readISODate('out-build'), version }))
  16. + .pipe(json({ commit, date: readISODate('out-build'), version, release }))
  17. .pipe(es.through(function (file) {
  18. diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
  19. index a63f693..62e0080 100644
  20. --- a/build/gulpfile.vscode.js
  21. +++ b/build/gulpfile.vscode.js
  22. @@ -261,3 +261,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  23. - let version = packageJson.version;
  24. + let version = packageJson.version
  25. const quality = product.quality;
  26. @@ -269,3 +269,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  27. const name = product.nameShort;
  28. - const packageJsonUpdates = { name, version };
  29. + const release = packageJson.release;
  30. + const packageJsonUpdates = { name, version, release };
  31. @@ -285,3 +286,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  32. const productJsonStream = gulp.src(['product.json'], { base: '.' })
  33. - .pipe(json({ commit, date: readISODate('out-build'), checksums, version }))
  34. + .pipe(json({ commit, date: readISODate('out-build'), checksums, version, release }))
  35. .pipe(es.through(function (file) {
  36. diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js
  37. index fb0e5a4..170c60b 100644
  38. --- a/build/gulpfile.vscode.linux.js
  39. +++ b/build/gulpfile.vscode.linux.js
  40. @@ -27,4 +27,2 @@ const commit = getVersion(root);
  41. -const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
  42. -
  43. /**
  44. @@ -89,3 +87,3 @@ function prepareDebPackage(arch) {
  45. .pipe(replace('@@NAME@@', product.applicationName))
  46. - .pipe(replace('@@VERSION@@', packageJson.version + '-' + linuxPackageRevision))
  47. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  48. .pipe(replace('@@ARCHITECTURE@@', debArch))
  49. @@ -204,4 +202,3 @@ function prepareRpmPackage(arch) {
  50. .pipe(replace('@@ICON@@', product.linuxIconName))
  51. - .pipe(replace('@@VERSION@@', packageJson.version))
  52. - .pipe(replace('@@RELEASE@@', linuxPackageRevision))
  53. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  54. .pipe(replace('@@ARCHITECTURE@@', rpmArch))
  55. @@ -281,3 +278,3 @@ function prepareSnapPackage(arch) {
  56. .pipe(replace('@@NAME@@', product.applicationName))
  57. - .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
  58. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  59. // Possible run-on values https://snapcraft.io/docs/architectures
  60. diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
  61. index 98175f5..afacbe3 100644
  62. --- a/build/gulpfile.vscode.win32.js
  63. +++ b/build/gulpfile.vscode.win32.js
  64. @@ -89,4 +89,4 @@ function buildWin32Setup(arch, target) {
  65. DirName: product.win32DirName,
  66. - Version: pkg.version,
  67. - RawVersion: pkg.version.replace(/-\w+$/, ''),
  68. + Version: `${pkg.version}.${pkg.release}`,
  69. + RawVersion: `${pkg.version.replace(/-\w+$/, '')}.${pkg.release}`,
  70. NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
  71. diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
  72. index 52c4c94..00fc9f8 100644
  73. --- a/src/vs/base/common/product.ts
  74. +++ b/src/vs/base/common/product.ts
  75. @@ -58,2 +58,3 @@ export interface IProductConfiguration {
  76. readonly version: string;
  77. + readonly release: string;
  78. readonly date?: string;
  79. diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  80. index 5f6efd5..da3c54d 100644
  81. --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
  82. +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  83. @@ -232,3 +232,3 @@ export class DiagnosticsService implements IDiagnosticsService {
  84. const output: string[] = [];
  85. - output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  86. + output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  87. output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
  88. diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
  89. index 1a2a619..2a8d683 100644
  90. --- a/src/vs/platform/product/common/product.ts
  91. +++ b/src/vs/platform/product/common/product.ts
  92. @@ -43,6 +43,7 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
  93. if (!product.version) {
  94. - const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };
  95. + const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string, release: string };
  96. Object.assign(product, {
  97. - version: pkg.version
  98. + version: pkg.version,
  99. + release: pkg.release
  100. });
  101. diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  102. index 7563b30..0873839 100644
  103. --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  104. +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  105. @@ -23,2 +23,3 @@ import { ResultKind } from '../../../../platform/keybinding/common/keybindingRes
  106. import { IOpenerService } from '../../../../platform/opener/common/opener.js';
  107. +import { getReleaseString } from '../../../../workbench/common/release.js';
  108. @@ -81,2 +82,4 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  109. const detailString = (useAgo: boolean): string => {
  110. + const releaseString = getReleaseString();
  111. +
  112. return localize('aboutDetail',
  113. @@ -87,3 +90,3 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  114. navigator.userAgent
  115. - );
  116. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  117. };
  118. diff --git a/src/vs/workbench/common/release.ts b/src/vs/workbench/common/release.ts
  119. new file mode 100644
  120. index 0000000..82dbe6a
  121. --- /dev/null
  122. +++ b/src/vs/workbench/common/release.ts
  123. @@ -0,0 +1,14 @@
  124. +import { language } from '../../base/common/platform.js';
  125. +
  126. +const DEFAULT_LABEL = 'Release:';
  127. +const LABELS: { [key: string]: string } = {
  128. + 'en': DEFAULT_LABEL,
  129. + 'fr': 'Révision :',
  130. + 'ru': 'Релиз:',
  131. + 'zh-hans': '发布版本:',
  132. + 'zh-hant': '發布版本:',
  133. +};
  134. +
  135. +export function getReleaseString(): string {
  136. + return LABELS[language] ?? DEFAULT_LABEL;
  137. +}
  138. diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  139. index 6c61a59..d58f8fc 100644
  140. --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  141. +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  142. @@ -15,2 +15,3 @@ import { process } from '../../../../base/parts/sandbox/electron-sandbox/globals
  143. import { getActiveWindow } from '../../../../base/browser/dom.js';
  144. +import { getReleaseString } from '../../../../workbench/common/release.js';
  145. @@ -80,2 +81,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  146. const osProps = await this.nativeHostService.getOSProperties();
  147. + const releaseString = getReleaseString();
  148. @@ -93,3 +95,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  149. `${osProps.type} ${osProps.arch} ${osProps.release}${isLinuxSnap ? ' snap' : ''}`
  150. - );
  151. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  152. };