ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Voisin <benoit.voi...@ergoidp.dk>
Subject RE: Antcall and undefined parameters
Date Mon, 09 Dec 2002 14:11:49 GMT
I do not know any direct way, but since no one replied I believe there is no
easy direct way. I thought of two inderect ways.

Using the ant-contrib <if> :
<target
  name="xml"
 >
 <if> 
	<equals arg1="${xml.skip}" arg2="true"/>
	<then>
		[...]
	...


or using a "pre-task":
<target
  name="xml" depends="-checkXmlSkip" unless="xml.skip.istrue"
 >
 		[...]
</target>
<target
  name="-checkXmlSkip"
 >
	<condition property="xml.skip.istrue">
		<equals arg1="${xml.skip}" arg2="true"/>
	</condition>
</target>


Could not think of any other better way.

Benoit


-----Original Message-----
From: Eric Jain [mailto:Eric.Jain@isb-sib.ch]
Sent: 09 December 2002 11:40
To: ant-user
Subject: Antcall and undefined parameters


How do I pass properties that may be undefined through <antcall> without
having them expanded to a string such as '${x}' (which evaluates to true)?

A possible solution may be to use <reference> rather than <parameter>, but I
am not sure how this would work in the example below.

 <target
  name="all"
 >
  <uptodate
   property="alpha.skip"
   srcfile="${alpha.source}"
   targetfile="${alpha.output}"
  />
  <antcall target="xml">
   <param name="xml.source" location="${alpha.source}"/>
   <param name="xml.output" location="${alpha.output}"/>
   <param name="xml.skip" value="${alpha.skip}"/>
  </antcall>
  ...
</target>

 <target
  name="xml"
  unless="xml.skip"
 >
  <!-- Never executed! -->
 </target>


--
Eric Jain


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

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


Mime
View raw message