From 0afe39c8f7545dbcb662c04a2cab1ae08ae63ed4 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 15 Aug 2003 09:11:47 +0000 Subject: [PATCH] Add example for sourcepath="". PR: 22427 Submitted by: Jaroslav Tulach git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275104 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/javac.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/manual/CoreTasks/javac.html b/docs/manual/CoreTasks/javac.html index 11fd378ee..192643d7d 100644 --- a/docs/manual/CoreTasks/javac.html +++ b/docs/manual/CoreTasks/javac.html @@ -499,6 +499,20 @@ source files every time you run your compile target. See the Ant FAQ for additional information.

+

+If you wish to compile only files explicitly specified and disable +javac's default searching mechanism then you can unset the sourcepath +attribute: +

  <javac sourcepath="" srcdir="${src}"
+         destdir="${build}" >
+    <include name="**/*.java" />
+    <exclude name="**/Example.java" />
+  </javac>
+That way the javac will compile all java source files under "${src}" +directory but skip the examples. The compiler will even produce errors if some of +the non-example files refers to them. +

+

Note: If you are using Ant on Windows and a new DOS window pops up for every use of an external compiler, this may be a problem of the JDK you are using. This problem may occur with all JDKs < 1.2.