The Command-line Interface to AcuBench

To make it easier to manage multiple small projects, AcuBench has a command-line interface that allows you to generate and build workspaces from the Windows cmd shell.

The AcuBench command-line interface allows you to generate and build an entire workspace, or any program within a workspace. By default, whichever project mode is currently active for the project (as recorded in the .pjt file) is used to determine the compiler settings used for the build.

Tip: To ensure that you know which project mode you are using, you can create multiple copies of the PJT file. To do this, set a project mode (such as Release) in AcuBench, then save and close the workspace. Make a copy of the PJT file and give it a new name (Prj1-Release.pjt). Repeat the process for each of the project modes that you want to invoke from the command line. When you want to build a project in a particular mode, refer to the appropriate PJT file.

It is important to remember that only a single instance of each AcuBench version can run on a given machine. This means that you must close the IDE before using the command-line interface.

Building a Workspace

The syntax for building a workspace using the command-line interface is as follows:

[acupath]\acubench.exe /build [projectdir]\[workspace.pjt]

For example, if you have AcuBench installed in the default directory, and you would like to generate and build a workspace called Project1, use the following command:

C:\Program Files (x86)\Micro Focus\extend x.x.x\acubench\acubench.exe /build C:\project1\project1.pjt

where x.x.x is the extend version number.

From the command-line interface, the /build and /rebuild flags are interchangeable. With either parameter, AcuBench checks whether code has changed since the last build. If any part of the program has changed, the code is regenerated and compiled. This is the same behavior that you get when you execute a Build Workspace command from the AcuBench Build menu.

Generating a Workspace

The syntax for generating a workspace using the command-line interface is as follows:

[acupath]\acubench.exe /generate [projectdir]\[workspace.pjt]

For example, if you have AcuBench installed in the default directory, and you would like to generate a workspace called Project1, use the following command:

C:\Program Files (x86)\Micro Focus\extend x.x.x\acubench\acubench.exe /generate C:\project1\project1.pjt

AcuBench regenerates the code but does not build the programs. This is the same behavior that you get when you execute a Regenerate Workspace command from the AcuBench Build menu.

The Log File

All output messages generated during the build are recorded in a file called build.log, placed in the project directory for the workspace being built. If this log file does not exist, it is created. If the log file already exists, messages generated by the new build are appended to the existing log. The log file also includes the start and end times for the build.

Building a Single Program

To generate and build a single program in a project, the syntax is as follows:

[acupath]\acubench.exe /build [projectdir]wkspc.pjt prg.psf

Generating a Single Program

To generate a single program in a project, the syntax is as follows:

[acupath]\acubench.exe /generate [projectdir]wkspc.pjt prg.psf

Using a Build Script

To generate and build multiple workspaces at the same time, you can create Windows script (batch) files. In the following example, using extend 10.0.0, the script builds three programs residing in two workspaces and prints compiler success or failure messages to the screen:

@echo off
rem -------------------------------------------------------------
set bench_10="C:\Program Files (x86)\Micro Focus\extend 10.0.0\acubench\acubench"
echo *************************************************************
echo ... now building program1
%bench_10% /build C:\project1\sample1.pjt program1.psf
IF %errorlevel%==0 ECHO Success.
IF NOT %errorlevel%==0 ECHO Fail.
echo.
echo ... now building program5
%bench_10% /build C:\project1\sample1.pjt program5.psf
IF %errorlevel%==0 ECHO Success.
IF NOT %errorlevel%==0 ECHO Fail.
echo.
echo ... now building sample25
%bench_10% /build C:\demos\demos.pjt sample25.psf
IF %errorlevel%==0 ECHO Success.
IF NOT %errorlevel%==0 ECHO Fail.
echo.

Likewise, a script file could be used to build several complete workspaces and create a log file, or send a message to the system administrator when the builds are complete.

Modifying the AcuBench Skeletons

Important: We advise you to make a backup copy of AcuBench.Bin before attempting this procedure.

You can extract all of the skeletons from AcuBench.Bin by executing acubench with the /extract option:

acubench /extract AcuBench.Bin

This results in a number of .asp files (for example, AcuCbl.asp), which can be modified. After modifying them, you need to rebundle the files back into AcuBench.Bin, with the /bundle option:

acubench /bundle AcuBench.Bin