Hi all,
I have been attempting to use FinalBuilder (v.4.2.0.276) to build a large project, which contains a number of BCB5 projects. I am aware of a variety of issues with the BCB5 command line compiler, not all of which are fixed by the “Compile C++ Builder Project” action. So I am attempting a work-around by running the IDE compiler from a batch file (IDE automation).
My problem is that my batch file can successfully use commandline error codes to determine if the IDE build passes (ERRORLEVEL 0) or fails (ERRORLEVEL 1), but I would like FinalBuilder to have an “Error” status if the BCB project fails to build.
I have tried setting the Min Success Code to 1 and having my batch file finish (for error) with “exit /b 0” and with “exit 0”, but it always passes.
Does anybody have any clue on how I can force FinalBuilder’s “Run DOS Command” action to fail when running a batch file?
Thanks,
Rob
Hi Rob
Unfortunately command.com or cmd.com doesn’t return the exit codes from batch files. It might be better to use the execute program action and execute the IDE directly.
One obvious solution is to dump a file like “error.txt” in the current directory just before you terminate the batch file in error. Then check for its existence in FB after the batch file step.Actually I just tested running a batch file with the “Execute program” action, and it detected the error code fine (using “exit 5” as the last line of the batch file). Were you using that or the “Run DOS command” action? You should only use that one if you need redirection (>, <, |…)Steve
Thanks guys,
I actually had been confused about the term “Min Success Code” in the Execute Program properties. I misunderstood it to mean anything higher than that value would pass.
By exiting with “Exit 1” I get the fail that I was looking for, and “Exit 0” passes.
Works great now!
BTW: the BCB issues that I have encountered seem to reflect these that I found while looking for a quick fix to (1):
1. Trailing backslash followed by a double-quote – gets treated like an
escape-double-quote by MAKE
2. Trailing backslash NOT followed by a double-quote – gets treated like a
line-continuation character by MAKE
3. ‘-B’ (used to set the base image address) strips relocation information
from the executable
Link to discussion on the BCB5/6 issues: http://www.mombu.com/programming/clu/t-make-fails-with-spaces-in-target-directory-552178.html
Thanks again,
Rob