git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@526228 13f79535-47bb-0310-9956-ffa450edef68master
@@ -92,7 +92,9 @@ Other changes: | |||||
* Add IgnoreDependenciesExecutor for weird cases when the user wants to run | * Add IgnoreDependenciesExecutor for weird cases when the user wants to run | ||||
only the targets explicitly specified. | only the targets explicitly specified. | ||||
* Patternset allows nested inverted patternsets using <invert>. | |||||
Changes from Ant 1.6.5 to Ant 1.7.0 | Changes from Ant 1.6.5 to Ant 1.7.0 | ||||
=================================== | =================================== | ||||
@@ -126,6 +126,9 @@ you can use to test the existance of a property.</p> | |||||
<h4><code>patternset</code></h4> | <h4><code>patternset</code></h4> | ||||
<p>Patternsets may be nested within one another, adding the nested | <p>Patternsets may be nested within one another, adding the nested | ||||
patterns to the parent patternset.</p> | patterns to the parent patternset.</p> | ||||
<h4><code>invert</code></h4> | |||||
<p>A nested patternset can be inverted using the <code><invert></code> | |||||
element. <em>Since Ant 1.7.1</em></p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | <blockquote><pre> | ||||
<patternset id="non.test.sources"> | <patternset id="non.test.sources"> | ||||
@@ -143,6 +143,19 @@ public class PatternSet extends DataType implements Cloneable { | |||||
} | } | ||||
} | } | ||||
private class InvertedPatternSet extends PatternSet { | |||||
private InvertedPatternSet(PatternSet p) { | |||||
setProject(p.getProject()); | |||||
addConfiguredPatternset(p); | |||||
} | |||||
public String[] getIncludePatterns(Project p) { | |||||
return super.getExcludePatterns(p); | |||||
} | |||||
public String[] getExcludePatterns(Project p) { | |||||
return super.getIncludePatterns(p); | |||||
} | |||||
} | |||||
/** | /** | ||||
* Creates a new <code>PatternSet</code> instance. | * Creates a new <code>PatternSet</code> instance. | ||||
*/ | */ | ||||
@@ -509,4 +522,11 @@ public class PatternSet extends DataType implements Cloneable { | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Add an inverted patternset. | |||||
* | |||||
*/ | |||||
public void addConfiguredInvert(PatternSet p) { | |||||
addConfiguredPatternset(new InvertedPatternSet(p)); | |||||
} | |||||
} | } |