ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lokesh Jayaraman" <lokesh.jaya...@gmail.com>
Subject Regarding compile only valid java files, skipping uncompilable files
Date Mon, 26 Feb 2007 05:08:55 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message