Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Cobol Ant Task

$
0
0

In the meantime I have coded a workaround with ant-contrib. There is a Task called "outofdate" which does the dependency checking. It looks like this

 

<target name="compile" depends="init">

    <for param="file">

        <path>
            <fileset refid="cbl.src.files"/>
        </path>

        <sequential>

            <var name="filebasename" unset="true"/>
            <basename property="filebasename" file="@{file}" suffix=".CBL"/>

            <var name="filedirname" unset="true"/>
            <dirname property="filedirname" file="@{file}"/>

            <antcallback target="compile.file" return="retValue">
                <param name="filename" value="${filebasename}"/>
                <param name="dirname" value="${filedirname}"/>
            </antcallback>

        </sequential>

    </for>

    <echo>${ant.project.name} compile finished</echo>

</target>

<target name="compile.file">

    <outofdate>

        <sourcefiles>
            <pathelement path="${dirname}/${filename}.CBL"/>
        </sourcefiles>
        <targetfiles>
            <pathelement path="${basedir}/bin/de/lv1871/cobol/${filename}.class"/>
        </targetfiles>

        <sequential>

            <echo>
                COBOL Compile fuer :
                    dirname = ${dirname}
                    filename = ${filename}.CBL
            </echo>

            <mfcobol destdir="${basedir}/bin" is64bit="false" forceCompile="${forceCompile}"
                failonerror="${cobolFailOnError}" genListingFile="true" debug="true" desttype="jvm">

                <mffilelist refid="cobol.copybook.locations"/>
                <mfdirlist refid="cobol.directives"/>
                <mffilelist type="srcfile" srcdir="${dirname}">
                    <file name="${filename}.CBL"/>
                </mffilelist>

            </mfcobol>
        </sequential>

    </outofdate>

</target>

Source File is the Cobol-File and Destination File is the class File generated in $BASEDIR/bin/...... If the source File is younger than the "older" Class file the cobol Compile is started. Usually the MF-Cobol Ant Task should do this checking by default. It is a FUNDAMENTAL Feature of ant.

Kind regards


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>