ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dharmesh Vyas" <dharmesh.m...@gmail.com>
Subject visibility of the variable/parameter
Date Wed, 21 Feb 2007 15:57:41 GMT
Hello Group,

Shown below is the small illustration of something which I am trying to
implement. I am not sure, where/what I am missing.


  <target name="all" depends="X,Y">
  </target>

  <target name="X">
    <antcall target="callY"/>
  </target>

  <target name="callY">
    <condition property="view">
      <equals arg1="0" arg2="0" />
    </condition>
    <echo>value of view is ${view}</echo>   ---> Which shows as true
  </target>

  <target name="Y">
    <echo>value of view is ${view}</echo> -----> value of view is not set
    <if>
      <equals arg1="${view}" arg2="view"/>
        <then>
          <echo message="view is set"/>
          {I want to perform something over here}
        </then>
      <else>
          <echo message="view is not set"/>
      </else>
    </if>
  </target>

(1) I am not understanding that when target 'Y' is called, why the value of
view is not visible?? (Is it local to only taget callY)
(2) How shall I implement it so that, I get the value of view in Y. ( I want
to call target Y only from all and not other target)

Please forgive me if this is a stupid question but finally after trying here
and there i thought of asking.

Thanks in advance,
- Dharmesh Vyas.

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