ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mick Wever <h...@netbeans.org>
Subject Javac include and exclude are not strict enough
Date Thu, 18 Mar 2004 12:32:49 GMT
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/>
"If we look at the path, we do not see the sky." Native American saying
<BR/> --- <a href=http://www.harryspractice.com.au>Harry's Practice</a>
--- 



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


Mime
View raw message