Skip to content

Commit 950bfce

Browse files
committed
Add commit, date, and checksums to product.json
1 parent 5b64cb3 commit 950bfce

2 files changed

Lines changed: 38 additions & 11 deletions

File tree

scripts/tasks.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ function build-code-server() {
7272
cd "${buildPath}" && yarn --production --force --build-from-source
7373
rm "${buildPath}/"{package.json,yarn.lock,.yarnrc}
7474

75-
local json="{\"codeServerVersion\": \"${codeServerVersion}\"}"
75+
local packageJson="{\"codeServerVersion\": \"${codeServerVersion}\"}"
7676
cp -r "${sourcePath}/.build/extensions" "${buildPath}"
77-
node "${rootPath}/scripts/merge.js" "${sourcePath}/package.json" "${rootPath}/scripts/package.json" "${buildPath}/package.json" "${json}"
78-
node "${rootPath}/scripts/merge.js" "${sourcePath}/product.json" "${rootPath}/scripts/product.json" "${buildPath}/product.json"
77+
node "${rootPath}/scripts/merge.js" "${sourcePath}/package.json" "${rootPath}/scripts/package.json" "${buildPath}/package.json" "${packageJson}"
78+
node "${rootPath}/scripts/merge.js" "${sourcePath}/.build/product.json" "${rootPath}/scripts/product.json" "${buildPath}/product.json"
7979
cp -r "${sourcePath}/out-vscode${min}" "${buildPath}/out"
8080

8181
# Only keep production dependencies for the server.

scripts/vscode.patch

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ index 0dd2e5abf1..fc6875f3c2 100644
1111
// All Build
1212
const compileBuildTask = task.define('compile-build', task.parallel(compileClientBuildTask, compileExtensionsBuildTask));
1313
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
14-
index 84a6be26e8..7fb43686cd 100644
14+
index 84a6be26e8..e50618be3a 100644
1515
--- a/build/gulpfile.vscode.js
1616
+++ b/build/gulpfile.vscode.js
1717
@@ -34,7 +34,8 @@ const deps = require('./dependencies');
@@ -85,23 +85,50 @@ index 84a6be26e8..7fb43686cd 100644
8585
),
8686
common.optimizeTask({
8787
src: 'out-build',
88-
@@ -127,6 +134,20 @@ const minifyVSCodeTask = task.define('minify-vscode', task.series(
89-
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
88+
@@ -104,7 +111,8 @@ const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
89+
header: BUNDLED_FILE_HEADER,
90+
out: 'out-vscode',
91+
bundleInfo: undefined
92+
- })
93+
+ }),
94+
+ () => writeProduct()
95+
));
96+
97+
98+
@@ -124,9 +132,36 @@ const minifyVSCodeTask = task.define('minify-vscode', task.series(
99+
util.rimraf('out-vscode-min'),
100+
optimizeIndexJSTask
101+
),
102+
- common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
103+
+ common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`),
104+
+ () => writeProduct('out-vscode-min')
90105
));
91106

92107
+function packageExtensionsTask() {
93-
+ return () => {
94-
+ const destination = path.join(root, ".build");
95-
+ const sources = ext.packageExtensionsStream();
96-
+ return sources.pipe(vfs.dest(destination));
97-
+ };
108+
+ return () => ext.packageExtensionsStream().pipe(vfs.dest(path.join(root, '.build')));
98109
+}
99110
+gulp.task(task.define('extensions-build-package', task.series(
100111
+ compileExtensionsBuildTask,
101112
+ packageExtensionsTask()
102113
+)));
103114
+gulp.task(optimizeVSCodeTask);
104115
+gulp.task(minifyVSCodeTask);
116+
+function writeProduct(sourceFolderName) {
117+
+ const checksums = sourceFolderName && computeChecksums(sourceFolderName, [
118+
+ 'vs/workbench/workbench.web.api.js',
119+
+ 'vs/workbench/workbench.web.api.css',
120+
+ 'vs/code/browser/workbench/workbench.html',
121+
+ 'vs/code/browser/workbench/workbench.js',
122+
+ 'vs/server/src/cli.js',
123+
+ 'vs/server/src/uriTransformer.js',
124+
+ 'vs/server/src/login/index.html'
125+
+ ]);
126+
+ const date = new Date().toISOString();
127+
+ const productJsonUpdate = { commit, date, checksums };
128+
+ return gulp.src(['product.json'], { base: '.' })
129+
+ .pipe(json(productJsonUpdate))
130+
+ .pipe(vfs.dest(path.join(root, '.build')));
131+
+}
105132
+
106133
// Package
107134

0 commit comments

Comments
 (0)