ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Teixeira <micha...@exceloncorp.com>
Subject building package by package while using depend.
Date Fri, 16 Nov 2001 12:14:42 GMT
I'm having difficulty doing these two things, building package by
package, and using depend, at the same time.  I'm able to do either
separately without any difficulty.

By building package by package, I mean that I want to build package
com.odi.A first, then com.odi.B, then com.odi.C.  Package B depends on
package A, but package A doesn't depend on package B.  So that when
package A builds, the code for package B shouldn't be visible to javac. 
If it is, then javac will happily build a class from package B if I
refer to it in a class from package A.  I don't want that, if package A
refers to a class from package B I want an error to be generated.  I
want the build process to enforce the package modularity.

I'm accomplishing that by setting basedir to com.odi.A when I build A,
this hides the code in package B.

On the other hand, I can get the depend task to work only if I have
basedir set to the top of the package hierarchy, or the directory just
above com.  Setting basedir to this value makes all the code visible.

So depend works in the case, with basedir set to /home/michaelt

  <!-- com/odi/util -->
  <depend srcdir="${srcdir}"
          destdir="${destdir}"
          includes="com/odi/util/*.java"
          cache="depcache"
	  closure="yes" />
  <javac srcdir="${srcdir}"
         destdir="${destdir}"
         includes="com/odi/util/*.java"
         debug="${debug}" />

But not in this case, with basedir set to /home/michaelt/com/odi/util.


  <!-- com/odi/util -->
  <depend srcdir="${srcdir}"
          destdir="${destdir}"
          includes="*.java"
          cache="depcache"
	  closure="yes" />
  <javac srcdir="${srcdir}"
         destdir="${destdir}"
         includes="*.java"
         debug="${debug}" />

I'm using ant 1.4.1.  I'm relatively new to ant, so maybe I am missing
something basic, or am going about this the wrong way.  Thanks for any
help,

Michael Teixeira



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


Mime
View raw message