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.

Note: The Windows Command Prompt shortcut launches the 16-bit command.com shell. The AcuBench command-line interface does not function in this environment. Instead, open the Start menu and click Run. In the Run dialog box, enter cmd to launch the 32-bit 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]\acubench80.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:\Micro Focus\Acucbl800\acubench\acubench80.exe /build c:\project1\project1.pjt

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.

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]\acubench80.exe /build [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, the script builds three programs residing in two workspaces and prints compiler success or failure messages to the screen:

@echo off
rem -------------------------------------------------------------
set bench_80="C:\microfocus\acucbl800\acubench\acubench80"
echo *************************************************************
echo ... now building program1
%bench_80% /build c:\project1\sample1.pjt program1.psf
IF %errorlevel%==0 ECHO Success.
IF NOT %errorlevel%==0 ECHO Fail.
echo.
echo ... now building program5
%bench_80% /build c:\project1\sample1.pjt program5.psf
IF %errorlevel%==0 ECHO Success.
IF NOT %errorlevel%==0 ECHO Fail.
echo.
echo ... now building sample25
%bench_80% /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.

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

acubench /extract AcuBench.Bin

This results in a number of .Asp files, which can be modified. After modifying them, you need to rebundle the files back into AcuBench.Bin, with a new /bundle option:

acubench /bundle AcuBench.Bin

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