ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Com Pegasus-CC-Hotline" <pegasus-cc-hotline....@siemens.com>
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>
		<fileset dir="${jarpath}">
                	<selector unless="jacorb.present">
            		    <filename name="orbacus.jar"/>
			</selector>
        	</fileset>
	</path>


But I got stuck again, because I wanted to set the property 
"jacorb.present" depending on a filenamepattern, rather than a filename.
Therefore 
   <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" />
		</fileset>
	</path>
	<pathconvert property="classpath_jacorb.property" 
                   refid="classpath_jacorb" targetos="unix"/>	 

	<condition property="jacorb.present">
	   <contains string="${classpath_jacorb.property}"
substring="jar"/>
	</condition> 

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

cu,
 Thomas


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


Mime
View raw message