I really think ant is a good thing. I like the fact that is uses XML,
but I suspect that some users don't really understand XML and where they
can go with it. I also like its cross-platform extensibility via Java
plug-ins.

Aside from that, I've been wondering what depth there is to ant, or if
it is falls into the genre of ad-hoc of tools. Looking through the
documentation I'm a bit disappointed. For example, the assertion "Ant
resolves these dependencies" is a bit of hand waving, IMHO. Isn't there
some science to it?

Perhaps somebody has worked this out. I'd like to get pointers to that
work. In the meantime, I've attached a rough draft to give you an idea
of what I'm looking for.
Title: Ant Processing Theory

Ant Processing Theory - a draft

Date: 22 Sept 2001
Author: Frank Weiss [EMAIL PROTECTED]

Ant performs a number of operations. Part of the philosophy of Ant is to minimize the set of operations it is responsible for.

  1. parameterization - the property tag
  2. configuration management - selecting targets to be built - also parameterizing builds
  3. dependency cache management - deciding which tasks have up-to-date outputs cached - can also be called build process optimization
  4. task scheduling - sequencing and concurrently performing tasks

Graph theory - generating the dependency digraph D

Use target[@name] and target[@depends] to construct a digraph D. Each node in D is a target, identified by the target's name. The depends attribute of each target defines the edges, where each  edge is incident from (for all targets t1)  target t1 to the targets named in t1's depends list). Ultimately, this possibly cyclical digraph needs to be reduced to a simple tree, the depth-first traversal of which is the basis for task scheduling.

Questions:

  1. Is D rooted at the default or specified target?
  2. If multiple targets are given in the command line, does D have multiple roots?
  3. Is D constructed for the entire project or only the smallest subset that contains all targets?
  4. Are conditions evaluated while constructing D or only before a target is fired?
  5. Are conditions used to prune D at construction time?
  6. Can properties be used to parameterize the construction of D? That is, say there is a function D(p) which constructs a digraph using p as a parameter. Then there exists a p1 and p2 such that p1!=p2 and D(p1)!=D(p2).
  7. Since the depends attribute of a target defines a subset of edges in D, is there a way to create this subset of edges dynamically instead of statically by the set of targets listed in the depends attribute? Is that what filesets do?

Remove cycles from D.

Questions:

  1. Are cycles removed statically, before dependency reduction, or as a result of dependency reduction?
  2. Result of removing cycles is a meshed forest or a simple forest?
  3. Is the goal really a tree rooted at the project, whose children are subset of the explicitly given targets?

Dependency reduction

Dependencies can be used for two purposes:

  1. To define a caching scheme whereby the output of a task can be stored to avoid having to run the task repeatedly
  2. To declare the order in which tasks need to be performed

There are really two rationales for this. Primarily, the make pattern is used to speed the incremental building of a project. Intermediate files are basically caches of a task. The trick is to figure out if the cached output can be used instead of performing the task. However there is also a secondary rationale, which is modularity. Instead of writing a script that procedurally defines the process, a set of declarations are maintained that define the relationships between the subtasks.  (There is a parallel with SQL, where a query, such as SELECT, defines what data is requested, but the RDBMS creates the query plan depending on what indexes, etc., are available.) The second rational also permits using the same document to build subprojects and to parameterize the build.

Task scheduling

In general , this is a DFS of the final D, after removing cycles and reducing dependencies

Questions:

  1. Is any implicit concurrency in the final D used to schedule tasks?
  2. If the final D is a meshed forest, have cross-links been removed and by what rules?

 

 

 

Reply via email to