Exit code for madbuild.exe?
Exit code for madbuild.exe?
Hi,
My Hudson CI server runs a madbuild.exe batch job each night to build updated documentation. Unfortunately, I haven't been able to find any information about whether madbuild.exe returns a non-zero exit code if an error occurs. Usually this would be done on Windows by setting the %ERRORLEVEL% environment variable...
Without being able to check the exit code, I can't easily check if the build has failed.
Does anyone know if madbuild.exe supports this?
Will
My Hudson CI server runs a madbuild.exe batch job each night to build updated documentation. Unfortunately, I haven't been able to find any information about whether madbuild.exe returns a non-zero exit code if an error occurs. Usually this would be done on Windows by setting the %ERRORLEVEL% environment variable...
Without being able to check the exit code, I can't easily check if the build has failed.
Does anyone know if madbuild.exe supports this?
Will
Re: Exit code for madbuild.exe?
Since no one replied, I sent a request to tech support and got this answer:
Thank you for contacting MadCap Technical Support.
Unfortunately madbuild currently does not support this feature. I've submitted a enhancement request to the developers regarding this issue. In the future, please reference this request with the number 37353. If this enhancement is implemented, we'll send you an e-mail mentioning this reference number.
-
- Senior Propellus Maximus
- Posts: 2089
- Joined: Tue Mar 07, 2006 5:06 pm
- Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
- Contact:
Re: Exit code for madbuild.exe?
Hi chi111y,
Welcome to the forums.
That being the case can you use your batch file as a wrapper for madbuild and do some form of test from within the .bat to confirm it has run correctly?
Welcome to the forums.
That being the case can you use your batch file as a wrapper for madbuild and do some form of test from within the .bat to confirm it has run correctly?
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
-
- Sr. Propeller Head
- Posts: 238
- Joined: Tue Mar 17, 2009 10:41 pm
Re: Exit code for madbuild.exe?
There has been alkot of requests for that in the past, and the more people who request it the better the chance it will be added in the future,
Rick Ferrell
____________________________
Former Flare and Robohelp Support
____________________________
Former Flare and Robohelp Support
Re: Exit code for madbuild.exe?
Anyone know if this issue has been addressed in Flare v7?
Re: Exit code for madbuild.exe?
I've just made the test, and I'm quite disapointed that it still doesn't. Exit code seems to always equal 0.
Also, the madbuild.exe command will now automatically publish the generated documentation if a publishing target is specified in the project, and there is no option to prevent this (we were publishing with our own software beacause the MadCap publishing is actually not removing stale files properly).
It would be really nice to a have a command line builder that is able to return a status code, as we have currently no way of knowing if a documentation have been properly built or not.
Also, the madbuild.exe command will now automatically publish the generated documentation if a publishing target is specified in the project, and there is no option to prevent this (we were publishing with our own software beacause the MadCap publishing is actually not removing stale files properly).
It would be really nice to a have a command line builder that is able to return a status code, as we have currently no way of knowing if a documentation have been properly built or not.
Re: Exit code for madbuild.exe?
There is an option to prevent it publishing; on the target's Publishing tab, remove the tick from the Publish box for the destination(s).Greenland wrote:Also, the madbuild.exe command will now automatically publish the generated documentation if a publishing target is specified in the project, and there is no option to prevent this (we were publishing with our own software beacause the MadCap publishing is actually not removing stale files properly).
This behaviour hasn't changed in v7, it works the same in v6.
Re: Exit code for madbuild.exe?
Thanks fo the answer Dave. Indeed this option exists, but I wanted to be able to publish targets when building manually while not publishing them when batch building our project. However, we have changed our batches to adapt to this new behavior (also, we never used v6 of Flare, but went directly from v5 to v7, which is maybe why there are more diffrence for us to adjust to)
Re: Exit code for madbuild.exe?
That shouldn't be a problem, as an individual target's publish setting is independent of what you set up in a batch target.Greenland wrote:Thanks fo the answer Dave. Indeed this option exists, but I wanted to be able to publish targets when building manually while not publishing them when batch building our project.
If you set a destination on the target's Publishing tab, it will be published if you do a command line build of the target (madbuild -target YourTarget).
However, if you include that target in a batch target, then the target isn't automatically published when you run the batch target (madbuild -batch YourBatchTarget); it will only be published if you have set it to publish in the batch target settings.
Re: Exit code for madbuild.exe?
Seriously guys, having a command line tool that knows of warnings and errors (as evidenced by the console output) but returns success (exit code 0) is amateurish in the extreme.
If your internal developers can't scatter some return x statements through the code it'd have to be cheap to outsource it somewhere.
If your internal developers can't scatter some return x statements through the code it'd have to be cheap to outsource it somewhere.
Re: Exit code for madbuild.exe?
This is a peer-to-peer forum, not a support forum, so they're not our developers. You can submit a bug report at http://www.madcapsoftware.com/bugs/submit.aspx.JGreen wrote:If your internal developers can't scatter some return x statements through the code it'd have to be cheap to outsource it somewhere.
Welcome to the forums, though.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Exit code for madbuild.exe?
Hurrah! madbuild.exe version 8 finally supports this feature! (Didn't get an email as promised though )
http://webhelp.madcapsoftware.com/flare ... d_Line.htm
My experience is that it's not completely bug-free however: contrary to what the docs in the link above mention, a successful build doesn't automatically set ERRORLEVEL to 0 - it simply leaves it at the value it was previously. It's therefore necessary to explicitly set ERRORLEVEL to 0 before madbuild is run.
To be honest, I don't know what *would* trigger a build failure. I tried removing a linked source file, and while the log shows an error ("Missing linked source file...") the ERRORLEVEL still remains unset. I'm going to check with MadCap support and see what the deal is. There's not much user value in having an error code if the only error it reports is an invalid license...
http://webhelp.madcapsoftware.com/flare ... d_Line.htm
My experience is that it's not completely bug-free however: contrary to what the docs in the link above mention, a successful build doesn't automatically set ERRORLEVEL to 0 - it simply leaves it at the value it was previously. It's therefore necessary to explicitly set ERRORLEVEL to 0 before madbuild is run.
To be honest, I don't know what *would* trigger a build failure. I tried removing a linked source file, and while the log shows an error ("Missing linked source file...") the ERRORLEVEL still remains unset. I'm going to check with MadCap support and see what the deal is. There's not much user value in having an error code if the only error it reports is an invalid license...
Re: Exit code for madbuild.exe?
Hoping to help someone else (and avoid an unnecessary feature request to Madcap), the v9 documentation includes a (more) complete list of error codes listed under the "ErrorLevel global variable" dropdown:
http://webhelp.madcapsoftware.com/flare ... d_Line.htm
common codes
0 = Success - No problems
1 = One or more Target Builds failed – One or more of the targets failed to compile
2 = One or more Publish Targets failed – One or more of the targets failed to compile
3 = Build completed with compiler warnings
4 = Compiler reported errors
5 = Failed to process one or more project import files
6 = Failed to load topic
7 = Missing linked file
other codes
-1 = Application error – Something critical has forced Flare to close
1000 = Zero arguments passed in
1001 = Show Help
2000 = Unlicensed Flare
2001 = Flare not activated
2002 = Invalid license activation code
2003 = License expired
2004 = Evaluation expired
2005 = Trial expired
2006 = Project does not exist
2007 = Batch file does not exist
http://webhelp.madcapsoftware.com/flare ... d_Line.htm
common codes
0 = Success - No problems
1 = One or more Target Builds failed – One or more of the targets failed to compile
2 = One or more Publish Targets failed – One or more of the targets failed to compile
3 = Build completed with compiler warnings
4 = Compiler reported errors
5 = Failed to process one or more project import files
6 = Failed to load topic
7 = Missing linked file
other codes
-1 = Application error – Something critical has forced Flare to close
1000 = Zero arguments passed in
1001 = Show Help
2000 = Unlicensed Flare
2001 = Flare not activated
2002 = Invalid license activation code
2003 = License expired
2004 = Evaluation expired
2005 = Trial expired
2006 = Project does not exist
2007 = Batch file does not exist
-
- Propeller Head
- Posts: 95
- Joined: Wed Feb 08, 2006 1:11 am
Re: Exit code for madbuild.exe?
More about the error code, or ERRORLEVEL.
Now in MadCap Flare v11 you have the Batch Target feature. How does the %ERRORLEVEL% act in this situation?
I, and probably also others, just want an indication if there are any errors or not. In larger project it is very difficult to avoid getting
a ton of warnings, but we aim at getting no errors
-cpede
Now in MadCap Flare v11 you have the Batch Target feature. How does the %ERRORLEVEL% act in this situation?
I, and probably also others, just want an indication if there are any errors or not. In larger project it is very difficult to avoid getting
a ton of warnings, but we aim at getting no errors
-cpede
-
- Senior Propellus Maximus
- Posts: 2632
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Exit code for madbuild.exe?
Carsten, thank you so much for bringing this up, it's at a perfect time! I don't have any answers to the question but I wait with baited breath for one of the gurus to point me in the right direction.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Exit code for madbuild.exe?
I am receiving an ExitCode of 2010 (and no output). What does this mean?
Also, it would be nice to have more information about each of the ExitCodes. Does this information exist somewhere?
Also, it would be nice to have more information about each of the ExitCodes. Does this information exist somewhere?