ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: <property refid=> question
Date Wed, 26 Feb 2003 17:22:36 GMT
If you want to write a task, I think you can test whether that reference is
set
(or if there are any hits in the fileset).
Sorry, but I haven´t done it, so I can´t give you any example code.


Jan Matèrne

-----Ursprüngliche Nachricht-----
Von: Steve Cohen [mailto:SCohen@sportvision.com]
Gesendet am: Mittwoch, 26. Februar 2003 18:16
An: Ant Users List
Betreff: RE: <property refid=> question

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

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message