This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pre build batch file exit code

Hello all

I'd like to use a windows batch-file (preBuild.bat) as pre-build script. If the preBuild.bat detects an error, the build process should be stopped. This works perfectly if the pre-build "script" is a regular .exe, returning a non zero value.

However, I am not successful when returning a non zero value using the preBuild.bat batch file.

I tried to use

exit 1

in the .bat file, but uVision seems to ignore the return value of .bat files.

Any ideas?

Thanks & regards,
Martin

Parents
  • Just received the answer from Keil Support:

    Dear Martin,

    you are right, also calling a script via "cmd /C" which returns an error level code => 1
    will not stop the build process. When using a exe file the evaluation of the error level code
    works as expected. I will talk to our development team if this is intended (guess not) and will
    try to get it fixed with the next version.

    Please be patient! I'll keep you posted.

    I'm still interested if someone comes up with a smart workaround.

Reply
  • Just received the answer from Keil Support:

    Dear Martin,

    you are right, also calling a script via "cmd /C" which returns an error level code => 1
    will not stop the build process. When using a exe file the evaluation of the error level code
    works as expected. I will talk to our development team if this is intended (guess not) and will
    try to get it fixed with the next version.

    Please be patient! I'll keep you posted.

    I'm still interested if someone comes up with a smart workaround.

Children