mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Adds better buildtool errors when using byond 514 or older (#81129)
Every time someone asks what -DCBT means i lose sleep so here's a slightly invasive solution. Build will now check if the dm version is at least 515.1597 (first version with -D switch), at the cost of having to run dry dm.exe run.
This commit is contained in:
@@ -145,10 +145,29 @@ export const DreamMaker = async (dmeFile, options = {}) => {
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
const testDmVersion = async (dmPath) => {
|
||||
const execReturn = await Juke.exec(dmPath, [], { silent: true, throw: false });
|
||||
const version = execReturn.combined.match(`DM compiler version (\\d+)\\.(\\d+)`)
|
||||
if(version == null){
|
||||
Juke.logger.error(`Unexpected DreamMaker return, ensure "${dmPath}" is correct DM path.`)
|
||||
throw new Juke.ExitCode(1);
|
||||
}
|
||||
const requiredMajorVersion = 515;
|
||||
const requiredMinorVersion = 1597 // First with -D switch functionality
|
||||
const major = Number(version[1]);
|
||||
const minor = Number(version[2]);
|
||||
if(major < requiredMajorVersion || major == requiredMajorVersion && minor < requiredMinorVersion){
|
||||
Juke.logger.error(`${requiredMajorVersion}.${requiredMinorVersion} DM version required`)
|
||||
throw new Juke.ExitCode(1);
|
||||
}
|
||||
}
|
||||
|
||||
await testDmVersion(dmPath);
|
||||
testOutputFile(`${dmeBaseName}.dmb`);
|
||||
testOutputFile(`${dmeBaseName}.rsc`);
|
||||
const runWithWarningChecks = async (dmeFile, args) => {
|
||||
const execReturn = await Juke.exec(dmeFile, args);
|
||||
const runWithWarningChecks = async (dmPath, args) => {
|
||||
const execReturn = await Juke.exec(dmPath, args);
|
||||
const ignoredWarningCodes = options.ignoreWarningCodes ?? [];
|
||||
const reg = ignoredWarningCodes.length > 0 ? new RegExp(`\d+:warning: (?!(${ignoredWarningCodes.join('|')}))`) : /\d+:warning: /;
|
||||
if (options.warningsAsErrors && execReturn.combined.match(reg)) {
|
||||
|
||||
Reference in New Issue
Block a user