Thanks Peter I'll try some code like this at some stage.
> -----Original Message----- > From: Peter Reilly [mailto:[EMAIL PROTECTED] > Sent: 30 August 2007 11:43 > To: Ant Users List > Subject: Re: refid still not behaving as expected in 1.7.0 > > You can write your own isreference implementation - > <script language="beanshell"> > import org.apache.tools.ant.*; > import org.apache.tools.ant.taskdefs.condition.Condition; > public class IsItAReference extends ProjectComponent > implements Condition { > private String r; > public void setRefId(String r) { > this.r = r; > } > public boolean eval() { > if (r == null) { > return false; > } > return getProject().getReferences().get(r) != null; > } > } > project.addDataTypeDefinition("isitareference", > IsItAReference.class); > </script> > > <project name="x" default="x"> > <import file="define-my-types.xml"/> > <target name="y"> > <path id="ref.not-here" path="."/> > </target> > > <target name="x"> > > <path id="ref.here" path="."/> > <condition property="here"> > <isitareference refid="ref.here"/> > </condition> > <echo>${here}</echo> > > <condition property="not-here"> > <isitareference refid="ref.not-here"/> > </condition> > <echo>${not-here}</echo> > </target> > > </project> > > Peter > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
