mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
Automatically update karma.conf.js.
When javascript files are changed, removed or added, the build system will update karma.conf.js.
This commit is contained in:
committed by
Tobias Hintze
parent
3e313cc561
commit
9f9869509f
@@ -409,6 +409,23 @@ function Main(cmakeListPath) {
|
||||
);
|
||||
}
|
||||
|
||||
function updateKarmaConfig(deps) {
|
||||
var path = "tools/karma.conf.js",
|
||||
modules = createOrderedList(Object.keys(deps.lib), deps.lib, {});
|
||||
fs.readFile(path, "utf8", function (err, content) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
var re = new RegExp("// MODULES\n[^!]+!");
|
||||
content = content.replace(re,
|
||||
"// MODULES\n 'lib/" +
|
||||
modules.join("',\n 'lib/") + "', // !");
|
||||
saveIfDifferent(path, content, function () {
|
||||
console.log("karma.conf.js was updated. Rerun the build.");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Deterministic serialization of manifest.
|
||||
* JSON.stringify does not order objects by key.
|
||||
@@ -495,6 +512,7 @@ function Main(cmakeListPath) {
|
||||
saveIfDifferent(d + "manifest.json", serializeManifest(j));
|
||||
}
|
||||
updateCMakeLists(deps);
|
||||
updateKarmaConfig(deps);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user