ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas SMETS <tsm...@netscape.net>
Subject I don't understand what's happening
Date Tue, 15 Apr 2003 20:33:52 GMT
Here it is my build.xml :

===========================================
<?xml version="1.0" ?>

<project basedir=".." default="echo" name="TestsForCustomer">
    <!-- Prefixes all the environment properties with the 'env.' string 
      -->
    <property environment="env"  />

    <!-- Only the properties located in this file can be modified to 
customize    -->
    <!-- some values to your environment     -->
    <property resource="local.properties" />

    <!-- Only the properties located in this file can be modified to 
customize    -->
    <!-- some values to your environment    -->
    <property resource="externalTasks.properties" />

   <taskdef 
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
     <classpath>
       <pathelement location= "${scripts.lib.dir}/aspectjtools.jar"/>
     </classpath>
   </taskdef>


    <target name="init"
            description="Needed to have some variables set.">
       <echo>Running the "init" task</echo>
    <available classname="org.aspectj.tools.ajbrowser.Main"
        property="compiler.inClasspath" />
       <available classname="${aspectj.needed}"
        property="aspect-compiler.available" />
       <available classname="${ftp.needed}"
        property="ftp.available" />
       <available classname="${junit.needed}"
        property="junit.available" />
       <echo> $ { aspect-compiler.available } : ${aspect-compiler.available}

       </echo>
    </target>


    <!-- Verifies if some libraries are present in the CLASSPATH -->
   <target  name="echo"
        if="${aspect-compiler.available}"
        depends="init"
                 description="Test the switch cases">
      <echo>
        Test
            aspect compiler available (${aspectj.needed}): 
${aspect-compiler.available}
            ftp.client available (${ftp.needed}) : ${ftp.available}
            junit available (${junit.needed}) : ${junit.available}
      </echo>
    </target>

</project>



================================
Voila !

Running it gives this :
/////////////////////////  OUT PUT  /////////////////////////
[tsmets@calvin scripts]$ ant -buildfile test.xml
Buildfile: test.xml

init:
      [echo] Running the "init" task
      [echo]  $ { aspect-compiler.available } : true
      [echo]
      [echo]
//////////////////////////////////////////////////////////////

While I would have exepected, the variable being "true", the "echo" 
target being executed.

Can someone tellme how I could do that ?

Tx,

Thomas,

Thomas,
-- 
Thomas SMETS
SCJP2 - Brussels

http://tsmets.lautre.net


Mime
View raw message