version-0-release.patch 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  2. index c1d64c0..5daeb3d 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 7046ee0..6500cb9 100644
  20. --- a/build/gulpfile.vscode.js
  21. +++ b/build/gulpfile.vscode.js
  22. @@ -264,3 +264,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  23. - let version = packageJson.version;
  24. + let version = packageJson.version
  25. const quality = product.quality;
  26. @@ -272,3 +272,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. @@ -288,3 +289,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 cd8610d..fc8b5e2 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. @@ -90,3 +88,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. @@ -278,3 +276,3 @@ function prepareSnapPackage(arch) {
  50. .pipe(replace('@@NAME@@', product.applicationName))
  51. - .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
  52. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  53. // Possible run-on values https://snapcraft.io/docs/architectures
  54. diff --git a/build/gulpfile.vscode.linux.js.rej b/build/gulpfile.vscode.linux.js.rej
  55. new file mode 100644
  56. index 0000000..5198d59
  57. --- /dev/null
  58. +++ b/build/gulpfile.vscode.linux.js.rej
  59. @@ -0,0 +1,7 @@
  60. +diff a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js (rejected hunks)
  61. +@@ -204,4 +202,3 @@ function prepareRpmPackage(arch) {
  62. + .pipe(replace('@@ICON@@', product.linuxIconName))
  63. +- .pipe(replace('@@VERSION@@', packageJson.version))
  64. +- .pipe(replace('@@RELEASE@@', linuxPackageRevision))
  65. ++ .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  66. + .pipe(replace('@@ARCHITECTURE@@', rpmArch))
  67. diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
  68. index 98175f5..afacbe3 100644
  69. --- a/build/gulpfile.vscode.win32.js
  70. +++ b/build/gulpfile.vscode.win32.js
  71. @@ -89,4 +89,4 @@ function buildWin32Setup(arch, target) {
  72. DirName: product.win32DirName,
  73. - Version: pkg.version,
  74. - RawVersion: pkg.version.replace(/-\w+$/, ''),
  75. + Version: `${pkg.version}.${pkg.release}`,
  76. + RawVersion: `${pkg.version.replace(/-\w+$/, '')}.${pkg.release}`,
  77. NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
  78. diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
  79. index cd8d2fd..0051989 100644
  80. --- a/src/vs/base/common/product.ts
  81. +++ b/src/vs/base/common/product.ts
  82. @@ -58,2 +58,3 @@ export interface IProductConfiguration {
  83. readonly version: string;
  84. + readonly release: string;
  85. readonly date?: string;
  86. diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  87. index e523217..b00ccb4 100644
  88. --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
  89. +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  90. @@ -233,3 +233,3 @@ export class DiagnosticsService implements IDiagnosticsService {
  91. const output: string[] = [];
  92. - output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  93. + output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  94. output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
  95. diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
  96. index d27cdce..17ac262 100644
  97. --- a/src/vs/platform/product/common/product.ts
  98. +++ b/src/vs/platform/product/common/product.ts
  99. @@ -45,6 +45,7 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
  100. if (!product.version) {
  101. - const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };
  102. + const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string, release: string };
  103. Object.assign(product, {
  104. - version: pkg.version
  105. + version: pkg.version,
  106. + release: pkg.release
  107. });
  108. diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  109. index ac461ef..1258f27 100644
  110. --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  111. +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  112. @@ -20,2 +20,3 @@ import { IOpenerService } from '../../../../platform/opener/common/opener.js';
  113. import { createWorkbenchDialogOptions } from '../../../../platform/dialogs/browser/dialog.js';
  114. +import { getReleaseString } from '../../../../workbench/common/release.js';
  115. @@ -80,2 +81,4 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  116. const detailString = (useAgo: boolean): string => {
  117. + const releaseString = getReleaseString();
  118. +
  119. return localize('aboutDetail',
  120. @@ -86,3 +89,3 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  121. navigator.userAgent
  122. - );
  123. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  124. };
  125. diff --git a/src/vs/workbench/common/release.ts b/src/vs/workbench/common/release.ts
  126. new file mode 100644
  127. index 0000000..82dbe6a
  128. --- /dev/null
  129. +++ b/src/vs/workbench/common/release.ts
  130. @@ -0,0 +1,14 @@
  131. +import { language } from '../../base/common/platform.js';
  132. +
  133. +const DEFAULT_LABEL = 'Release:';
  134. +const LABELS: { [key: string]: string } = {
  135. + 'en': DEFAULT_LABEL,
  136. + 'fr': 'Révision :',
  137. + 'ru': 'Релиз:',
  138. + 'zh-hans': '发布版本:',
  139. + 'zh-hant': '發布版本:',
  140. +};
  141. +
  142. +export function getReleaseString(): string {
  143. + return LABELS[language] ?? DEFAULT_LABEL;
  144. +}
  145. diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  146. index 6c61a59..d58f8fc 100644
  147. --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  148. +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  149. @@ -15,2 +15,3 @@ import { process } from '../../../../base/parts/sandbox/electron-sandbox/globals
  150. import { getActiveWindow } from '../../../../base/browser/dom.js';
  151. +import { getReleaseString } from '../../../../workbench/common/release.js';
  152. @@ -80,2 +81,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  153. const osProps = await this.nativeHostService.getOSProperties();
  154. + const releaseString = getReleaseString();
  155. @@ -93,3 +95,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  156. `${osProps.type} ${osProps.arch} ${osProps.release}${isLinuxSnap ? ' snap' : ''}`
  157. - );
  158. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  159. };