You're in luck ;-)

Such a tool recently showed up on this list, and is now even listed in the
external tools page. See Maker in
http://jakarta.apache.org/ant/external.html .

FWIW, I had to do something very similar for our huge project (5000+
sources), but before Maker showed up. I defined an XML file listing all the
sub-projects (group of packages, and/or files... determined by filesets),
and the dependencies they had with other sub-projects.

I <XSLT>ed everything to various build files (one per sub-project). Each
build would pull its sources from the src/ dir, and copy this subset of all
the sources to its own module/src/ directory. The classpath used to compile
this subset of the sources includes only explicitly specified dependencies
in the dependencies.xml file.

So in short, it's custom made, and quite involved, so like I said you're in
luck <macker> just showed up ;-) --DD

-----Original Message-----
From: Xavier Loiseau [mailto:xloiseau@;yahoo.fr] 
Sent: Saturday, October 26, 2002 9:40 AM
To: [EMAIL PROTECTED]
Subject: Package dependencies checking

Hi,


Suppose a team develops a set of Java packages. An
important issue is to try to make those packages as
much independent as possible. The team members can be
aware of the dependency constraints they should
respect. Nevertheless, team members can make mistakes.
Some of those mistakes can be hardly detected without
any tool enabling to check the package dependencies
automatically. I am looking for such a tool.


Let us take a simple example of 3 packages named A, B,
and C. Those packages should only have the following
dependencies: C depends on A and B.

I would like to check that:
- C depends on A and B,
- A does not depend on B and C,
- B does not depend on A and C.


I would like to check all those dependency constraints
through using a single ant task as follows:

    <checkpackagedependencies>
        <dependency frompackage="C" topackage="A"/>
        <dependency frompackage="C" topackage="B"/>
    </checkpackagedependencies>

If the dependency constraints were not all satisfied,
then this task would fail and return the illegal
dependencies.


I have looked for information about this topic through
google, the ant web site and the ant user mailing list
but did not find any good solution.

The only solution I have found is provided by the
JDepend tool as explained in
http://www.clarkware.com/software/JDepend.html#junit .

Although JDepend seems to be a very interesting tool,
I don't want to solve this problem through this tool
for the following reasons:
- the dependency constraints have to be programmed in
Java and it would be much more convenient to provide
those constraints in an ant XML file. 
- JDepend is unable to find all package dependencies
as explained in
http://www.clarkware.com/software/JDepend.html#limitations
.


Could anybody tell me how to solve this problem
properly ?


Kind regards.


Xav

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

Reply via email to