ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jon seymour <>
Subject discussion: build file format
Date Sat, 12 Feb 2000 23:38:39 GMT
Here are some points for offered for discussion and contemplation...I'd be interested in the
developers' thoughts.

I understand it, the following implicit rules govern the structure of the build file format.

   * if a target contains XML elements, then each element:

        o is an empty XML element
        o specifies a task
        o is executed in the order determined by its position within its parent target

Is this always going to be the case? For example: I think it would be neat to if dependencies
could be specified as child elements rather than attributes, as in:

      <target name="dist" depends="jar,javadocs">
         <mkdir dir="${dist.dir}"/>
         <mkdir dir="${dist.dir}/bin"/>
         <mkdir dir="${dist.dir}/lib"/>

might be:

      <target name="dist">
         <depend target="jar"/>
         <depend target="jardocs"/>

         <mkdir dir="${dist.dir}"/>
         <mkdir dir="${dist.dir}/bin"/>
         <mkdir dir="${dist.dir}/lib"/>

Why would you want to do that? For one, if you had a large number of dependencies, it would
be far
easier to maintain the build file if each dependency was on a separate line. Of course, you
    <target name="something" depends="

but that looks a tad ugly.  Also, it would allow other attributes to be associated with a
dependency. For example:

      <target name="output">
         <depend name="input"/>
         <depend name="output.c" type="file"/>
         <depend name="someheader.h" type="file"/>
          <cc source="output.c" object="output.o"/>

    <target name="input">

In this case, we have a dependency on another target but also on two external files.

Also, I must confess a bias here: I have a slight aversion to representing 1:n relationships
XML attributes. Also, if I was going to do it, I'd use ' ' as the separator, not ',' since
least then I get some API (or XSLT) support for parsing it [ the XML attribute value separator
' ']

Similarly, if a task has a large number of inputs, it might be easier if they could be described
by multiple child elements of the task reference, for example:

      <target name="a.out">
         <depend name="input"/>
         <depend name="output"/>
          <link exe="a.out">
                <object name="input.o"/>
                <object name="output.o"/>



View raw message