ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Cohen" <SCo...@sportvision.com>
Subject RE: <property refid=> question
Date Wed, 26 Feb 2003 17:16:13 GMT
Sorry for originally posting this on ant-dev.  I meant to post it to ant-user.  So I will move
over there now.

-------------------------------------------------------------

And actually, even this doesn't even work for filesets (which the manual correctly does note):

    <fileset id="globallibs" dir="${global.lib}">
		...
    </fileset>
    <target name="temptest">
        <property name="p1" refid="globallibs"/>
        <echo message="${p1}"/>
    </target>

produces

temptest:
org.apache.tools.ant.types.FileSet@275d39

So is there really no way to write a generic task that does something with a fileset if it
is defined but nothing if it is not?  Or can I get around this by introducing a "default"
empty definition of the reference?  Do references work like properties - first one to define
it keeps it?  Or are they handled differently?



-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
Sent: Wednesday, February 26, 2003 11:00 AM
To: dev@ant.apache.org
Subject: AW: <property refid=> question




-----Urspr√ľngliche Nachricht-----
>Von: Steve Cohen [mailto:SCohen@sportvision.com]
>Gesendet am: Mittwoch, 26. Februar 2003 17:52
>An: Ant Developers List
>Betreff: <property refid=> question
>
>The ant manual has no example of what this might be used for.  Can 
>someone explain it?


<path id="path">
    <fileset dir="."/>
</path>
<property name="p" refid="path"/>
<echo>${p}</echo>

Sample Output:
main:
     [echo] C:\tmp\anttests\propertyRefId\build.properties;C:\tmp\anttests\propertyRefId
\build.xml;C:\tmp\anttests\propertyRefId\b
uild_user.properties




>Here's what I am trying to do: write a generic task that might do 
>something with a fileset reference but which will not throw errors if 
>that fileset has not been defined.  If there's another way to do it, 
>I''m all ears.


sorry, have to keep it open



Jan Matèrne

Mime
View raw message