You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Veerappan Saravanan-ESV007 <es...@motorola.com> on 2004/02/02 20:01:11 UTC

How to pass list of filenames to javac task

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

Thanks

 

Re: How to pass list of filenames to javac task

Posted by RADEMAKERS Tanguy <ta...@swift.com>.
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>
|
/t

   <target name="generate" depends="check_required, init" 
if="generate.required">

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

        <!-- 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="weblogic.tools.ejbgen.EJBGen" 
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}"/>
        </java>
    </target>



Veerappan Saravanan-ESV007 wrote:

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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org