Browse Source

Merge across fixes from 1.4 branch

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269750 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
b6f5be4643
2 changed files with 27 additions and 4 deletions
  1. +20
    -3
      src/main/org/apache/tools/ant/Target.java
  2. +7
    -1
      src/main/org/apache/tools/ant/util/SourceFileScanner.java

+ 20
- 3
src/main/org/apache/tools/ant/Target.java View File

@@ -83,11 +83,28 @@ public class Target implements TaskContainer {
public void setDepends(String depS) {
if (depS.length() > 0) {
StringTokenizer tok =
new StringTokenizer(depS, ",", false);
new StringTokenizer(depS, ",", true);
while (tok.hasMoreTokens()) {
String token = tok.nextToken().trim();
if (!token.equals("")) {
addDependency(token);

//Make sure the dependency is not empty string
if (token.equals("") || token.equals(",")) {
throw new BuildException( "Syntax Error: Depend attribute " +
"for target \"" + getName() +
"\" has an empty string for dependency." );
}

addDependency(token);
//Make sure that depends attribute does not
//end in a ,
if (tok.hasMoreTokens()) {
token = tok.nextToken();
if (!tok.hasMoreTokens() || !token.equals(",")) {
throw new BuildException( "Syntax Error: Depend attribute " +
"for target \"" + getName() +
"\" ends with a , character" );
}
}
}
}


+ 7
- 1
src/main/org/apache/tools/ant/util/SourceFileScanner.java View File

@@ -121,7 +121,13 @@ public class SourceFileScanner {
continue;
}

File src = fileUtils.resolveFile(srcDir, files[i]);
File src = null;
if (srcDir == null) {
src = new File(files[i]);
} else {
src = fileUtils.resolveFile(srcDir, files[i]);
}

if (src.lastModified() > now) {
task.log("Warning: "+files[i]+" modified in the future.",
Project.MSG_WARN);


Loading…
Cancel
Save