Building a Specific Target Using the Command Line

You can build a particular target in your project via the command line.

How to Build a Specific Target Using the Command Line

  1. Open Notepad (to create and save a batch file) or open your command prompt (to run a command immediately).
  2. Type the path to the Flare.app folder where you installed Flare Desktop, and press ENTER.

    cd\Program Files\MadCap Software\MadCap Flare 21\Flare.app

    Note Alternatively, you can use cd c:\Program Files\[rest of the path] instead of cd\Program Files\[rest of the path].

  1. Type the following and press ENTER on your keyboard (entering the path to your project and the name of the target in place of the sections in square brackets):

    Copy
    madbuild -project [project] -target [target name]

    A log file is generated and saved automatically at the root level of the output folder for that target, whether or not there are errors or warnings. See Opening Build Logs.

    Note The default location for targets is in the root Targets folder in the Project Organizer. However, you can create subfolders and place different targets in different folders (see Creating Subfolders). If you do this, make sure you include the subfolder name in your command. You can do this by typing the name of the subfolder, followed by a slash, and then the name of the target (i.e., madbuild -project [project] -target [mysubfoldername/mytargetname]).

    Note If there are spaces anywhere in your path or project name, you need to use quotation marks around it.

    Example You have a project called "FictionSoftPro" that you have stored in a folder of the same name at the root level of the C: drive. If you want to build only the target named "Beginner" in that project, you can type this:

    Copy
    madbuild -project c:\fictionsoftpro\fictionsoftpro.flprj -target Beginner

    Example If the project is located in a folder called "my projects" (with a space), you would type this:

    Copy
    madbuild -project "c:\my projects\fictionsoftpro.flprj" -target Beginner

    Example If the target is named "Beginner Online Help" (with spaces between words), you would type this:

    Copy
    madbuild -project "c:\my projects\fictionsoftpro.flprj" -target "Beginner Online Help"

    If you are using the command prompt window, the targets in that project generate immediately, and the output files are copied to the Output subfolder in your main project folder.

    If you are creating a batch file in Notepad, it might look something like this: