I think you may be misunderstanding what "includes" means here. The "includes" attribute is used against the source directory to decide which files to include in the compilation. In other words, "includes" functions as a filter on the set of files from your srcDir. If you add something to that filter which does not exist in the set, it has no effect - it's not there to include to start with. "Includes" is not an explicit specification of which files are to be compiled.

Nevertheless, I understand the issue you are raising. I'd say the best way to catch these sorts of issues is with adequate testing.

Conor

Jan Almås wrote:
Hi all Ant users,

we have been using Ant in our projects for 2+ years now. We have recently discovered a potential dangerous error (or we believe it's an error at least).

When using Ant to compile our package with an explicit includes statement, Ant ignores the fact that the file can't be found. Since we are using some reflection to minimize coupling, we need this feature but this can be dangerous since parts of the package might be omitted from the distribution jar.

<target name="compile_server" depends="init">
<javac
includes="mypackage/ExportService.java,
mypackage/RetrieveService.java,
separate/package/UpdateProperty.java" <-- MISSING FROM ${source}, build successful
srcdir="${source}"
destdir="${classes}"
debug="on">
<classpath>
<pathelement location="${3plib}/servlet/servlet2.3/servlet.jar"/>
<path refid="cb.depend.class.path"/>
<path refid="crewlist.depend.class.path"/>
</classpath>
</javac>
</target>




Does anyone have any experience with this?


Rgds,

Jan Almaas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to