I think we're on the same page here - Ant should read in all the project
files in one phase, create the DAG, then run the build in another phase. I
don't think this is how JDD's proposal works, however. Targets in
subprojects don't get included in the main DAG. Instead, there's an
"exec-target" task that runs after the build has started:
<exec-target target="optional" module="optional/Module"/>
The idea I've been pushing works something like this. Using the Cons
examples, the main directory would have a file called "mysystem.ant" that
looked like:
<project name="mysystem">
<import name="drivers"/>
<import name="parsers"/>
<import name="utilities"/>
...
</project>
Once a subproject is imported using the "import" statement, you can
reference its targets in the "depends" attribute the way you would any
other target. You just need to prefix it with the subproject name:
<project name="mysystem">
<import name="drivers"/>
...
<target name="foo" depends="drivers:compile"> <!-- This target
depends on the "compile" target in "drivers" -->
...
</project>
Since imports aren't tasks, but separate constructs, we can parse all of
the subprojects at the same time we parse the main project. And as a result
we can build the entire DAG before we start executing tasks...
Matt Foemmel
ThoughtWorks, Inc.
Peter Vogel
<[EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
.com> cc:
Subject: RE: Did somebody say Shut
up and Write? :)
12/27/2000
03:10 PM
Please
respond to
ant-dev
I'd like to echo this, JDD's proposal "feels right" from my
12 years perspective doing configuration management/automated
build/deployment.
To draw from a tool that I think deserves to have some ideas
stolen and incorporated into ant, the mergeing of targets from
multiple project files is handled by CONS in the following
way: