build-version.patch 8.3 KB

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