ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perrier, Nathan" <>
Subject RE: Newbie question
Date Fri, 20 Apr 2012 21:03:34 GMT
1. Use @{dest} instead of ${dest}

-----Original Message-----
From: Carlos Araya [] 
Sent: Friday, April 20, 2012 4:01 PM
Subject: Newbie question

I have a macrodef called init that defines an attribute called dest

<macrodef name="init">
	<attribute name="dest" default="html_content"/>
			<available file="${dest}" type="dir" />
				<echo message="Directory ${dest}
exist... skiping" />
				<echo>Creating directory</echo>
				<mkdir dir="${dest}/"/>
				<echo>Creating CSS directory</echo>
				<mkdir dir="${dest}/css"/>
				<echo>Creating JS directory</echo>
				<mkdir dir="${dest}/js"/>
				<echo>Creating image directory</echo>
				<mkdir dir="${dest}/images"/>
			Copy CSS, JS and any images into their
		<copy todir="${dest}/css">
			<fileset dir="." casesensitive="yes">
			  <include name="*.css"/>
		<copy todir="${dest}/js">
			<fileset dir="." casesensitive="yes">
			  <include name="*.js"/>
		<copy todir="${dest}/images">
			<fileset dir="." casesensitive="yes">
			  <include name="*.jpg"/>
			  <include name="*.gif"/>
			  <include name="*.png"/>

I havea couple questions:

1, How can I replace the ${dest} variable with the value of the
attribute. The task is working when called like this:

<init dest="html_content"/> 
<init />

But it is not generating the html_content directory. It is literally
generation the ${dest} directory. 
2. Is it possible to call it from a different task in the same build
file?  I want to be able to use the value of ${dest} in other places on
the build file but haven't been able to figure out how. 

Thanks for all your help


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

View raw message