ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RADEMAKERS Tanguy <>
Subject Re: multiple arguments with <arg>
Date Tue, 02 Mar 2004 18:55:01 GMT
Hello Leandro,

Here's an example of using the pathconvert task to do this

    <target name="generate.ejb" 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/*"/>
                <exclude name="**/Abstract*"/>

        <!-- 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="-source 1.4"/>
            <arg line="-wls81"/>
            <arg line="${ejbjen.files}"/>

Leandro Trevisan Nunes wrote:

> Hi,
> there is any way to assign a FileSet as line argument for the <java> 
> task?
> My script will run a java app that takes several itens as line 
> arguments (a file list),
> like the following: [eu@lince]$ java  MyApp file1.dat file2.dat 
> file3.dat .... fileN.dat
> So I'm using the <java> task to run the app, but the <arg> do not 
> allow the use of a FileSet.
> It only allows parameters such as line, value, path, file, etc wich 
> doesn't fit to my needs.
> A piece of my code follows:
> <target name="make">
>    <java classname="MyApp">
>      <classpath>
>         <fileset dir="." casesensitive="yes">
>           <filename name="**/*.jar"/>
>         </fileset>
>      </classpath>
>      <arg>
>          .... here I need something like a FileSet 
> .....                                                 </arg>
>    </java>
>  </target>
> oh, help me.
> Thanks for the patience.

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

View raw message