Automatically inject lincense into transformed worker file
@@ -19,11 +19,6 @@ let output = `
// This file is part of BenchExec, a framework for reliable benchmarking:
// https://github.com/sosy-lab/benchexec
//
-// SPDX-FileCopyrightText: 2019-2020 Dirk Beyer <https://www.sosy-lab.org>
-//
-// SPDX-License-Identifier: Apache-2.0
-
-
`;
const workerNames = [];
@@ -31,10 +26,15 @@ for (const worker of workerFiles) {
const workerName = worker.split(".")[0];
workerNames.push(workerName);
const workerPath = path.join(workerFilePath, worker);
- output += "\n";
- output += `const ${workerName} = "${template}${fs
- .readFileSync(workerPath)
- .toString("base64")}";`;
+ const workerScript = fs.readFileSync(workerPath);
+ output += workerScript
+ .toString()
+ .match(/^ *\/\/\s?SPDX-.*?$/gim)
+ .join("\n//\n");
+ output += "\n\n";
+ output += `const ${workerName} = "${template}${Buffer.from(
+ workerScript,
+ ).toString("base64")}";`;
}
output += "\n\n\n";
output += `export { ${workerNames.join(", ")} };`;
