build-version.patch 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. diff --git a/.vscode/settings.json b/.vscode/settings.json
  2. index 3abb868..309c37f 100644
  3. --- a/.vscode/settings.json
  4. +++ b/.vscode/settings.json
  5. @@ -90,3 +90,3 @@
  6. "editor.defaultFormatter": "vscode.typescript-language-features",
  7. - "editor.formatOnSave": true
  8. + // "editor.formatOnSave": true
  9. },
  10. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  11. index 7475e04..d930611 100644
  12. --- a/build/gulpfile.reh.js
  13. +++ b/build/gulpfile.reh.js
  14. @@ -246,4 +246,5 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  15. const name = product.nameShort;
  16. + const release = packageJson.release;
  17. const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' })
  18. - .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined }));
  19. + .pipe(json({ name, version, release, dependencies: undefined, optionalDependencies: undefined }));
  20. @@ -252,3 +253,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  21. const productJsonStream = gulp.src(['product.json'], { base: '.' })
  22. - .pipe(json({ commit, date, version }));
  23. + .pipe(json({ commit, date, version, release }));
  24. diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
  25. index d5b4db0..46ca809 100644
  26. --- a/build/gulpfile.vscode.js
  27. +++ b/build/gulpfile.vscode.js
  28. @@ -226,3 +226,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  29. - let version = packageJson.version;
  30. + let version = packageJson.version
  31. const quality = product.quality;
  32. @@ -234,3 +234,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  33. const name = product.nameShort;
  34. - const packageJsonUpdates = { name, version };
  35. + const release = packageJson.release;
  36. + const packageJsonUpdates = { name, version, release };
  37. @@ -245,3 +246,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  38. const date = new Date().toISOString();
  39. - const productJsonUpdate = { commit, date, checksums, version };
  40. + const productJsonUpdate = { commit, date, checksums, version, release };
  41. diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js
  42. index cdc8870..f6e4e09 100644
  43. --- a/build/gulpfile.vscode.linux.js
  44. +++ b/build/gulpfile.vscode.linux.js
  45. @@ -25,4 +25,2 @@ const commit = getVersion(root);
  46. -const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
  47. -
  48. /**
  49. @@ -88,3 +86,3 @@ function prepareDebPackage(arch) {
  50. .pipe(replace('@@NAME@@', product.applicationName))
  51. - .pipe(replace('@@VERSION@@', packageJson.version + '-' + linuxPackageRevision))
  52. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  53. .pipe(replace('@@ARCHITECTURE@@', debArch))
  54. @@ -193,4 +191,3 @@ function prepareRpmPackage(arch) {
  55. .pipe(replace('@@ICON@@', product.linuxIconName))
  56. - .pipe(replace('@@VERSION@@', packageJson.version))
  57. - .pipe(replace('@@RELEASE@@', linuxPackageRevision))
  58. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  59. .pipe(replace('@@ARCHITECTURE@@', rpmArch))
  60. @@ -267,3 +264,3 @@ function prepareSnapPackage(arch) {
  61. .pipe(replace('@@NAME@@', product.applicationName))
  62. - .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
  63. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  64. // Possible run-on values https://snapcraft.io/docs/architectures
  65. diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
  66. index 0d3abda..2606af5 100644
  67. --- a/build/gulpfile.vscode.win32.js
  68. +++ b/build/gulpfile.vscode.win32.js
  69. @@ -94,4 +94,4 @@ function buildWin32Setup(arch, target) {
  70. DirName: product.win32DirName,
  71. - Version: pkg.version,
  72. - RawVersion: pkg.version.replace(/-\w+$/, ''),
  73. + Version: `${pkg.version}.${pkg.release}`,
  74. + RawVersion: `${pkg.version.replace(/-\w+$/, '')}.${pkg.release}`,
  75. NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
  76. diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template
  77. index 61659d2..5cafa06 100644
  78. --- a/resources/linux/rpm/code.spec.template
  79. +++ b/resources/linux/rpm/code.spec.template
  80. @@ -2,3 +2,3 @@ Name: @@NAME@@
  81. Version: @@VERSION@@
  82. -Release: @@RELEASE@@.el7
  83. +Release: el7
  84. Summary: Code editing. Redefined.
  85. diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
  86. index 149c3b9..6d8dd99 100644
  87. --- a/src/vs/base/common/product.ts
  88. +++ b/src/vs/base/common/product.ts
  89. @@ -34,2 +34,3 @@ export interface IProductConfiguration {
  90. readonly version: string;
  91. + readonly release: string;
  92. readonly date?: string;
  93. diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  94. index 561966b..30814a0 100644
  95. --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
  96. +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  97. @@ -236,3 +236,3 @@ export class DiagnosticsService implements IDiagnosticsService {
  98. const output: string[] = [];
  99. - output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  100. + output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  101. output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
  102. diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
  103. index 3f50bef..465ca43 100644
  104. --- a/src/vs/platform/product/common/product.ts
  105. +++ b/src/vs/platform/product/common/product.ts
  106. @@ -49,6 +49,7 @@ else if (typeof require?.__$__nodeRequire === 'function') {
  107. if (!product.version) {
  108. - const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string };
  109. + const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string, release: string };
  110. Object.assign(product, {
  111. - version: pkg.version
  112. + version: pkg.version,
  113. + release: pkg.release
  114. });
  115. diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  116. index e7dc644..69a313b 100644
  117. --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  118. +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  119. @@ -23,2 +23,3 @@ import { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/mar
  120. import { defaultButtonStyles } from 'vs/platform/theme/browser/defaultStyles';
  121. +import { getReleaseString } from 'vs/workbench/common/release';
  122. @@ -147,2 +148,4 @@ export class BrowserDialogHandler implements IDialogHandler {
  123. const detailString = (useAgo: boolean): string => {
  124. + const releaseString = getReleaseString();
  125. +
  126. return localize('aboutDetail',
  127. @@ -153,3 +156,3 @@ export class BrowserDialogHandler implements IDialogHandler {
  128. navigator.userAgent
  129. - );
  130. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  131. };
  132. diff --git a/src/vs/workbench/common/release.ts b/src/vs/workbench/common/release.ts
  133. new file mode 100644
  134. index 0000000..2a8ea57
  135. --- /dev/null
  136. +++ b/src/vs/workbench/common/release.ts
  137. @@ -0,0 +1,14 @@
  138. +import { language } from 'vs/base/common/platform';
  139. +
  140. +const DEFAULT_LABEL = 'Release:';
  141. +const LABELS: { [key: string]: string } = {
  142. + 'en': DEFAULT_LABEL,
  143. + 'fr': 'Révision :',
  144. + 'ru': 'Релиз:',
  145. + 'zh-hans': '发布版本:',
  146. + 'zh-hant': '發布版本:',
  147. +};
  148. +
  149. +export function getReleaseString(): string {
  150. + return LABELS[language] ?? DEFAULT_LABEL;
  151. +}
  152. diff --git a/src/vs/workbench/contrib/issue/browser/issueService.ts b/src/vs/workbench/contrib/issue/browser/issueService.ts
  153. index dc7430b..23def01 100644
  154. --- a/src/vs/workbench/contrib/issue/browser/issueService.ts
  155. +++ b/src/vs/workbench/contrib/issue/browser/issueService.ts
  156. @@ -67,2 +67,3 @@ export class WebIssueService implements IWorkbenchIssueService {
  157. Version: ${this.productService.version}
  158. +Release: ${this.productService.release ?? 'unknown'}
  159. Commit: ${this.productService.commit ?? 'unknown'}
  160. diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  161. index f63b75f..2b77c1b 100644
  162. --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  163. +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  164. @@ -17,2 +17,3 @@ import { IProductService } from 'vs/platform/product/common/productService';
  165. import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
  166. +import { getReleaseString } from 'vs/workbench/common/release';
  167. @@ -166,2 +167,3 @@ export class NativeDialogHandler implements IDialogHandler {
  168. const osProps = await this.nativeHostService.getOSProperties();
  169. + const releaseString = getReleaseString();
  170. @@ -179,3 +181,3 @@ export class NativeDialogHandler implements IDialogHandler {
  171. process.sandboxed ? 'Yes' : 'No' // TODO@bpasero remove me once sandbox is final
  172. - );
  173. + ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
  174. };