ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Kelly" <ke...@ad1440.net>
Subject Nesting <target>
Date Thu, 01 Nov 2001 15:24:16 GMT
Ant People:

(If this is something you've discussed already, forgive
my redundance.)

Something that's bugged me about Ant's <target> is the
depends attribute:

  <target name="all"
    depends="all.prep, all.build, all.archive">
    ...
  </target>
  <target name="all.prep">
    ...
  </target>
  <target name="all.build">
    ...

To me, that seems too awfully make-esque:

  all: all.prep all.build all.archive
  all.prep:
          ...
  all.build:
          ...

Editing, organizing, and debugging an Ant build.xml file
with lots of dependencies can get tricky.  How about
leveraging the fact that this is XML and elements nest:

  <target name="all">
    <target name="prep">
      ...
    </target>
    <target name="build">
      ...
    </target>
    <target name="archive">
      ...
    </target>
  </target>

Now, indentation can be used to tell where you are in
what.  Heck, you could even generate nested task names
(all.prep, all.prep.stamp, all.prep.dirs, ...) to allow
the developer to specify precise substeps to run, or to
have foreign depend attributes refer to internal
targets.  I'll leave the scoping issues to you.

(Just a thought.)

--
Sean Kelly
Independent Consultant




--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message