Micro Focus Ant User Manual

The mfant.jar file located in the <install-dir>\bin folder of the product contains the Micro Focus extensions to Apache Ant. It includes ant tasks and properties that enable the cross-platform compilation and linking of COBOL applications.

Note: The information in this user manual applies to Micro Focus Enterprise Developer for Eclipse and Micro Focus Visual COBOL for Eclipse versions 5.0 and later.
  • Usage
  • Ant Tasks
  • Ant Types


Usage

  • Defining Tasks and Types
Parent topic: Micro Focus Ant User Manual


Defining Tasks and Types

To be able to use the tasks and types provided by Micro Focus Ant support, add one of the following elements to the build file:

To use the mfurun task, add the following element:

<taskdef name="mfurun" classname="com.microfocus.mfunit.ant.MFURunMFUTask"/>

For all other tasks, add the following element:

    <project name="MyCOBOLProject" default="build" basedir=".">
        <taskdef resource="com/microfocus/ant/antlib.xml"/>
        ...
    </project>
Note: This will make all the defined tasks and types available for use; earlier versions required the definition of individual <taskdef> elements for each task to be used.
Parent topic: Usage


Ant Tasks

  • analysis
  • cobol
  • cobolclean
  • cobollbr
  • cobollink
  • executefilecompile
  • mfurun
  • productlocation
Parent topic: Micro Focus Ant User Manual


analysis

Description

Performs code analysis on native COBOL code.

Parameters

Attribute | Description | Required
dir | Specify the directory that will store the data to be analyzed. This directory should be the same one defined in the cobol task. | Yes
failOnError | When set to true, the code analysis results are treated as errors. Any subsequent Ant tasks are not executed and the build is marked as failed. When set to false, the code analysis results are treated as warnings. The build continues with the execution of the next Ant tasks. The default value is false. | Yes

Parameters specified as nested elements

ruleList
Use nested <ruleList> elements to specify the rules for which a code analysis will be executed. See ruleList.
fileset
Use nested <fileset> elements to specify the source file name(s) to be compiled.
mffilelist
Use nested <mffilelist> elements to specify the source files for which a code analysis will be executed. See mffilelist.

Examples

Running code analysis on the output produced by the cobol task:

<mfdirlist id="cobol.default.directives">
    <directive name="dialect" value="MF"/>
    <directive name="charset" value="ASCII"/>
</mfdirlist>

<mffilelist id="source.files" srcdir="${basedir}" type="srcfile">
    <file name="Program1.cbl"/>
    <file name="Program2.cbl"/>
    <file name="Program3.cbl"/>
</mffilelist>

<ruleList id="rules1">
   <rule xmlFilePath="${rulesDir}\GeneralRules.xml" name="Choosing Efficient Computational Data Items - Declarations" language="COBOL" ruleSet="Cobol Performance">
   <rule xmlFilePath="${rulesDir}\GeneralRules.xml" name="Operations with Different Decimal Precision - Conditions" language="COBOL" ruleSet="Cobol Performance">
</ruleList>

<cobol srcfile="Program.cbl" srcdir="${basedir}" desttype="obj" destdir="${basedir}/bin" is64bit="true" analysisDataDir="${analysisDataDir}" analysisData="standalone">
    <mfdirlist refid="cobol.default.directives"/>
    <mffilelist refid="source.files"/>
</cobol>

<analysis dir="${analysisDataDir}">
    <mffilelist refid="source.files"/>
    <ruleList refid="rules1"/>
</cobol>
Parent topic: Ant Tasks


cobol

Description

Compiles one or more COBOL programs.

Parameters

Attribute | Description | Required
copyext | Specify the filename extension of the copyfile that the compiler is to look for if a filename in a COPY statement is specified without an extension. Defaults to the COBOL compiler default "cbl,cpy". Important: This attribute is deprecated. | Ignored
configuration | The name of the active directive set configuration to be used when searching for directive set files. | No
connectionName | The name of the remote connection. | No
debug | If true, compiles a COBOL program for debugging. Defaults to false. | No
destdir | The name of the directory where the outputs from a compilation are to be written. Defaults to the current directory. | No
destfile | The name of the output file to be created for a single compilation. Must not be used if nested mffilelist elements have been specified. Defaults to the source file's base name with the appropriate .obj/.o extension. | No
desttype | The type of output that the COBOL compiler is to produce. The value of this attribute must be one of "obj", "int", "gnt" or "jvm". | No
failonerror | If true, stops the build process if the task exits with a return-code other than 0. Defaults to false. | No
mf.forceCompile | If true, compiles a COBOL program even if it is not out-of-date. Defaults to false. | No
genlistingfile | If true, a listing file is generated during compilation. Defaults to false. | No
is64bit | If true, compiles a COBOL program to a 64-bit target. Defaults to false (i.e. 32-bit target). | No
projectName | The name of the project. | No
retaindirectivesfile | If true, the generated directives file is left behind after compilation. Defaults to false. | No
settingsDir | The name of the active directive set settings directory. | No
srcdir | The name of the directory where the COBOL source file(s) are to be picked up from. Defaults to the current directory. | No
srcfile | The name of the source file to be compiled. Must not be used if nested mffilelist elements have been specified. | No
threadedrts | If true, the -t (threaded) option will be passed to the UNIX compiler. Defaults to false. Important: This attribute is applicable only on UNIX and is ignored on Windows. | No
mf.buildThreadCount | The maximum number of parallel compilations to be used. Defaults to 1. | No
useDirectiveSet | If true, this indicates that the build should search for a directive set file. Defaults to false. | No
userEnv | The name of the properties file that contains the user specified environment variables. | No
verbose | If true, causes additional informational messages to be displayed by the task. Defaults to false. | No
analysisData | If set to standalone, the compiler only produces data to be analyzed by the code analysis task (see analysis task). No build artifacts are created. If set to atCompilation, the compiler produces both the build artifacts and the data to be analyzed by the code analysis task. If this parameter is omitted, the compiler only produces the build artifacts. | No
analysisDataDir | The directory where the compiler creates the data to be analyzed by the code analysis task. Must be used with the analysisData parameter in the cobol task. | No

Parameters specified as nested elements

fileset
Use nested <fileset> elements to specify the source file name(s) to be compiled.
mfdirlist
Use nested <mfdirlist> elements to specify directives to be used to compile the program(s). See mfdirlist.
mffilelist
Use nested <mffilelist> elements to specify the source file name(s) to be compiled and the macro copybook. See mffilelist.

Errors and return codes

By default, the return code of a <cobol> task is ignored. When you set failonerror="true", any non-zero response is treated as an error and would mean the build exits.

Examples

Compile a single program to a 32-bit .obj/.o file, capable of being debugged:

<cobol srcfile="Program.cbl" srcdir="${basedir}" desttype="obj" destdir="${basedir}/bin" debug="true"/>

Compile a single program to a 64-bit .obj/.o file, with directives specified in a nested mfdirlist element:

<cobol srcfile="Program.cbl" srcdir="${basedir}" desttype="obj" destdir="${basedir}/bin" is64bit="true">
    <mfdirlist id="cobol.default.directives">
        <directive name="dialect" value="MF"/>
        <directive name="charset" value="ASCII"/>
    </mfdirlist>
</cobol>

Use a referenced mffilelist element to specify a set of source files that are to be compiled to .int files. Copybook locations and compiler directives are specified in referenced mffilelist and mfdirlist elements respectively:

<mfdirlist id="cobol.default.directives">
    <directive name="dialect" value="MF"/>
    <directive name="charset" value="ASCII"/>
</mfdirlist>

<mffilelist id="copybook.locations">
    <path type="copybook" name="${basedir}/copybooks"/>
</mffilelist>

<mffilelist id="source.files" srcdir="${basedir}" type="srcfile">
    <file name="Program1.cbl"/>
    <file name="Program2.cbl"/>
    <file name="Program3.cbl"/>
</mffilelist>

<cobol desttype="int" destdir="${basedir}/bin">
    <mffilelist refid="copybook.locations"/>
    <mfdirlist refid="cobol.default.directives"/>
    <mffilelist refid="source.files"/>
</cobol>
Parent topic: Ant Tasks


cobolclean

Description

Cleans all the COBOL build artefacts created by the cobol task.

Parameters

Attribute | Description | Required
debug | If true, debugging artefacts are also cleaned. Defaults to false. | No
destdir | The name of the directory containing the build artefacts to be cleaned. | Yes
desttype | The type of the build artefacts that are to be cleaned. The value of this attribute must be one of "obj", "dll", "exe", "int", "gnt" or "jvm". Defaults to "obj". | No
failonerror | If true, stops the build process if the task exits with a return-code other than 0. Defaults to false. | No
genlistingfile | If true, indicates that a listing file is generated for the compilation whose artefacts are to be cleaned. Defaults to false. | No
retaindirectivesfile | If true, indicates that a directives file is retained for the compilation whose artefacts are to be cleaned. Defaults to false. | No
userEnv | The name of the properties file that contains the user specified environment variables. | No
verbose | If true, causes additional informational messages to be displayed by the task. Defaults to false. | No
analysisData | If set to standalone, the compiler only produces data to be analyzed by the code analysis task (see analysis task). No build artifacts are created. If set to atCompilation, the compiler produces both the build artifacts and the data to be analyzed by the code analysis task. If this parameter is omitted, the compiler only produces the build artifacts. | No

Parameters specified as nested elements

fileset
Use nested <fileset> elements to specify the source file name(s) whose artefacts should be cleaned.
mffilelist
Use nested <mffilelist> elements to specify the source file name(s). See mffilelist.
mfdestfilelist
Use nested <mfdestfilelist> elements to specify any additional build artefact(s) that need to be cleaned. See mfdestfilelist.

Errors and return codes

By default, the return code of a <cobolclean> task is ignored. When you set failonerror="true", any non-zero response is treated as an error and means the build exits.

Examples

Remove all build artefacts and debug artefacts for a referenced mffilelist element:

<mffilelist id="source.files" srcdir="${basedir}" type="srcfile">
    <file name="Program2.cbl"/>
    <file name="Program3.cbl"/>
    <file name="Program4.cbl" srcdir="folder1"/>
</mffilelist>

<cobolclean desttype="obj" destdir="${basedir}/output" debug="true">
    <mffilelist refid="source.files"/>
</cobolclean>

Remove all build artefacts for a nested mffilelist element:

<cobolclean desttype="obj" destdir="${basedir}/output">
    <mffilelist>
        <file name="Program2.cbl"/>
        <file name="Program3.cbl"/>
        <file name="Program4.cbl" srcdir="folder1"/>
    </mffilelist>
</cobolclean>

Remove all build artefacts and debug artefacts for a nested mffilelist element and additional build artefacts using a nested mfdestfilelist element:

<cobolclean desttype="obj" destdir="${basedir}/output" debug="true">
    <mffilelist id="source.files" srcdir="${basedir}" type="srcfile">
        <file name="Program2.cbl"/>
        <file name="Program3.cbl"/>
        <file name="Program4.cbl" srcdir="folder1"/>
    </mffilelist>
    <mfdestfilelist>
        <file name="${basedir}/output/Program1.exe"/>
    </mfdestfilelist>
</cobolclean>
Parent topic: Ant Tasks


cobollbr

Description

Create a Micro Focus library (of type .lbr) from one or more COBOL files.

Parameters

Attribute | Description | Required
destdir | The name of the directory where the library is to be written. Defaults to the current directory. | No
destfile | The name of the library that is to be created. | No
desttype | The type of executable that the linker is to produce. The value of this attribute must be "lbr". | No
failonerror | Stop the build process if the task exits with a return-code other than 0. Defaults to false. | No
is64bit | If true, creates a 64-bit library. Defaults to false (i.e. 32-bit library). | No
lbrcommand | Specify a custom link command to be used to create the library file. If specified, all other attributes are ignored and the cobollbr task uses the given command to create the library. Defaults to "". | No
mf.buildThreadCount | The maximum number of parallel compilations to be used. Defaults to 1. | No
userEnv | The name of the properties file that contains the user specified environment variables. | No

Parameters specified as nested elements

mffilelist
Use nested <mffilelist> elements to specify the object file name(s) to be included in the library. See mffilelist.

Examples

Create a 32-bit application, ProgramLib1.lbr, from three .int files - Program1.int, Program2.int and Program3.int:

<cobollbr destdir="${basedir}/bin" destfile="ProgramLib1" is64bit="false" failonerror="true">
    <mffilelist srcdir="${basedir}/bin">
        <file name="Program1.int"/>
        <file name="Program2.int"/>
        <file name="Program3.int"/>
    </mffilelist>
</cobollbr>

Create a 64-bit application, ProgramLib2.lbr, from three .gnt files - Program1.gnt, Program2.gnt and Program3.gnt:

<cobollbr destdir="${basedir}/bin" destfile="ProgramLib2" is64bit="true" failonerror="true">
    <mffilelist srcdir="${basedir}/bin">
        <file name="Program1.gnt"/>
        <file name="Program2.gnt"/>
        <file name="Program3.gnt"/>
    </mffilelist>
</cobollbr>
Parent topic: Ant Tasks


cobollink

Description

Link a COBOL application.

Parameters

Attribute | Description | Required
additionaloptions | Specify additional platform-specific options that are to be included on the linker command line. Defaults to "". | No
apptype Specify whether the application is to be linked as a console or graphical application. The value of this attribute must be one of "console" or "gui". Defaults to "console".
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
bindrts Specify whether the application is to be bound to the current run-time system when the application is linked to the dynamic COBOL run-time system using the dynamicrts attribute. Defaults to false.
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
debug | If true, links the application for debugging. Defaults to false. | No
destdir | The name of the directory where the linked application is to be written. Defaults to the current directory. | No
destext | Specify the extension of the executable that the linker is to produce. If not specified, ".exe" or ".dll" will be used on Windows and "" or ".so" will be used on UNIX for executables and shared objects respectively. | No
destfile | The name of the linked application. The extension specified by the destext attribute will be appended to this name. | No
desttype | The type of application the linker is to generate. The value of this attribute must be one of "exe", "dll/cso", "dll", "so", "cso", "shlib" or "sccso" Note that on Windows, any of these values other than exe will generate a dynamic link library. On UNIX, "dll/cso", "dll", "so" or "cso" will generate a shared object, "shlib" will generate a shared library and "sccso" will generate a self-contained callable shared object. Defaults to "exe". | No
dynamicrts Specify whether the application is linked with the dynamic COBOL run-time system. This attribute is mutually exclusive with the sharedrts and staticrts attributes. Defaults to false.
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
entrypoint | The name of the main entry-point for an applications being linked as desttype="exe". Defaults to "". | No
errorundefinedsyms Specify whether undefined symbols will cause an error to be generated. Defaults to false.
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
entrypointruntime Specify whether the entry point address will be read from the command line at run-time. Defaults to false.
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
failonerror | If true, stops the build process if the task exits with a return-code other than 0. Defaults to false. | No
includeCPP Specify whether C++ support will be included in the executable. Defaults to false.
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
is64bit | If true, links a 64-bit application. Defaults to false (i.e. 32-bit target). | No
linkcommand | Specify a custom link command to be used to link the target executable. If specified, all other attributes are ignored and the cobollink task uses the given command to link the application. Defaults to "". | No
objectdir | Specify the directory where the object files specified using the objectfile attribute are to be picked up from. | No
objectfile | Specify the name of the object file to link the application. Must not be used if nested mffilelist elements have been specified. Defaults to "". | No
options | Specify additional options to be passed to the COBOL linker. Defaults to "". | No
resfile Specify a Windows resource file name to be used in linker command line. The following are valid definitions for a resource file with name "MyResFile.res": resfile="MyResFile.res" resfile="MyResFile" resfile="Absolute path\MyResFile" resfile="Relative path\MyResFile"
Important:
  • The relative path has to start from the directory where the "ant" command is started.
  • This attribute is applicable only on UNIX and is ignored on Windows.
No
sharedrts Specify whether the application is linked with the shared COBOL run-time system. This attribute is mutually exclusive with the dynamicrts and staticrts attributes. Defaults to true.
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
staticrts Specify whether the application is linked with the static COBOL run-time system. This attribute is mutually exclusive with the dynamicrts and sharedrts attributes. Defaults to false.
Important: This attribute is applicable only on UNIX and is ignored on Windows.
No
mf.buildThreadCount | The maximum number of parallel compilations to be used. Defaults to 1. | No
threadedrts Specify whether the application is linked with the threaded COBOL run-time system. Defaults to false.
Important: This attribute is applicable only on UNIX and is ignored on Windows (the threaded COBOL run-time system is always used on Windows).
No
userEnv | The name of the properties file that contains the user specified environment variables. | No
verbose | If true, causes additional informational messages to be displayed by the task. Defaults to false. | No

Parameters specified as nested elements

mffilelist
Use nested <mffilelist> elements to specify the object file name(s) to be included in the linked application. See mffilelist.

Examples

Link a COBOL application named Program1.exe from the three object files: Program1.obj, Program2.obj and Program3.obj with the shared multi-threaded COBOL run-time system:

<cobollink destdir="${basedir}/bin" destfile="LinkedProgram" desttype="exe" entrypoint="Program1" threadedrts="true" sharedrts="true">
    <mffilelist srcdir="${basedir}/bin" type="objfile">
        <file name="Program1.obj"/>
        <file name="Program2.obj"/>
        <file name="Program3.obj"/>
    </mffilelist>
</cobollink>
Parent topic: Ant Tasks


executefilecompile

Description

Executes compilation of provided files.

Prerequisites

This task requires some properties to be defined beforehand to ensure that the correct type of compilation is performed for the specified file extension:
  • mf.cfg - name of the build configuration.
  • fileextn.<file extension> - file extension properties are prefixed fileextn followed by a file extension; for example <property name="fileextn.cbl" value="cobol"/>. The value of the property indicates the type of compilation that should be executed.

The task requires a target for each type of compilation specified in the value of a property. The target performs the actual compilation of the file passed to this task.

The target name must follow the syntax:

FileCompile.${mf.cfg}.${fileextn.<file extension>}

For example, taking the following properties:

<property name="mf.cfg" value "singleFileConfig"/>
<property name="fileextn.cbl" value "cobol"/>

Would imply the presence of the following target

<target name="FileCompile.singleFileConfig.cobol">
</target>

Parameters

Attribute | Description | Required
fileslist | The list of file names to process, delimited by a comma (",") with or without spaces | Yes

Examples

Compiles files from fileslist:
<executefilecompile filesList="${fileslist}" />
Parent topic: Ant Tasks


mfurun

Description

Execute one or more .mfu files, which can contain one or more test cases.

Parameters

Attribute | Description | Required
dir | Override the name of the directory for test run - default is preferred-cwd in .mfu file. | No; default is from .mfu file
errorproperty | The name of the property to contain the total number of tests that have failed. | No
failureproperty | The name of the property to contain the total number of tests that have failed. | No
fixture | The name of the fixture file. | Yes (if <fileset> is not used)
haltonfailure | Stop the build process if a test fails. | No; default is off
ignoreoptionsinmfu | If set to true the command line options in the [global] section are not processed. | No
junitreportpackage | Override the name of package for the junit results file. | No
junitresults | If set to true, overrides the value set in the .mfu file and generates junit results file. | No; default taken from .mfu file
osfamily | If set, task is restricted for use on a specific OS (see ant Exec task for details on valid values). | No
outputdir | If set, its value overrides the output directory specified in the .mfu file. | No
passedproperty | Name of the property to contain the number of tests passed. | No
printsummary | Prints a summary of the test run. | No; default is off
runproperty | Name of the property to contain the number of tests runs. | No
showprogress | If set, the test case name is shown before execution and the result as processed. | No; default is yes
timeout | Override the timeout for all tests. | No; default taken from .mfu file
totaltimeproperty | The name of the property to contain the total time taken to execute the test(s). | No

Parameters specified as nested elements

arg
Extra command line arguments should be specified as nested <arg> elements. For example:
<arg value="-debugbreak" />
env
It is possible to specify environment variables to pass to the test runner via nested <env> elements. For example:
<env key="MYVAR" value="MYVALUE"/>

Examples

Execute all test cases in ${src}:

<taskdef name="mfurun" classname="com.microfocus.mfunit.ant.MFURunMFUTask" />
    <mfurun dir="${src}"
     printsummary="true"
     junitresults="true"
     junitreportpackage="com.mycompany.testcases">
         <fileset dir="${src}" includes="*.mfu" />
    </mfurun>
Parent topic: Ant Tasks


productlocation

Description

Sets a property (by name) in the project to a Micro Focus product location (file or directory). The value to set is one of:

  • By specifying dir the property is set to the named sub-directory of the product install directory
  • By specifying file the property is set to the named file within the product install directory
  • By specifying dir and file the property is set to the named file within the sub-directory of the product install directory
  • By not specifying dir or file the property is set to the root product install directory

The file or directory must exist for the property to the be set.

Parameters

Attribute | Description | Required
property | The name of the property to set. | Yes
dir | The name of the product sub-directory. | No
file | The name of the file within the product. | No

Examples

Set the property called etcDirectory to the etc sub-directory of the product:

<productlocation property="etcDirectory" dir="etc" />

Set the property called runConfiguration to the etc/run.cfg file of the product:

<productlocation property="runConfiguration" dir="etc" file="run.cfg" />

Set the property called root to the root install directory of the product:

<productlocation property="root" />
Parent topic: Ant Tasks


Ant Types

  • mfdestfilelist
  • mfdirlist
  • mffilelist
  • ruleList
Parent topic: Micro Focus Ant User Manual


mfdestfilelist

Description

mfdestfilelist is an explicitly-named list of files used by the following tasks: cobolclean, and can either appear inside one of these tasks or as a standalone type. Such a list is used for specifying additional build artefacts that need to be cleaned.

Parameters specified as nested elements

file
Use nested <file> elements to name each file in the list.
Attribute | Description | Required
name | The name of the file. | Yes

Examples

Specify a number of files:

<mfdestfilelist>
    <file name="Program1.exe"/>
</mfdestfilelist>
Parent topic: Ant Types


mfdirlist

Description

mfdirlist is an explicitly-named list of directives used by the following tasks: cobol, and can either appear inside one of these tasks or as a standalone type.

Parameters

Attribute | Description | Required
debug | If true, specifies that the directives list is associated with a program to be compiled for debugging. Defaults to false. | No
refid | Makes the mfdirlist instance in effect a reference to another mfdirlist instance. Note: Note that attributes or nested elements must not be set if refid is specified. | No

Parameters specified as nested elements

directive
Use nested <directive> elements to name each directive in the list.
Attribute | Description | Required
name | The name of the directive. | Yes
value | The value of the directive. | No
directives
Use nested <directives> elements to specify a set of directives to be used by the compiler.
Attribute | Description | Required
value | Set of directives to be used by the compiler. | Yes

<directive> and <directives> elements may be used in the same list.

Examples

Specify a number of compiler directives:

<mfdirlist>
    <directive name="dialect" value="MF"/>
    <directive name="charset" value="ASCII"/>
    <directive name="noamode">
</mfdirlist>

Specify a free-format list of compiler directives:

<mfdirlist>
    <directives value="dialect(MF) charset(ASCII) noamode"/>
</mfdirlist>

Specify compiler directives in a referenced mfdirlist elements to associate and compile a COBOL source file for debugging using the cobol task:

<mfdirlist id="cobol_directives" debug="true">
    <directive name="dialect" value="MF"/>
    <directive name="charset" value="ASCII"/>
</mfdirlist>

<cobol srcfile="Program1.cbl" srcdir="${basedir}" desttype="int" destdir="${basedir}/bin" debug="true">
    <mfdirlist refid="cobol_directives"/>
</cobol>
Parent topic: Ant Types


mffilelist

Description

mffilelist is an explicitly-named list of files used by the following tasks: cobol, cobollbr, cobollink, and can either appear inside one of these tasks or as a standalone type.

Parameters

Attribute | Description | Required
delete | If false, does not delete the files in the list specified by the task. Defaults to true. Note: Note that the delete attribute is ignored when a nested path element is specified. | No
refid | Makes the mffilelist instance in effect a reference to another mffilelist instance. Note: Note that attributes or nested elements must not be set if refid is specified. | No
srcdir | The name of the directory where the file(s) in this list reside. Defaults to the current directory. | No
type | The type of the file(s) in this list. | No

Parameters specified as nested elements

file
Use nested <file> elements to name each file in the list.
Attribute | Description | Required
name | The name of the file. | Yes
srcdir | The name of the directory where the file resides. Must not be used if the srcname attribute has been specified. | No
srcname | The name of the file on the local file system. Must not be used if the srcdir attribute has been specified. | No
path
Use nested <path> elements to name each path in the list. The path element is currently used by the cobol tasks for the specification of COBOL copybook paths.
Attribute | Description | Required
path | The name of the path. | Yes
type | The type of the path. The value of this attribute should be "copybook", "imscpy" or "asmmacro". | Yes
mffilelist
Use nested <mffilelist> elements to include files listed in file lists elsewhere.
Attribute Description Required
refid Makes the mffilelist instance in effect a reference to another mffilelist instance.
Note: Note that attributes or nested elements must not be set if refid is specified.
Yes

Examples

Specify a number of files each residing in the same location:

<mffilelist id="same.location.files" srcdir="${basedir}" delete="false">
    <file name="Program1.cbl"/>
    <file name="Program2.cbl"/>
    <file name="Program3.cbl"/>
</mffilelist

Specify a number of files each residing in different locations:

<mffilelist id="different.location.files"> delete="true";
    <file name="Program1.cbl" srcdir="${basedir}/subdir"/>
    <file name="Program2.cbl" srcdir="${basedir}"/>
    <file name="Program3.cbl" srcdir="${basedir}/subdir"/>
</mffilelist>

Specify asmmacro locations:

<mffilelist id="asmmacro.location.files">
    <path type="asmmacro" name="${basedir}/asmmacros"/>
</mffilelist>

Specify copybook locations:

<mffilelist id="copybook.location.files">
    <path type="copybook" name="${basedir}/copybooks"/>
</mffilelist>

Specify imscpy locations:

<mffilelist id="imscpy.location.files">
    <path type="imscpy" name="${basedir}/imscopybooks"/>
</mffilelist>

Specify nested file lists:

<mffilelist id="copy1.list">
    <path type="copybook" name="${mf.projectLocation.mffilelist}/folder1"/>
</mffilelist>

<mffilelist id="copy2.list">
    <mffilelist id="innerlist">
        <mffilelist refid="copy1.list"/>
        <path type="copybook" name="${mf.projectLocation.mffilelist}/folder2"/>
    </mffilelist>
</mffilelist>

<mffilelist id="cobol.copybook.locations">
    <mffilelist refid="copy2.list"/>
    <path type="copybook" name="${mf.projectLocation.mffilelist}/folder3"/>
</mffilelist>
Parent topic: Ant Types


ruleList

Description

ruleList is an explicitly-named list of files used by the analysis task. Defines the rules to be executed when performing code analysis.

Parameters

Attribute | Description | Required
id | The id of the list of rules. Use this id when you reference the list. | No
refid | Makes the ruleList instance a reference to another ruleList. Note: If refid is specified, any other attributes or nested elements must not be set. | No

Parameters specified as nested elements

rule
Use nested <rule> elements to specify what rules should be included in a ruleList.
Attribute | Description | Required
xmlFilePath | Full path to the file that contains the rule. | Yes
name | Name of the rule. | Yes
ruleSet | The ruleSet that contains the rule. | Yes
language | Programming language the rules applies to. | Yes

Examples

Specifying a number of rules:

<ruleList id="rule_set_1">
    <rule xmlFilePath="${rulesDir}\GeneralRules.xml" name="Choosing Efficient Computational Data Items - Declarations" language="COBOL" ruleSet="Cobol Performance"/>
    <rule xmlFilePath="${rulesDir}\GeneralRules.xml" name="Operations with Different Decimal Precision - Conditions" language="COBOL" ruleSet="Cobol Performance"/>
    <rule xmlFilePath="${rulesDir}\GeneralRules.xml" name="Uninitialized Data Items" language="COBOL" ruleSet="General Queries"/>
</ruleList>
Parent topic: Ant Types