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>