ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RADEMAKERS Tanguy <>
Subject Re: How to pass list of filenames to javac task
Date Mon, 02 Feb 2004 19:10:24 GMT
shoule be - use a <path> with a <fileset> (or other) to read the files, 
then a <pathconvert/>
to turn the path into a space delimited list and pass that into javac 
using an <arg> or <|compilerarg>.

YMMV: i use this trick to run ejbgen via <java> (due to a problem on 
HPUX), not for <javac>

   <target name="generate" depends="check_required, init" 

        <!-- scan the ${COMP_JAVA_SRC} directory and get the *.java 
files -->
        <path id="ejbgen.path">
            <fileset dir="${COMP_JAVA_SRC}" casesensitive="yes">
                <include name="**/*"/>
                <exclude name="**/entities/*"/>

        <!-- turn that into a space seperated list of file paths -->
        <pathconvert property="ejbjen.files" refid="ejbgen.path" 
dirsep="/" pathsep=" "/>

        <!-- invoke ejbGen on these file paths -->
        <java classname="" 
classpathref="path.ejbgen" fork="True" failonerror="True" maxmemory="256m">
            <arg line="-sourcepath ${COMP_JAVA_SRC}"/>
            <arg line="-templateDir ${EJBGEN_TEMPLATES}"/>
            <arg line="-d ${COMP_GENERATED}"/>
            <arg line="-descriptorDir ${COMP_EJB}/META-INF"/>
            <arg line="-errorFile ${basedir}/ejbgen_errors.txt"/>
            <arg line="-wls81"/>
            <arg line="${ejbjen.files}"/>

Veerappan Saravanan-ESV007 wrote:

>Is there a way to give list of filenames instead of specifying srcdir attribute?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message