ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Hatton" <khat...@axiomsystems.com>
Subject RE: Javac task not strict enough on include and exclude?
Date Thu, 18 Mar 2004 13:08:33 GMT
Hi Michael,

I would suggest <copy>ing the subset of files to a temporary area, and <javac>ing
from there, with an appropriately defined classpath, so that the compilation would fail if
those java files reference the others. Of course, this is not an especially elegant solution
but the behaviour of the <javac> task is just that of the javac command-line tool...

Hope this helps
Keith


-----Original Message-----
From: Michael Wever [mailto:michael.wever@bokklubbene.no]
Sent: 18 March 2004 12:43
To: user@ant.apache.org
Subject: Javac task not strict enough on include and exclude?


Is there some way to force the restriction of include and exclude within
the javac task? Currently classes outside these filters will still get
sucked in and compiled if classes inside the filters require them. I need
the javac to fail instead in this case.


=== Further Info ===
In our project's compilation process, there are 3 stages to force
separation between packages. That is, beans and konstanter packages should
not require classes from any other package, and no class anywhere should
require a service implementation class (eg *Impl.java). Currently all the
classes exist under the same package heirarchy. Unfortunately the
following ant script does not work. Despite the include and exclude
usages, classes not specified will still be sucked in and compiled if
referenced to.


        <!-- Make sure Beans and Constants are standalone classes --> <!--
        [FIXME]  Other classes will still be sucked in if needed without
        error --> <javac debug="true" deprecation="true"
        destdir="${classdir}" optimize="true" source="1.4"
        srcdir="${src}">
            <classpath refid="classpath"/>
            <include name="**/beans/*.java"/>
            <include name="**/konstanter/*.java"/>
        </javac>
        <!-- Make sure Service Implementation classes are not used -->
        <!-- [FIXME]  Tjenester Implementation will still be sucked in if
        needed without error --> <javac debug="true" deprecation="true"
        destdir="${classdir}" optimize="true" source="1.4"
        srcdir="${src}">
            <classpath refid="classpath"/>
            <!-- Separate the Tjenester Implementation classes to catch
            illegal references --> <exclude name="**/*TjenesteImpl.java"/>
        </javac>
        <!-- Now compile the Service Implementation classes --> <javac
        debug="true" deprecation="true" destdir="${classdir}"
        optimize="true" source="1.4" srcdir="${src}">
            <classpath refid="classpath"/>
            <include name="**/tjenester/*/*Impl.java"/>
        </javac>

Mick.

-- 
-- <BR/>
"Work like you don't need the money. Love like you've never been hurt. Dance like nobody's
watching." Satchmo Paige
<BR/> --- <a href=http://www.bokklubbene.no>De norske Bokklubbene</a> ---




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

Mime
View raw message