Before you use Apache Ant you need to perform the following set up:
Visual COBOL uses an Apache Ant script, .cobolBuild, to build COBOL projects. This script is automatically generated from the .cobolProj project file.
Existing external build scripts such as makefiles, MSBuild, shell scripts and others can build COBOL applications using .cobolBuild as an Ant build file.
ant -lib $COBDIR/lib/mfant.jar -f .cobolBuild
You can compile your source code faster on multi-CPU machines if you use parallel compilation. To do this, you must add the buildThreadCount=nn parameter. Where nn specifies the number of CPU threads to use:
ant -lib $COBDIR/lib/mfant.jar -f .cobolBuild -DbuildThreadCount=2
ant -lib $COBDIR/lib/mfant.jar -f .cobolBuild -DforceCompile=false
For UNIX:
export CLASSPATH=$CLASSPATH:$COBDIR/lib/mfant.jar
For Windows:
SET CLASSPATH=%CLASSPATH%;$COBDIR\bin\mfant.jar
-logger com.microfocus.ant.CommandLineLoggerAlternatively, you can specify the -logger option as an environment variable as follows:
set ANT_ARGS=-logger com.microfocus.ant.CommandLineLogger
export ANT_ARGS=-logger com.microfocus.ant.CommandLineLogger
You can set your own shell scripts as pre- or post-build events and they execute as part of the .cobolBuild Ant script before or after compiling.
To set pre- or post-build events:
If you reference variables in the Events field, you must prefix any linked resource path variables with ${pathVar. and terminate the variable with }. For example, code PROJECT_LOC as ${pathVar.PROJECT_LOC}.
Linked resources path variables are defined in the project's properties as follows: