build-version.patch 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  2. index 2abc3f3..a3cbf2d 100644
  3. --- a/build/gulpfile.reh.js
  4. +++ b/build/gulpfile.reh.js
  5. @@ -246,8 +246,9 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  6. }
  7. const name = product.nameShort;
  8. + const release = packageJson.release;
  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. const date = new Date().toISOString();
  13. diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
  14. index 28f8e52..f17962d 100644
  15. --- a/build/gulpfile.vscode.js
  16. +++ b/build/gulpfile.vscode.js
  17. @@ -187,7 +187,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  18. const sources = es.merge(src, extensions)
  19. .pipe(filter(['**', '!**/*.js.map'], { dot: true }));
  20. - let version = packageJson.version;
  21. + let version = packageJson.version
  22. const quality = product.quality;
  23. if (quality && quality !== 'stable') {
  24. @@ -195,7 +195,8 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  25. }
  26. const name = product.nameShort;
  27. - const packageJsonUpdates = { name, version };
  28. + const release = packageJson.release;
  29. + const packageJsonUpdates = { name, version, release };
  30. // for linux url handling
  31. if (platform === 'linux') {
  32. diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js
  33. index 489d9cc..e9f00f3 100644
  34. --- a/build/gulpfile.vscode.linux.js
  35. +++ b/build/gulpfile.vscode.linux.js
  36. @@ -83,7 +83,7 @@ function prepareDebPackage(arch) {
  37. const dependencies = debianDependenciesGenerator.getDependencies(binaryDir, product.applicationName, debArch, sysroot);
  38. gulp.src('resources/linux/debian/control.template', { base: '.' })
  39. .pipe(replace('@@NAME@@', product.applicationName))
  40. - .pipe(replace('@@VERSION@@', packageJson.version + '-' + linuxPackageRevision))
  41. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  42. .pipe(replace('@@ARCHITECTURE@@', debArch))
  43. .pipe(replace('@@DEPENDS@@', dependencies.join(', ')))
  44. .pipe(replace('@@RECOMMENDS@@', debianRecommendedDependencies.join(', ')))
  45. @@ -188,8 +188,7 @@ function prepareRpmPackage(arch) {
  46. .pipe(replace('@@NAME@@', product.applicationName))
  47. .pipe(replace('@@NAME_LONG@@', product.nameLong))
  48. .pipe(replace('@@ICON@@', product.linuxIconName))
  49. - .pipe(replace('@@VERSION@@', packageJson.version))
  50. - .pipe(replace('@@RELEASE@@', linuxPackageRevision))
  51. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  52. .pipe(replace('@@ARCHITECTURE@@', rpmArch))
  53. .pipe(replace('@@LICENSE@@', product.licenseName))
  54. .pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
  55. @@ -262,7 +261,7 @@ function prepareSnapPackage(arch) {
  56. const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
  57. .pipe(replace('@@NAME@@', product.applicationName))
  58. - .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
  59. + .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
  60. // Possible run-on values https://snapcraft.io/docs/architectures
  61. .pipe(replace('@@ARCHITECTURE@@', arch === 'x64' ? 'amd64' : arch))
  62. .pipe(rename('snap/snapcraft.yaml'));
  63. diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
  64. index 81ba509..43f5377 100644
  65. --- a/build/gulpfile.vscode.win32.js
  66. +++ b/build/gulpfile.vscode.win32.js
  67. @@ -91,8 +91,8 @@ function buildWin32Setup(arch, target) {
  68. NameLong: product.nameLong,
  69. NameShort: product.nameShort,
  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. ExeBasename: product.nameShort,
  77. RegValueName: product.win32RegValueName,
  78. diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template
  79. index 00ddb6f..814c964 100644
  80. --- a/resources/linux/rpm/code.spec.template
  81. +++ b/resources/linux/rpm/code.spec.template
  82. @@ -1,6 +1,6 @@
  83. Name: @@NAME@@
  84. Version: @@VERSION@@
  85. -Release: @@RELEASE@@.el7
  86. +Release: el7
  87. Summary: Code editing. Redefined.
  88. Group: Development/Tools
  89. Vendor: Microsoft Corporation
  90. diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
  91. index 1ae8079..0dad6ac 100644
  92. --- a/src/vs/base/common/product.ts
  93. +++ b/src/vs/base/common/product.ts
  94. @@ -32,6 +32,7 @@ export type ExtensionVirtualWorkspaceSupport = {
  95. export interface IProductConfiguration {
  96. readonly version: string;
  97. + readonly release: string;
  98. readonly date?: string;
  99. readonly quality?: string;
  100. readonly commit?: string;
  101. diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  102. index e1c60a3..a12d52c 100644
  103. --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
  104. +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
  105. @@ -237,7 +237,7 @@ export class DiagnosticsService implements IDiagnosticsService {
  106. private formatEnvironment(info: IMainProcessInfo): string {
  107. const output: string[] = [];
  108. - output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  109. + output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
  110. output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
  111. const cpus = osLib.cpus();
  112. if (cpus && cpus.length > 0) {
  113. diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
  114. index 7e63a16..74d1f26 100644
  115. --- a/src/vs/platform/product/common/product.ts
  116. +++ b/src/vs/platform/product/common/product.ts
  117. @@ -32,7 +32,7 @@ else if (typeof require?.__$__nodeRequire === 'function') {
  118. const rootPath = dirname(FileAccess.asFileUri('', require));
  119. product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath);
  120. - const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string };
  121. + const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string, release: string };
  122. // Running out of sources
  123. if (env['VSCODE_DEV']) {
  124. @@ -45,7 +45,8 @@ else if (typeof require?.__$__nodeRequire === 'function') {
  125. }
  126. Object.assign(product, {
  127. - version: pkg.version
  128. + version: pkg.version,
  129. + release: pkg.release
  130. });
  131. }
  132. diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  133. index ec4ff95..f721052 100644
  134. --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  135. +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
  136. @@ -144,7 +144,8 @@ export class BrowserDialogHandler implements IDialogHandler {
  137. async about(): Promise<void> {
  138. const detailString = (useAgo: boolean): string => {
  139. return localize('aboutDetail',
  140. - "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
  141. + "Version: {0}\nRelease: {1}\nCommit: {2}\nDate: {3}\nBrowser: {4}",
  142. + this.productService.release || 'Unknown',
  143. this.productService.version || 'Unknown',
  144. this.productService.commit || 'Unknown',
  145. this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown',
  146. diff --git a/src/vs/workbench/contrib/issue/browser/issueService.ts b/src/vs/workbench/contrib/issue/browser/issueService.ts
  147. index dc7430b..23def01 100644
  148. --- a/src/vs/workbench/contrib/issue/browser/issueService.ts
  149. +++ b/src/vs/workbench/contrib/issue/browser/issueService.ts
  150. @@ -65,6 +65,7 @@ export class WebIssueService implements IWorkbenchIssueService {
  151. return `ADD ISSUE DESCRIPTION HERE
  152. Version: ${this.productService.version}
  153. +Release: ${this.productService.release ?? 'unknown'}
  154. Commit: ${this.productService.commit ?? 'unknown'}
  155. User Agent: ${userAgent ?? 'unknown'}
  156. Embedder: ${this.productService.embedderIdentifier ?? 'unknown'}
  157. diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  158. index a4728e7..d1a8b94 100644
  159. --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  160. +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
  161. @@ -167,8 +167,9 @@ export class NativeDialogHandler implements IDialogHandler {
  162. const detailString = (useAgo: boolean): string => {
  163. return localize({ key: 'aboutDetail', comment: ['Electron, Chromium, Node.js and V8 are product names that need no translation'] },
  164. - "Version: {0}\nCommit: {1}\nDate: {2}\nElectron: {3}\nChromium: {4}\nNode.js: {5}\nV8: {6}\nOS: {7}",
  165. + "Version: {0}\nRelease: {1}\nCommit: {2}\nDate: {3}\nElectron: {4}\nChromium: {5}\nNode.js: {6}\nV8: {7}\nOS: {8}",
  166. version,
  167. + this.productService.release || 'Unknown',
  168. this.productService.commit || 'Unknown',
  169. this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown',
  170. process.versions['electron'],