You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ja...@rzf.fin-nrw.de on 2003/06/05 14:45:33 UTC

AW: Asterisk shell expansion

A little workaround: 
- let Ant do the globbing using <fileset> 
- convert the result to property using <pathconvert>

A little example:
----8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<---
public class PrintArgs {
    public static void main(String[] args) {
        System.out.println("PrintArgs");
        for(int i=0; i<args.length; i++) System.out.println("- " + args[i]);
    }
}
----8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<---
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="test" basedir="." default="main">

    <target name="main" depends="compile,run"/>

    <target name="compile">
        <javac srcdir="." destdir="."/>
    </target>

    <target name="run">
        <fileset dir="." id="fs" />
        <pathconvert pathsep=" " property="files" refid="fs"/>

        <java classname="PrintArgs">
            <arg line="${files}"/>
        </java>
    </target>
</project>
----8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<---
compile:
    [javac] Compiling 1 source file to C:\temp\test2
run:
     [java] PrintArgs
     [java] - C:\temp\test2\build.xml
     [java] - C:\temp\test2\PrintArgs.class
     [java] - C:\temp\test2\PrintArgs.java

main:

BUILD SUCCESSFUL
----8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<---


Maybe you can use that for calling PLDoc.
Advantage: you can use every pattern: e.g. **/*.pks



Jan



> -----Ursprüngliche Nachricht-----
> Von: Bart van Kuik [mailto:bart.van.kuik@oracle.com]
> Gesendet am: Donnerstag, 5. Juni 2003 17:18
> An: user@ant.apache.org
> Betreff: Asterisk shell expansion
> 
> Hi ppl,
> 
> Problem: the asterisk in an <arg> tag is not expanded. How 
> can this be done? 
> I checked the faq and the mailinglist archives, but alas. I'm 
> using Ant 
> 1.5.3 on Linux.
> 
> Background: I use Ant to run PlDoc on some PL/SQL code 
> (embedded procedural 
> language of the Oracle database). It's similar to JavaDoc.
> 
>      <target name="pldoc">
>          <java classname="net.sourceforge.pldoc.PLDoc" fork="true" 
> dir="${plsqlsource}">
>              <classpath>
>                  <pathelement 
> location="${pldocHome}/xalan/bin/xalan.jar"/>
>                  <pathelement 
> location="${pldocHome}/xalan/bin/xml-apis.jar"/>
>                  <pathelement location="${pldocHome}/pldoc.jar"/>
>                  <pathelement location="${pldocHome}"/>
>              </classpath>
>              <arg value="-d"/>
>              <arg value="${pldoc}"/>
>              <arg value="-doctitle"/>
>              <arg value="Title"/>
>              <arg value="-overview"/>
>              <arg value="${pldocOverview}"/>
>              <arg value="*.pks"/>
>          </java>
>      </target>
> 
> 
> -- 
> " The best code comment I heard about (in a discussion about code 
> commenting, I believe) was something like this: /*** DRUNK -- 
> FIX LATER! 
> ***/" -- pb
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>