ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: macrodef and classpath
Date Fri, 06 Feb 2009 21:24:39 GMT
I set up properties 

<property name="" value=""/>

in the "init" target and use references to them in the macrodefs.

Here's an example
<target name="init">
  <property name="oracle.xml.parser.jar.path" value="C:/oracle/ora90JavaXDK/lib/xmlparserv2.jar"

I then refer to the property in the macrodef


	<macrodef name="get-data-as-xml">
		<attribute name="query-name" />
		<attribute name="query-version" />
		<attribute name="query-bind-variables" default="" />
		<attribute name="outfile" />
			<!-- Execute the query, store results in XML file -->
			<java classname="" fork="true" maxmemory="256m">
					<pathelement location="${oracle.jdbc.jar.path}" />
					<pathelement location="${sars.jar.path}" />
					<pathelement location="${oracle.xsu12.jar.path}" />
					<pathelement location="${oracle.xml.parser.jar.path}" />
				<arg value="QueryFileName=${sql.dir}/${query.file}" />
				<arg value="QueryName=@{query-name}" />
				<arg value="QueryVersion=@{query-version}" />
				<arg value="bindvars=@{query-bind-variables}" />
				<arg value="XMLFileName=${xml.dir}/@{outfile}" />

Does that answer your question?
Charles Knell - email

-----Original Message-----
From:     Mark Waschkowski <>
Sent:     Fri, 6 Feb 2009 16:16:13 -0500
Subject:  macrodef and classpath

Hi all,
First time poster, hi! Thanks to the devs for ant, been using it for years
now. I tried to do something new by creating a macrodef, but ran into some
problems with passing in a classpath, and didn't see any solutions having
gone through the mailing list archive. I've created a separate file that
contains several macrodefs (I'm planning on importing the macrodefs in a few
different projects), and I'm trying to pass in a classpath with an
attribute. That didn't work, so tried using the element tag and it did. Is
there any way to do this with an attribute?

I'm I do things the Ant way by creating a separate macrodefs file, or might
this lead to issues?

Thanks very  much!


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

View raw message