You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Lokesh Jayaraman <lo...@gmail.com> on 2007/02/26 06:08:55 UTC

Regarding compile only valid java files, skipping uncompilable files

Hi EveryBody,
I used  ANT script to compile only valid java files and also skip
umcompilable files using following script.

<project name="javac-test" default="compile">

    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <property name="src.dir" value="." />
    <property name="classes.dir" value="." />

    <target name="compile">
        <foreach target="javac" param="file">
            <path>
                <fileset dir="${src.dir}" includes="**/*.java" />
            </path>
        </foreach>
    </target>

    <target name="javac">
        <basename property="file.name" file="${file}"/>
        <javac
            srcdir="${src.dir}"
            destdir="${classes.dir}"
            includes="${file.name}"
            failonerror="false"
        />
    </target>

</project>


But in that i faced the  problem to compile all java files.

*Problem :*
if java source direcotry is "Src".
the above script is good to compile all java files in "Src" directory. but
in that "Src" directory consists any subdirectory which has java files means
,but  it wont compile  . My requirement : i need to compile all files
including sub directory also.

Kindly help me to solve problem

Expecting your favouable reply regarding My Problem

By
Lokesh