Browse Source

Patternset allows nested inverted patternsets using <invert>.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@526228 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
d121889dca
3 changed files with 26 additions and 1 deletions
  1. +3
    -1
      WHATSNEW
  2. +3
    -0
      docs/manual/CoreTypes/patternset.html
  3. +20
    -0
      src/main/org/apache/tools/ant/types/PatternSet.java

+ 3
- 1
WHATSNEW View File

@@ -92,7 +92,9 @@ Other changes:

* Add IgnoreDependenciesExecutor for weird cases when the user wants to run
only the targets explicitly specified.

* Patternset allows nested inverted patternsets using <invert>.


Changes from Ant 1.6.5 to Ant 1.7.0
===================================


+ 3
- 0
docs/manual/CoreTypes/patternset.html View File

@@ -126,6 +126,9 @@ you can use to test the existance of a property.</p>
<h4><code>patternset</code></h4>
<p>Patternsets may be nested within one another, adding the nested
patterns to the parent patternset.</p>
<h4><code>invert</code></h4>
<p>A nested patternset can be inverted using the <code>&lt;invert&gt;</code>
element. <em>Since Ant 1.7.1</em></p>
<h3>Examples</h3>
<blockquote><pre>
&lt;patternset id=&quot;non.test.sources&quot;&gt;


+ 20
- 0
src/main/org/apache/tools/ant/types/PatternSet.java View File

@@ -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.
*/
@@ -509,4 +522,11 @@ public class PatternSet extends DataType implements Cloneable {
}
}

/**
* Add an inverted patternset.
*
*/
public void addConfiguredInvert(PatternSet p) {
addConfiguredPatternset(new InvertedPatternSet(p));
}
}

Loading…
Cancel
Save