ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: compiling packages in an explicit order with javac
Date Fri, 21 Nov 2003 19:40:13 GMT
> From: Stirling, Scott []
> It's amazing (to me) that more engineers aren't tuned into package design
> concerns and their importance.  It may be because it originates (I think)
> with Robert Martin's C++ Report articles which predate a lot of the Java
> folks I've worked with (it predates me too, but somehow I know about it
> and they don't). 

I myself sorely miss C++ report as well...

> Maybe that "compilewithwalls" task will help too, or you could emulate
> whatever it does.

You can emulate a simple <compilewithwalls> with Ant 1.6beta, by setting
sourcepath to "" explicitly. You do have to output to different directories
though, instead of a single build/classes dir:

    <macrodef name="compile">
      <attribute name="name" />
      <attribute name="fork" />
      <attribute name="srcpath" />

      <element name="javac-elements" />

        <mkdir dir="build/classes/${name}" />
        <javac source="1.4" sourcepath=""
               deprecation="false" debug="true" verbose="false"
               includeAntRuntime="false" fork="true"
          <src path="src/java" />

          <javac-elements />

    <!-- A is stand-alone -->
    <compile name="a" fork="false">
        <include name="com/acme/a/**"/>
        <classpath refid="classpath" />

    <!-- B depends on A -->
    <compile name="b" fork="false">
        <include name="com/acme/b/**"/>
          <pathelement location="build/classes/a" />
          <path refid="classpath" />


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message