Exit code for madbuild.exe?

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.

Exit code for madbuild.exe?

Postby chi111y on Mon Jul 26, 2010 10:59 am

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
chi111y
Jr. Propeller Head
 
Posts: 3
Joined: Mon Jul 26, 2010 10:54 am

Re: Exit code for madbuild.exe?

Postby chi111y on Tue Aug 10, 2010 12:05 am

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.
chi111y
Jr. Propeller Head
 
Posts: 3
Joined: Mon Jul 26, 2010 10:54 am

Re: Exit code for madbuild.exe?

Postby SteveS on Tue Aug 10, 2010 2:50 pm

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?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
SteveS
Propellus Maximus
 
Posts: 1978
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).

Re: Exit code for madbuild.exe?

Postby Madcap Guru on Thu Aug 26, 2010 9:12 am

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
Image
Madcap Guru
Sr. Propeller Head
 
Posts: 234
Joined: Tue Mar 17, 2009 10:41 pm

Re: Exit code for madbuild.exe?

Postby kwshaw1 on Sun Mar 06, 2011 10:14 am

Anyone know if this issue has been addressed in Flare v7?
kwshaw1
Jr. Propeller Head
 
Posts: 4
Joined: Mon Dec 06, 2010 4:23 pm

Re: Exit code for madbuild.exe?

Postby Greenland on Mon Apr 18, 2011 3:17 am

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.
Greenland
Propeller Head
 
Posts: 11
Joined: Fri Oct 05, 2007 7:44 am

Re: Exit code for madbuild.exe?

Postby Dave Lee on Tue Apr 26, 2011 6:25 am

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).


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).

This behaviour hasn't changed in v7, it works the same in v6.
Dave Lee
Master Propellus Maximus
 
Posts: 5657
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Exit code for madbuild.exe?

Postby Greenland on Wed May 04, 2011 1:05 am

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)
Greenland
Propeller Head
 
Posts: 11
Joined: Fri Oct 05, 2007 7:44 am

Re: Exit code for madbuild.exe?

Postby Dave Lee on Wed May 04, 2011 2:40 am

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.


That shouldn't be a problem, as an individual target's publish setting is independent of what you set up in a batch target.

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.
Dave Lee
Master Propellus Maximus
 
Posts: 5657
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Exit code for madbuild.exe?

Postby JGreen on Tue Jun 21, 2011 8:56 pm

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.
JGreen
Jr. Propeller Head
 
Posts: 1
Joined: Tue Jun 21, 2011 8:51 pm

Re: Exit code for madbuild.exe?

Postby LTinker68 on Wed Jun 22, 2011 8:49 am

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.

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.

Welcome to the forums, though.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
LTinker68
Master Propellus Maximus
 
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Re: Exit code for madbuild.exe?

Postby chi111y on Wed Mar 07, 2012 10:15 am

Hurrah! madbuild.exe version 8 finally supports this feature! (Didn't get an email as promised though :P )

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... :?
chi111y
Jr. Propeller Head
 
Posts: 3
Joined: Mon Jul 26, 2010 10:54 am

Re: Exit code for madbuild.exe?

Postby pvz on Tue Oct 01, 2013 3:47 pm

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/flare9/Default.htm#Output/Building_Targets_Using_the_Command_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
pvz
Propeller Head
 
Posts: 18
Joined: Wed Mar 05, 2008 3:27 pm
Location: Seattle

Re: Exit code for madbuild.exe?

Postby Carsten Pedersen on Wed May 20, 2015 12:36 am

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
Carsten Pedersen
Propeller Head
 
Posts: 95
Joined: Wed Feb 08, 2006 1:11 am

Re: Exit code for madbuild.exe?

Postby ChoccieMuffin on Wed May 20, 2015 3:52 am

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 2019r1.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
ChoccieMuffin
Senior Propellus Maximus
 
Posts: 2147
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Exit code for madbuild.exe?

Postby Zanderxo on Wed Dec 21, 2016 2:10 pm

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?
Zanderxo
Propeller Head
 
Posts: 32
Joined: Mon Mar 09, 2015 5:28 pm


Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest