Command Line Build batch file

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

Command Line Build batch file

Postby SteveS on Tue Aug 15, 2006 10:31 pm

Fellow Propellor Heads

I've created a batch file for using the command line method of building projects and thought the nice thing would be to share.

You'll probably want to change the log file location.

Feel free to use it as you wish, but there are no guarantees, use it at your own risk :)
Code: Select all
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Batch file to automate building Flare Outputs            ::
:: Accepts Flare Project as parameter                       ::
:: Drag and drop project onto shortcut or batch file icon   ::
::                                                          ::
:: Created 16 Aug 2006 by Steve Salter                      ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

:: Set CLI window title
Title Building Project

:: Show user something happened
echo Building project outputs, please wait

:: Change to Flare directory
cd C:\\Program Files\\Madcap Software\\Madcap Flare\\Flare.app

:: Create log
echo Project building started > c:\\temp\\madbuild.txt
echo. | date | find /I \"Current\" >> c:\\temp\\madbuild.txt
echo. | time | find /I \"Current\" >> c:\\temp\\madbuild.txt

:: Build project(s)
madbuild -project %1 >> c:\\temp\\madbuild.txt

:: Add completion time to log
echo Project building completed >> c:\\temp\\madbuild.txt
echo. | time | find /I \"Current\" >> c:\\temp\\madbuild.txt


With my larger projects I now have more than enough time to get a Starbucks while a CLI dominates my desktop :wink:
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
User avatar
SteveS
Senior Propellus Maximus
 
Posts: 2303
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).

Postby RamonS on Wed Aug 16, 2006 6:01 am

Richard, Kevin, can we get this transferred to the KB before it disappears in the forum's nirvana?

For those who manage their help sources via source control, add CLI batch code to pull the sources from the source control. Our build engineer did this with great success, except that with RHX5 command line compiles of help were not possible. Now, Flare can do it, Yeah!! 8)

Just, can't you add some simple UI component to Flare that integrates with common source control systems. As far as I know CLI commands are available for all the major systems and should be fairly easy to be implemented in Flare...says me who programmed oh so many applications. :wink:
User avatar
RamonS
Senior Propellus Maximus
 
Posts: 6062
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Postby SteveS on Tue Sep 05, 2006 10:58 pm

Been building projects madly and have come up with a request (if anyone is listening?)

When you use the build button, or the command line, the flag the view button uses isn't reset. So, if you build your project (or individual target) and then click the view target button it reports the target isn't up to date. Annoying with a large build. :?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
User avatar
SteveS
Senior Propellus Maximus
 
Posts: 2303
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).

Problems viewing built output.

Postby claydevin on Wed Sep 06, 2006 10:12 am

That is a handy batch file, thanks.
So when the command line build completes, how does a person see the changes in the output? After successfully running a Madbuild for all targets I press the \"View the Primary Target\" button and it says the Webhelp Target is not up-to-date. After clicking No, the help displayed is that of the last time I pressed the build button, not that of the last command line build.

hope this makes sense.
claydevin
Jr. Propeller Head
 
Posts: 41
Joined: Mon Apr 24, 2006 2:29 pm

Postby SteveS on Wed Sep 06, 2006 4:20 pm

My builds are in the output -> my name -> target name directory.

I've just tested and the directories refreshed. What have you specified for build targets etc?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
User avatar
SteveS
Senior Propellus Maximus
 
Posts: 2303
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).

Postby claydevin on Thu Sep 07, 2006 2:22 pm

I cleaned out all the output files and changed the 'Output Folder' in the Targets to simple paths all in the same folder. Not sure why the output was being buried into deeper folders but all is better now.
Thanks for the post(s).
claydevin
Jr. Propeller Head
 
Posts: 41
Joined: Mon Apr 24, 2006 2:29 pm

Invalid registration code error

Postby TheGreatAndPowerfulOz on Tue Jan 16, 2007 8:08 pm

SteveS,

Thanks for the batch file posting. I've been looking for some way to do this with Flare (was hoping there'd be a front-end \"batch build/publish\", like in RH).

I was all excited to try it out, but was disappointed to get the following error on attempting to execute the BAT file:

Code: Select all
Your MadCap Flare registration code is invalid.

I know darned well that my product is registered; my company's accounting department can attest to that! Any idea why I might be getting the error? Is this a known issue, perhaps, for which there's some sort of workaround?

Oh, forgot to mention that I still haven't upgraded to v2.0 of Flare. We've downloaded the setup package, but our IT group hasn't got around to scheduling the install for me yet. If the issue I'm seeing was \"known\", perhaps it's been addressed in v2.0?

Any suggestions you (or anyone else) could offer would be greatly appreciated.

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 87
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Invalid registration code

Postby SteveS on Tue Jan 16, 2007 8:16 pm

Might be one for Rick or Neal - the thing that springs to mind is the command line build, which the batch file calls, is disabled in the trial version. Something screwy with your installation? :?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
My Blog, I should update it...
User avatar
SteveS
Senior Propellus Maximus
 
Posts: 2303
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).

Postby TheGreatAndPowerfulOz on Tue Jan 16, 2007 8:56 pm

Thanks for the zippy response! Nothing out of the ordinary with the installation, as far as I know. I can live with building one target at a time until our IT gang gets around to installing v2.0 for me. I plan on having the two versions \"co-exist\" on my machine for a while, just to make sure everything goes alright, so I'll try the batch command with 2.0 to see if I get the same issue.

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 87
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Postby Richard Ferrell on Wed Jan 17, 2007 7:30 am

I've seen this issue sometimes if your company has a firewall, Let me know if its still is happening in version 2.0
Richard Ferrell

Certified Madcap Trainer
Image
Richard Ferrell
Senior Propellus Maximus
 
Posts: 3549
Joined: Mon May 01, 2006 10:11 am
Location: SomeWhere in Arizona

Batch file on steroids

Postby TheGreatAndPowerfulOz on Thu Jan 18, 2007 12:14 am

All,

I'm glad to report that I got Flare v2.0 installed today and all is going well with the command line build process!

I figured I'd have a little fun with batch files \"while I was at it\" and came up with quite a spiffy one, based on the one posted here by Steve Salter. This file allows you to list as many of your Targets as you want as parameters, then when you run it, you can choose which one to build (or to build all Targets in the Project). I also tossed in an option dialogue for overwriting vs. appending the log file.

Just like Steve's file, mine is free for the taking. It is also as is, so use at your own risk! I've tested it against my own project and all is working swimmingly. I'm actually running it right now to build all my targets at once!

I was going to include the code here in my post, but it seems that there may be a character limit to what one is allowed to place inside the Code tag (looked OK in the Preview, but then got all messed up when I hit Submit). I'll try it again, but if it doesn't work I guess anyone interested in the batch file can contact me so I can e-mail it to you. I don't see a way to upload/attach a file here, either. :(

If you want the interface to look a bit \"nicer\" (as nice as a DOS window can look), make a shortcut on the Desktop to the .BAT file you create, then right-click it and set the Properties as follows:
    Shortcut tab: Press the Change Icon... button and point to the icon at \"%ProgramFiles%\\MadCap Software\\MadCap Flare V2\\Flare.app\\Flare.exe\"

    Layout tab: Set the Width to 70 and Height to 30 for both the Screen buffer size and the Window size

Thanks to all who offered input as to how to get the command line functionality going for me!

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 87
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Postby Richard Ferrell on Thu Jan 18, 2007 8:24 am

If you want to email it to me, I can create a Knowledge base article of it, and SteveS batch file, Of course giving you credit for it :)

Click on the Email Button and send it to me

Thanks!
Richard Ferrell

Certified Madcap Trainer
Image
Richard Ferrell
Senior Propellus Maximus
 
Posts: 3549
Joined: Mon May 01, 2006 10:11 am
Location: SomeWhere in Arizona

Postby TheGreatAndPowerfulOz on Thu Jan 18, 2007 8:26 am

Richard,

I've decided to tweak a few little things before I \"go public\", so I'll probably e-mail the BAT file to you within another day or so. Thanks!

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 87
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Postby Richard Ferrell on Thu Jan 18, 2007 8:48 am

Looking forward to seeing it, Thank you
Richard Ferrell

Certified Madcap Trainer
Image
Richard Ferrell
Senior Propellus Maximus
 
Posts: 3549
Joined: Mon May 01, 2006 10:11 am
Location: SomeWhere in Arizona

Re: Problems viewing built output.

Postby TheGreatAndPowerfulOz on Fri Jan 19, 2007 7:39 am

claydevin wrote:... After successfully running a Madbuild for all targets I press the "View the Primary Target" button and it says the Webhelp Target is not up-to-date...


Through a little investigative work while creating my own batch file (I've e-mailed it to Richard Ferrell, by the way), I discovered that when you don't specify a target while running the command line build (when you build all targets), the flag that indicates "up-to-date-edness" is NOT flipped. If you DO specify a target, the flag IS flipped, so subsequent attempts to view or publish will reflect that output is up-to-date.

Austin.
TheGreatAndPowerfulOz
Jr. Propeller Head
 
Posts: 87
Joined: Mon Apr 24, 2006 12:52 pm
Location: Glen Mills, PA

Next

Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 0 guests