vscodium/patches/build-version.patch
2022-11-18 10:36:13 +01:00

185 lines
9.2 KiB
Diff

diff --git a/.vscode/settings.json b/.vscode/settings.json
index 3abb868..309c37f 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -90,3 +90,3 @@
"editor.defaultFormatter": "vscode.typescript-language-features",
- "editor.formatOnSave": true
+ // "editor.formatOnSave": true
},
diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
index 7475e04..d930611 100644
--- a/build/gulpfile.reh.js
+++ b/build/gulpfile.reh.js
@@ -246,4 +246,5 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
const name = product.nameShort;
+ const release = packageJson.release;
const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' })
- .pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined }));
+ .pipe(json({ name, version, release, dependencies: undefined, optionalDependencies: undefined }));
@@ -252,3 +253,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
const productJsonStream = gulp.src(['product.json'], { base: '.' })
- .pipe(json({ commit, date, version }));
+ .pipe(json({ commit, date, version, release }));
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
index d5b4db0..46ca809 100644
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
@@ -226,3 +226,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
- let version = packageJson.version;
+ let version = packageJson.version
const quality = product.quality;
@@ -234,3 +234,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const name = product.nameShort;
- const packageJsonUpdates = { name, version };
+ const release = packageJson.release;
+ const packageJsonUpdates = { name, version, release };
@@ -245,3 +246,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
const date = new Date().toISOString();
- const productJsonUpdate = { commit, date, checksums, version };
+ const productJsonUpdate = { commit, date, checksums, version, release };
diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js
index cdc8870..f6e4e09 100644
--- a/build/gulpfile.vscode.linux.js
+++ b/build/gulpfile.vscode.linux.js
@@ -25,4 +25,2 @@ const commit = getVersion(root);
-const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
-
/**
@@ -88,3 +86,3 @@ function prepareDebPackage(arch) {
.pipe(replace('@@NAME@@', product.applicationName))
- .pipe(replace('@@VERSION@@', packageJson.version + '-' + linuxPackageRevision))
+ .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
.pipe(replace('@@ARCHITECTURE@@', debArch))
@@ -193,4 +191,3 @@ function prepareRpmPackage(arch) {
.pipe(replace('@@ICON@@', product.linuxIconName))
- .pipe(replace('@@VERSION@@', packageJson.version))
- .pipe(replace('@@RELEASE@@', linuxPackageRevision))
+ .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
@@ -267,3 +264,3 @@ function prepareSnapPackage(arch) {
.pipe(replace('@@NAME@@', product.applicationName))
- .pipe(replace('@@VERSION@@', commit.substr(0, 8)))
+ .pipe(replace('@@VERSION@@', `${packageJson.version}.${packageJson.release}`))
// Possible run-on values https://snapcraft.io/docs/architectures
diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
index 0d3abda..2606af5 100644
--- a/build/gulpfile.vscode.win32.js
+++ b/build/gulpfile.vscode.win32.js
@@ -94,4 +94,4 @@ function buildWin32Setup(arch, target) {
DirName: product.win32DirName,
- Version: pkg.version,
- RawVersion: pkg.version.replace(/-\w+$/, ''),
+ Version: `${pkg.version}.${pkg.release}`,
+ RawVersion: `${pkg.version.replace(/-\w+$/, '')}.${pkg.release}`,
NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
diff --git a/resources/linux/rpm/code.spec.template b/resources/linux/rpm/code.spec.template
index 61659d2..5cafa06 100644
--- a/resources/linux/rpm/code.spec.template
+++ b/resources/linux/rpm/code.spec.template
@@ -2,3 +2,3 @@ Name: @@NAME@@
Version: @@VERSION@@
-Release: @@RELEASE@@.el7
+Release: el7
Summary: Code editing. Redefined.
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 149c3b9..6d8dd99 100644
--- a/src/vs/base/common/product.ts
+++ b/src/vs/base/common/product.ts
@@ -34,2 +34,3 @@ export interface IProductConfiguration {
readonly version: string;
+ readonly release: string;
readonly date?: string;
diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts
index 561966b..30814a0 100644
--- a/src/vs/platform/diagnostics/node/diagnosticsService.ts
+++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts
@@ -236,3 +236,3 @@ export class DiagnosticsService implements IDiagnosticsService {
const output: string[] = [];
- output.push(`Version: ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
+ output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`);
output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
index 3f50bef..465ca43 100644
--- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts
@@ -49,6 +49,7 @@ else if (typeof require?.__$__nodeRequire === 'function') {
if (!product.version) {
- const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string };
+ const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string, release: string };
Object.assign(product, {
- version: pkg.version
+ version: pkg.version,
+ release: pkg.release
});
diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
index 6a3768d..023eeed 100644
--- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
+++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
@@ -21,2 +21,3 @@ import { MarkdownRenderer } from 'vs/editor/contrib/markdownRenderer/browser/mar
import { defaultButtonStyles, defaultCheckboxStyles, defaultDialogStyles, defaultInputBoxStyles } from 'vs/platform/theme/browser/defaultStyles';
+import { getReleaseString } from 'vs/workbench/common/release';
@@ -147,2 +148,4 @@ export class BrowserDialogHandler implements IDialogHandler {
const detailString = (useAgo: boolean): string => {
+ const releaseString = getReleaseString();
+
return localize('aboutDetail',
@@ -153,3 +156,3 @@ export class BrowserDialogHandler implements IDialogHandler {
navigator.userAgent
- );
+ ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
};
diff --git a/src/vs/workbench/common/release.ts b/src/vs/workbench/common/release.ts
new file mode 100644
index 0000000..2a8ea57
--- /dev/null
+++ b/src/vs/workbench/common/release.ts
@@ -0,0 +1,14 @@
+import { language } from 'vs/base/common/platform';
+
+const DEFAULT_LABEL = 'Release:';
+const LABELS: { [key: string]: string } = {
+ 'en': DEFAULT_LABEL,
+ 'fr': 'Révision :',
+ 'ru': 'Релиз:',
+ 'zh-hans': '发布版本:',
+ 'zh-hant': '發布版本:',
+};
+
+export function getReleaseString(): string {
+ return LABELS[language] ?? DEFAULT_LABEL;
+}
diff --git a/src/vs/workbench/contrib/issue/browser/issueService.ts b/src/vs/workbench/contrib/issue/browser/issueService.ts
index dc7430b..23def01 100644
--- a/src/vs/workbench/contrib/issue/browser/issueService.ts
+++ b/src/vs/workbench/contrib/issue/browser/issueService.ts
@@ -67,2 +67,3 @@ export class WebIssueService implements IWorkbenchIssueService {
Version: ${this.productService.version}
+Release: ${this.productService.release ?? 'unknown'}
Commit: ${this.productService.commit ?? 'unknown'}
diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
index f63b75f..2b77c1b 100644
--- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
+++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts
@@ -17,2 +17,3 @@ import { IProductService } from 'vs/platform/product/common/productService';
import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
+import { getReleaseString } from 'vs/workbench/common/release';
@@ -166,2 +167,3 @@ export class NativeDialogHandler implements IDialogHandler {
const osProps = await this.nativeHostService.getOSProperties();
+ const releaseString = getReleaseString();
@@ -179,3 +181,3 @@ export class NativeDialogHandler implements IDialogHandler {
process.sandboxed ? 'Yes' : 'No' // TODO@bpasero remove me once sandbox is final
- );
+ ).replace('\n', `\n${releaseString} ${this.productService.release || 'Unknown'}\n`);
};