ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Com Pegasus-CC-Hotline" <>
Subject AW: How to conditionally add something to a path ?
Date Mon, 19 Dec 2005 15:09:31 GMT

> psst - little secret: ...

Oham - I was just going to ask, how the docu can be used e.g.
to find all possible subelements of a given element, since
the ant docu doesn't work too well for me...

BTW: I could reduce the "fileB if FileA is not there" to this:

	<path id="classpath">
		<fileset dir="${jarpath}">
		   <include name="**/*.jar" />
		   <exclude name="orbacus.jar" />
		<fileset dir="${jarpath}">
                	<selector unless="jacorb.present">
            		    <filename name="orbacus.jar"/>

But I got stuck again, because I wanted to set the property 
"jacorb.present" depending on a filenamepattern, rather than a filename.
   <available property="jacorb.present" file="${jarpath}/**/jacorb*.jar"
doesn not work.

Now I ended up with 

	<path id="classpath_jacorb">
		<fileset dir="${jarpath}">
		   <include name="**/jacorb*.jar" />
	<pathconvert property="" 
                   refid="classpath_jacorb" targetos="unix"/>	 

	<condition property="jacorb.present">
	   <contains string="${}"

This is quite ugly, but at least it works :-/


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

View raw message