build-version.patch 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  2. index 7d58861..38d7f34 100644
  3. --- a/build/gulpfile.reh.js
  4. +++ b/build/gulpfile.reh.js
  5. @@ -295,2 +295,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  6. const name = product.nameShort;
  7. + const release = packageJson.release;
  8. @@ -298,3 +299,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 }))
  11. + .pipe(json({ name, version, release, dependencies: undefined, optionalDependencies: undefined }))
  12. .pipe(es.through(function (file) {
  13. @@ -306,3 +307,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 4af4067..21146e8 100644
  20. --- a/build/gulpfile.vscode.js
  21. +++ b/build/gulpfile.vscode.js
  22. @@ -236,3 +236,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  23. - let version = packageJson.version;
  24. + let version = packageJson.version
  25. const quality = product.quality;
  26. @@ -244,3 +244,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. @@ -261,3 +262,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 28ddfb0..718b8c1 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. @@ -199,4 +197,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. @@ -275,3 +272,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 5adfdfb..d6ddead 100644
  62. --- a/build/gulpfile.vscode.win32.js
  63. +++ b/build/gulpfile.vscode.win32.js
  64. @@ -90,4 +90,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 e30cf08..38d1884 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 7e0bc11..1fa5310 100644
  81. --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
  82. +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  83. @@ -231,3 +231,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 58278d9..956cdff 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 c064ebc..72a9fa9 100644
  103. --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  104. +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  105. @@ -22,2 +22,3 @@ import { defaultButtonStyles, defaultCheckboxStyles, defaultDialogStyles, defaul
  106. import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver';
  107. +import { getReleaseString } from 'vs/workbench/common/release';
  108. @@ -79,2 +80,4 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  109. const detailString = (useAgo: boolean): string => {
  110. + const releaseString = getReleaseString();
  111. +
  112. return localize('aboutDetail',
  113. @@ -85,3 +88,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..2a8ea57
  121. --- /dev/null
  122. +++ b/src/vs/workbench/common/release.ts
  123. @@ -0,0 +1,14 @@
  124. +import { language } from 'vs/base/common/platform';
  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 f2cc82a..700d81a 100644
  140. --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  141. +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  142. @@ -14,2 +14,3 @@ import { IProductService } from 'vs/platform/product/common/productService';
  143. import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
  144. +import { getReleaseString } from 'vs/workbench/common/release';
  145. import { getActiveWindow } from 'vs/base/browser/dom';
  146. @@ -80,2 +81,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  147. const osProps = await this.nativeHostService.getOSProperties();
  148. + const releaseString = getReleaseString();
  149. @@ -93,3 +95,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  150. `${osProps.type} ${osProps.arch} ${osProps.release}${isLinuxSnap ? ' snap' : ''}`
  151. - );
  152. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  153. };