build-version.patch 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  2. index df18cf0..6f59211 100644
  3. --- a/build/gulpfile.reh.js
  4. +++ b/build/gulpfile.reh.js
  5. @@ -289,4 +289,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. @@ -295,3 +296,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 bfd5c89..bc84f18 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..098f8d9 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. @@ -196,2 +194,3 @@ function prepareRpmPackage(arch) {
  46. .pipe(replace('@@RELEASE@@', linuxPackageRevision))
  47. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  48. .pipe(replace('@@ARCHITECTURE@@', rpmArch))
  49. @@ -270,3 +269,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.win32.js b/build/gulpfile.vscode.win32.js
  55. index 5adfdfb..d6ddead 100644
  56. --- a/build/gulpfile.vscode.win32.js
  57. +++ b/build/gulpfile.vscode.win32.js
  58. @@ -90,4 +90,4 @@ function buildWin32Setup(arch, target) {
  59. DirName: product.win32DirName,
  60. - Version: pkg.version,
  61. - RawVersion: pkg.version.replace(/-\w+$/, ''),
  62. + Version: `${pkg.version}.${pkg.release}`,
  63. + RawVersion: `${pkg.version.replace(/-\w+$/, '')}.${pkg.release}`,
  64. NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
  65. diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template
  66. index c9e57db..aef439c 100644
  67. --- a/resources/linux/rpm/code.spec.template
  68. +++ b/resources/linux/rpm/code.spec.template
  69. @@ -2,3 +2,3 @@ Name: @@NAME@@
  70. Version: @@VERSION@@
  71. -Release: @@RELEASE@@.el8
  72. +Release: el8
  73. Summary: Code editing. Redefined.
  74. diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
  75. index cbd573f..c7bbc90 100644
  76. --- a/src/vs/base/common/product.ts
  77. +++ b/src/vs/base/common/product.ts
  78. @@ -58,2 +58,3 @@ export interface IProductConfiguration {
  79. readonly version: string;
  80. + readonly release: string;
  81. readonly date?: string;
  82. diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  83. index 0be311f..d6c4a18 100644
  84. --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
  85. +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  86. @@ -224,3 +224,3 @@ export class DiagnosticsService implements IDiagnosticsService {
  87. const output: string[] = [];
  88. - output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  89. + output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  90. output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
  91. diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
  92. index 9482a2c..c3ef5bd 100644
  93. --- a/src/vs/platform/product/common/product.ts
  94. +++ b/src/vs/platform/product/common/product.ts
  95. @@ -43,6 +43,7 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) {
  96. if (!product.version) {
  97. - const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string };
  98. + const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string, release: string };
  99. Object.assign(product, {
  100. - version: pkg.version
  101. + version: pkg.version,
  102. + release: pkg.release
  103. });
  104. diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  105. index c064ebc..72a9fa9 100644
  106. --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  107. +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  108. @@ -22,2 +22,3 @@ import { defaultButtonStyles, defaultCheckboxStyles, defaultDialogStyles, defaul
  109. import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver';
  110. +import { getReleaseString } from 'vs/workbench/common/release';
  111. @@ -79,2 +80,4 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  112. const detailString = (useAgo: boolean): string => {
  113. + const releaseString = getReleaseString();
  114. +
  115. return localize('aboutDetail',
  116. @@ -85,3 +88,3 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
  117. navigator.userAgent
  118. - );
  119. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  120. };
  121. diff --git a/src/vs/workbench/common/release.ts b/src/vs/workbench/common/release.ts
  122. new file mode 100644
  123. index 0000000..2a8ea57
  124. --- /dev/null
  125. +++ b/src/vs/workbench/common/release.ts
  126. @@ -0,0 +1,14 @@
  127. +import { language } from 'vs/base/common/platform';
  128. +
  129. +const DEFAULT_LABEL = 'Release:';
  130. +const LABELS: { [key: string]: string } = {
  131. + 'en': DEFAULT_LABEL,
  132. + 'fr': 'Révision :',
  133. + 'ru': 'Релиз:',
  134. + 'zh-hans': '发布版本:',
  135. + 'zh-hant': '發布版本:',
  136. +};
  137. +
  138. +export function getReleaseString(): string {
  139. + return LABELS[language] ?? DEFAULT_LABEL;
  140. +}
  141. diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  142. index 3940ab6..609e5ed 100644
  143. --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  144. +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  145. @@ -14,2 +14,3 @@ import { IProductService } from 'vs/platform/product/common/productService';
  146. import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
  147. +import { getReleaseString } from 'vs/workbench/common/release';
  148. @@ -77,2 +78,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  149. const osProps = await this.nativeHostService.getOSProperties();
  150. + const releaseString = getReleaseString();
  151. @@ -90,3 +92,3 @@ export class NativeDialogHandler extends AbstractDialogHandler {
  152. `${osProps.type} ${osProps.arch} ${osProps.release}${isLinuxSnap ? ' snap' : ''}`
  153. - );
  154. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  155. };