ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Hassan" <greg.has...@net-linx.com>
Subject RE: scope of property
Date Thu, 30 May 2002 16:54:56 GMT
> Properties in Ant don't really have "scope" -- once a property is set,
> it's available throughout the project (it was set in).
>
> Diane

Sounds good, but...

Assume I have two projects:

versioning.xml

  <!-- versioning.xml-->
  <project name="versioning" default="" basedir=".">
   <target name="get_version">
      <property name="build.version" value="1.0"/>
      <echo message="Setting version=${build.version}"/>
   </target>
  </project>


build.xml

  <!-- build.xml-->
  <project name="build" default="test" basedir=".">
   <target name="test">
      <ant antfile="versioning.xml" target="get_version"
inheritAll="false"/>
	<echo message="Build version: ${build.version}" />
   </target>
  </project>


'get_version' sets ${build.version}, but it does not updated in
versioning.xml.

Is it correct to assume that properties from a parent project are available
to the child project (project called using <ANT>), but not vice versa... ???
If so, how can I return a value to a calling project?

Greg


--
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