Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
available task

available task

2003-03-18       - By Thomas Lionel SMETS
Reply:     1     2     3     4  


Is there a reason why we can't use the <available /> task as a
<property/> definiton ?


I mean, this works :
<?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" />

   <target name="echo">
   <!-- Verifies if some libraries are present in the CLASSPATH -->
   <available classname="org.aspectj.tools.ajbrowser.Main"
              property="compiler.inClasspath" />
     <echo>Value for :
           root directory : ${root.dir}
           ..  scripts ...    : ${scripts.dir}
            scripts.lib.dir : ${scripts.lib.dir}
           lib.dir : ${lib.dir}
           aspect compiler in the CLASSPATH : ${compiler.inClasspath}
     </echo>
   </target>
</project>


while this doesn't

<?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" />
   <!-- Verifies if some libraries are present in the CLASSPATH -->
   <available classname="org.aspectj.tools.ajbrowser.Main"
              property="compiler.inClasspath" />

   <target name="echo">
     <echo>Value for :
           root directory : ${root.dir}
           ..  scripts ...    : ${scripts.dir}
            scripts.lib.dir : ${scripts.lib.dir}
           lib.dir : ${lib.dir}
           aspect compiler in the CLASSPATH : ${compiler.inClasspath}
     </echo>
   </target>
</project>


Thanks for explaination of why the second option is not logical.

Thomas,


--
Thomas SMETS
SCJP2 - Brussels

http://tsmets.lautre.net



©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.