ID:1767137
 
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
Would be nice to have an option somewhere in DreamMaker to run something before and/or after compiling (eg "cmd \K 'somescript.bat'" or "sh sed s\myname\releasename").
Also would be nice to abort compilation if those return a failure value (1 by convention).

Just a minor quality-of-life thing for people using DreamMaker (and the rest of us, so we can introduce helpful things into the build chain more easily).

Right now there's 3 main use cases.

1: Map cleaner tools (which help by minimizing line changes, making code review easier: otherwise the .dmm has almost all lines changed and produces ghastly diffs). Right now they're run manually, at least the backup tool would be useful to run before every build. Can never be too safe, especially after one too many file corruptions and setbacks.

2. Code review helpers. Sometimes called "linters" in curly-brace-only languages. Basically to scan the code and report things that would otherwise only be found when others review the code in pull requests/etc. Many open-source codebases enforce standards and even style guides: for example, the color macros (\red,\blue,...) are deprecated, relative pathing for some defines is discouraged, goto is considered harmful, etc. Useful to run these at compile time to catch problems early.

3. Pre-processor. This is more experimental, mainly interested in seeing what an "active" preprocessor can do. There's 2 python utilities that are interesting since they offer running python code at compile-time: this might let us cut down on boilerplate, do advanced calculations, and populate lookup tables, but the added complexity might not be worth it. Either way, if it turns out to be great, it'd be good to extend the benefit to DreamMaker users as well.

I take umbrage to goto being considered harmful. It's only considered so by pedants. Goto is dangerous if misused, but not inherently bad.

Fun fact: BYOND's code is littered with goto. There are many routines where we need to do wrapup before a return, and goto is the easiest, best way to handle that gracefully. This is probably the safest possible use of it, though.
This would be really handy, I'd like this too.

Edit: And, looking at http://www.byond.com/forum/?post=1713711 I realise that could be done if this request was implemented. It'd be great, really.