ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: Javac task not strict enough on include and exclude?
Date Thu, 18 Mar 2004 13:33:57 GMT
You could try the compilewithwalls task from
ant-contrib.
http://ant-contrib.sourceforge.net/tasks/compilewithwalls.html

Peter
Michael Wever wrote:

>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.
>
>  
>


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


Mime
View raw message