ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r526228 - in /ant/core/trunk: WHATSNEW docs/manual/CoreTypes/patternset.html src/main/org/apache/tools/ant/types/PatternSet.java
Date Fri, 06 Apr 2007 17:09:49 GMT
Author: mbenson
Date: Fri Apr  6 10:09:48 2007
New Revision: 526228

URL: http://svn.apache.org/viewvc?view=rev&rev=526228
Log:
Patternset allows nested inverted patternsets using <invert>.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/CoreTypes/patternset.html
    ant/core/trunk/src/main/org/apache/tools/ant/types/PatternSet.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=526228&r1=526227&r2=526228
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Apr  6 10:09:48 2007
@@ -92,7 +92,9 @@
 
 * 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
 ===================================

Modified: ant/core/trunk/docs/manual/CoreTypes/patternset.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/patternset.html?view=diff&rev=526228&r1=526227&r2=526228
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/patternset.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/patternset.html Fri Apr  6 10:09:48 2007
@@ -126,6 +126,9 @@
 <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;

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/PatternSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/PatternSet.java?view=diff&rev=526228&r1=526227&r2=526228
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/PatternSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/PatternSet.java Fri Apr  6 10:09:48
2007
@@ -143,6 +143,19 @@
         }
     }
 
+    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 @@
         }
     }
 
+    /**
+     * Add an inverted patternset.
+     *
+     */
+    public void addConfiguredInvert(PatternSet p) {
+        addConfiguredPatternset(new InvertedPatternSet(p));
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message