ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@us.ibm.com
Subject Re: ANT semantics and power
Date Tue, 29 Feb 2000 02:58:01 GMT


Costin wrote:
> How many "special" cases do you have in your project? You can build
> Tomcat, xerces, cocoon with only the standard set of tasks.

It is worth noting that conditional logic was recently introduced into Ant
to support cocoon.

Excerpts from cocoon's build file:

  <target name="init">
    <available property="xt.present"
class="com.jclark.xsl.sax.XSLProcessor"/>
    <available property="fesi.present" class="FESI.jslib.JSGlobalObject"/>
    <available property="jndi.present" class="javax.naming.Name"/>
  </target>

  <target name="prepare-xt" depends="init" if="xt.present">
    <copydir src="${src.dir}"
             dest="${build.src}"
             includes="**/XT*"
             filtering="on"/>
  </target>

  <target name="prepare-ldap" depends="init" if="jndi.present">
    <copydir src="${src.dir}"
             dest="${build.src}"
             includes="**/ldap/**"
             filtering="on"/>
  </target>

  <target name="prepare-ecma" depends="init" if="fesi.present">
    <copydir src="${src.dir}"
             dest="${build.src}"
             includes="**/ecmascript/**"
             filtering="on"/>
  </target>

Personally, I would prefer:

  <target name="compile" depends="init">
    <javac srcdir="${src.dir}"
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}">
      <exclude "**/XT*"           unless="xt.present"   />
      <exclude "**/ldap/**"       unless="jndi.present" />
      <exclude "**/ecmascript/**" unless="fesi.present" />
    </copydir>
  </target>

I recognize that this is clearly the beginning of a very slippery slope.
Unfortunately, I don't believe that the right position to take on this
issue is that such logic doesn't belong in Ant and that Cocoon should write
their own taskdef for this case.  In this case, the logic clearly belongs
in Ant.  Nor do I believe that Cocoon's build needs are unique in this
case.

It is my guess that what Stefano added was based on how much time he had
available, and the fact that he made a number of requests out to this
mailing list for suggestions without any takers.

In the theory that it is never too late, let's take the opportunity now to
go back and answer Stefano's question.



Mime
View raw message