Skip to content

Commit 5f93ce9

Browse files
committed
build-system: only write version.txt once
1 parent 666a5e8 commit 5f93ce9

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

build-system/tasks/dist.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const {
2323
const {
2424
displayLifecycleDebugging,
2525
} = require('../compile/debug-compilation-lifecycle');
26+
const {
27+
VERSION: internalRuntimeVersion,
28+
} = require('../compile/internal-version');
2629
const {buildCompiler} = require('../compile/build-compiler');
2730
const {buildExtensions, parseExtensionFlags} = require('./extension-helpers');
2831
const {buildVendorConfigs} = require('./3p-vendor-helpers');
@@ -118,6 +121,7 @@ async function dist() {
118121
if (argv.core_runtime_only) {
119122
steps.push(compileCoreRuntime(options));
120123
} else {
124+
steps.push(writeVersionFile());
121125
steps.push(buildExperiments());
122126
steps.push(buildLoginDone('0.1'));
123127
steps.push(buildWebPushPublisherFiles());
@@ -148,6 +152,17 @@ async function dist() {
148152
}
149153
}
150154

155+
/**
156+
* Writes the verion.txt file.
157+
* @return {!Promise}
158+
*/
159+
async function writeVersionFile() {
160+
return fs.writeFile(
161+
path.join('dist', 'v0', 'version.txt'),
162+
internalRuntimeVersion
163+
);
164+
}
165+
151166
/**
152167
* Build AMP experiments.js.
153168
* @return {Promise<void>}

build-system/tasks/helpers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ async function compileMinifiedJs(srcDir, srcFilename, destDir, options) {
313313

314314
const destPath = path.join(destDir, minifiedName);
315315
combineWithCompiledFile(srcFilename, destPath, options);
316-
fs.writeFileSync(path.join(destDir, 'version.txt'), internalRuntimeVersion);
317316
if (options.latestName) {
318317
fs.copySync(
319318
destPath,

0 commit comments

Comments
 (0)