ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shankar S" <>
Subject Passing properties as parameters to different targets in a build file
Date Sun, 02 Dec 2007 21:57:35 GMT
Hi all,

I have a file that define a set of properties for my
build system.
log.dir and build.dir are defined in Based upon user's
confirguration these values are changed at build time.

My build.xml looks something like this:

<project name="TEST" default="Build_SS" basedir=".">
  <taskdef resource="net/sf/antcontrib/" />
  <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask"/>
  <!-- Set the environment to access the environment variables -->
  <property environment="env" />

  <!-- Set the project property file -->
  <property file="" />

  <!-- Update the timestamp -->

  <!-- Set up the build and log directories -->
   <equals arg1="${cvs.checkout}" arg2="true" />
   <equals arg1="${build.dir}" arg2="CVS_DIR" />
  <var name="build.dir" value="${root.dir}/${DSTAMP}_${TSTAMP}" />
  <var name="log.dir" value="../logs/${}/${DSTAMP}_${TSTAMP}"
  <mkdir dir="${log.dir}" />
  <mkdir dir="${build.dir}" />
  <var name="build.dir" value="${local_root.dir}" />
  <var name="log.dir" value="${local_log.dir}" />
   <target name="Build_SS" >
   <equals arg1="${cvs.tag}" arg2="true" />
   *<antcall target="Tag_All_CVS_Modules">
*    <param name="log.dir" value="${log.dir}"/>

<target name="Tag_All_CVS_Modules" >
 <echo message="Log directory --> ${log.dir}" />

Firstly log.dir value is not being passed to target *"Tag_All_CVS_Modules".*
Secondly I tried passing the value using <param/> but no luck with that

Is there a way to pass log.dir (and other properties) to different targets
in the same build file.

Thanks in advance;

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message