|
@@ -128,7 +128,7 @@ public class Target implements TaskContainer { |
|
|
String token = tok.nextToken().trim(); |
|
|
String token = tok.nextToken().trim(); |
|
|
|
|
|
|
|
|
// Make sure the dependency is not empty string |
|
|
// Make sure the dependency is not empty string |
|
|
if (token.equals("") || token.equals(",")) { |
|
|
|
|
|
|
|
|
if ("".equals(token) || ",".equals(token)) { |
|
|
throw new BuildException("Syntax Error: Depend " |
|
|
throw new BuildException("Syntax Error: Depend " |
|
|
+ "attribute for target \"" + getName() |
|
|
+ "attribute for target \"" + getName() |
|
|
+ "\" has an empty string for dependency."); |
|
|
+ "\" has an empty string for dependency."); |
|
@@ -140,7 +140,7 @@ public class Target implements TaskContainer { |
|
|
// end in a , |
|
|
// end in a , |
|
|
if (tok.hasMoreTokens()) { |
|
|
if (tok.hasMoreTokens()) { |
|
|
token = tok.nextToken(); |
|
|
token = tok.nextToken(); |
|
|
if (!tok.hasMoreTokens() || !token.equals(",")) { |
|
|
|
|
|
|
|
|
if (!tok.hasMoreTokens() || !",".equals(token)) { |
|
|
throw new BuildException("Syntax Error: Depend " |
|
|
throw new BuildException("Syntax Error: Depend " |
|
|
+ "attribute for target \"" + getName() |
|
|
+ "attribute for target \"" + getName() |
|
|
+ "\" ends with a , character"); |
|
|
+ "\" ends with a , character"); |
|
@@ -256,7 +256,7 @@ public class Target implements TaskContainer { |
|
|
* no "if" test is performed. |
|
|
* no "if" test is performed. |
|
|
*/ |
|
|
*/ |
|
|
public void setIf(String property) { |
|
|
public void setIf(String property) { |
|
|
this.ifCondition = (property == null) ? "" : property; |
|
|
|
|
|
|
|
|
ifCondition = (property == null) ? "" : property; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -284,7 +284,7 @@ public class Target implements TaskContainer { |
|
|
* no "unless" test is performed. |
|
|
* no "unless" test is performed. |
|
|
*/ |
|
|
*/ |
|
|
public void setUnless(String property) { |
|
|
public void setUnless(String property) { |
|
|
this.unlessCondition = (property == null) ? "" : property; |
|
|
|
|
|
|
|
|
unlessCondition = (property == null) ? "" : property; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -361,11 +361,11 @@ public class Target implements TaskContainer { |
|
|
} |
|
|
} |
|
|
} else if (!testIfCondition()) { |
|
|
} else if (!testIfCondition()) { |
|
|
project.log(this, "Skipped because property '" |
|
|
project.log(this, "Skipped because property '" |
|
|
+ project.replaceProperties(this.ifCondition) |
|
|
|
|
|
|
|
|
+ project.replaceProperties(ifCondition) |
|
|
+ "' not set.", Project.MSG_VERBOSE); |
|
|
+ "' not set.", Project.MSG_VERBOSE); |
|
|
} else { |
|
|
} else { |
|
|
project.log(this, "Skipped because property '" |
|
|
project.log(this, "Skipped because property '" |
|
|
+ project.replaceProperties(this.unlessCondition) |
|
|
|
|
|
|
|
|
+ project.replaceProperties(unlessCondition) |
|
|
+ "' set.", Project.MSG_VERBOSE); |
|
|
+ "' set.", Project.MSG_VERBOSE); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -454,4 +454,28 @@ public class Target implements TaskContainer { |
|
|
String test = project.replaceProperties(unlessCondition); |
|
|
String test = project.replaceProperties(unlessCondition); |
|
|
return project.getProperty(test) == null; |
|
|
return project.getProperty(test) == null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Equality check is based on target name |
|
|
|
|
|
* @param that other thing to check |
|
|
|
|
|
* @return true iff type and name are equal |
|
|
|
|
|
*/ |
|
|
|
|
|
public boolean equals(Object that) { |
|
|
|
|
|
if (this == that) return true; |
|
|
|
|
|
if (that == null || getClass() != that.getClass()) return false; |
|
|
|
|
|
|
|
|
|
|
|
final Target target = (Target) that; |
|
|
|
|
|
|
|
|
|
|
|
if (name != null ? !name.equals(target.name) : target.name != null) return false; |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Hash code is based on name, is 0 if the name==null |
|
|
|
|
|
* @return hash code |
|
|
|
|
|
*/ |
|
|
|
|
|
public int hashCode() { |
|
|
|
|
|
return (name != null ? name.hashCode() : 0); |
|
|
|
|
|
} |
|
|
} |
|
|
} |