Buildfile | Apache Ant's buildfiles are written in XML. Each buildfile contains one project and at least one (default) target. Targets contain task elements. Each task element of the buildfile can have an id attribute and can later be referred to by the value supplied to this. The value has to be unique. |
Project | Each project defines one or more targets. A target is a set of tasks you want to be executed. When starting Ant, you can select which target (or targets) you want to have executed. When no target is given, the project's default is used. |
Target | A target is a container of tasks that cooperate to reach a desired state during the build process. Targets can depend on other targets and Apache Ant ensures that these other targets have been executed before the current target. For example you might have a target for compiling and a target for creating a distributable. You can only build a distributable when you have compiled first, so the distribute target depends on the compile target. |
Task | A task is a piece of code that can be executed. There is a set of built-in tasks, but it is also very easy to write your own. Below you will find information about how to create a task that executes the isCOBOL Compiler. |
FileSet | A FileSet is a group of files. These files can be found in a directory tree starting in a base directory and are matched by patterns |
<taskdef name="iscc" classname="com.iscobol.ant.iscc"/> |
Attribute | Meaning | Default value |
---|---|---|
javac | Path to an external javac compiler to be used | |
javacOptions | Java complier options to be used, i.e. -classpath to point to the iscobol.jar library where com.iscobol.ant.iscc is stored | |
nosummary | Set it to "false" to have the Compiler outcome printed on the console | "true" |
nowarn | Set it to "true" to suppress Compiler warnings | "false" |
noerr | Set it to "true" to suppress Compiler errors. Note that Severe errors will not be suppressed anyway | "false" |
force | Set it to "true" to compile programs even if they’re not out of date | "false" |
options | isCOBOL Compiler options, i.e. "-cm -dcm" See Compiler Options for the list of all the available options. You should not use the "-od" option, but set the destDir attribute instead | "-jc" |
FailOnError | Set it to "false" to continue the build process even if a Severe error occurs. By default, the build process stops in this case | "true" |
destDir | Path where the compiled class files will be stored |
<iscc javacOptions="-classpath ${iscobol-classpath-prop} " nosummary="false" nowarn="true" noerr="true" force="true" options="-d" failOnError="true" destDir="${build.dir}"> <fileset dir="${src.dir}"> <include name="HELLO-WORLD.cbl"/> </fileset> </iscc> |
<java classname="com.iscobol.invoke.Isrun" fork="true" classpath="${iscobol-classpath-prop}" > <arg value="-d" /> <!-- remove this arg to run without Debugger --> <arg value="HELLO_WORLD" /> </java> |
ant compile |
ant run |