Browse Source

Deprecate the implicit copying of support files by Javac.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267700 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 25 years ago
parent
commit
3d1eba05e4
1 changed files with 18 additions and 15 deletions
  1. +18
    -15
      src/main/org/apache/tools/ant/taskdefs/Javac.java

+ 18
- 15
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -237,6 +237,10 @@ public class Javac extends MatchingTask {
// copy the support files // copy the support files


if (filecopyList.size() > 0) { if (filecopyList.size() > 0) {
project.log("The implicit copying of support files by javac has been deprecated. " +
"Use the copydir task to copy support files explicitly.",
Project.MSG_WARN);
project.log("Copying " + filecopyList.size() + project.log("Copying " + filecopyList.size() +
" support files to " + destDir.getAbsolutePath()); " support files to " + destDir.getAbsolutePath());
Enumeration enum = filecopyList.keys(); Enumeration enum = filecopyList.keys();
@@ -271,22 +275,21 @@ public class Javac extends MatchingTask {
File srcFile = new File(srcDir, files[i]); File srcFile = new File(srcDir, files[i]);
if (files[i].endsWith(".java")) { if (files[i].endsWith(".java")) {
File classFile = new File(destDir, files[i].substring(0, File classFile = new File(destDir, files[i].substring(0,
files[i].indexOf(".java")) files[i].indexOf(".java")) + ".class");
+ ".class"); if (srcFile.lastModified() > now) {

project.log("Warning: file modified in the future: " +
if (srcFile.lastModified() > now) { files[i], project.MSG_WARN);
project.log("Warning: file modified in the future: " + }
files[i], project.MSG_WARN); if (srcFile.lastModified() > classFile.lastModified()) {
} compileList.addElement(srcFile.getAbsolutePath());

}
if (srcFile.lastModified() > classFile.lastModified()) { } else {
compileList.addElement(srcFile.getAbsolutePath());
}
} else {
File destFile = new File(destDir, files[i]); File destFile = new File(destDir, files[i]);
if (srcFile.lastModified() > destFile.lastModified()) { if (srcFile.lastModified() > destFile.lastModified()) {
filecopyList.put(srcFile.getAbsolutePath(), filecopyList.put(srcFile.getAbsolutePath(),
destFile.getAbsolutePath()); destFile.getAbsolutePath());
} }
} }
} }


||||||
x
 
000:0
Loading…
Cancel
Save