Date: 2004-12-09T11:45:13
   Editor: BernardBernstein <[EMAIL PROTECTED]>
   Wiki: Ant Wiki
   Page: AntNewbies
   URL: http://wiki.apache.org/ant/AntNewbies

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -222,3 +222,19 @@
 I know the documentation says you can't count on the FileSets task sorting 
your files.  But this is exactly why I'm looking to something like Ant to 
handle my code compiles; I need them sorted.
 
 Has anyone come up with a workaround so that the files can be sorted 
alphabetically by name?  Any plans for future Ant enhancements to support this?
+
+----
+ ```Question#7``` How to have new .java files override existing .class files?
+
+This seems like it should just work, but it doesn't quite. When I have a tree 
of packages which are already compiled, then I have my updated versions of 
.java files which will override the existing .class files, there are cases 
where some of the sources will depend on other sources.
+
+The problem is that if I'm compiling a .java file that depends on another 
.java file, but the .class file already exists for that other dependent file, 
then the .java file that is getting compiled might fail because a new method 
might have been added to the other .java file, but doesn't exist in the .class 
file.
+
+In this case the order of compiling matters.
+
+One simple solution would be to somehow delete all .class files that match 
.java files. Then javac will need to compile the .java version since it won't 
be able to find the methods otherwise.
+
+Another solution would be to do more thorough dependency checking in javac 
where it would see that a .java file exists for a class and it will compile 
that file before using an existing .class file.
+
+Any suggestions on how to do this with ant?
+

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

Reply via email to