maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject svn commit: r1729092 - in /maven/shared/trunk/maven-filtering: pom.xml src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java
Date Mon, 08 Feb 2016 08:19:47 GMT
Author: khmarbaise
Date: Mon Feb  8 08:19:47 2016
New Revision: 1729092

URL: http://svn.apache.org/viewvc?rev=1729092&view=rev
Log:
[MSHARED-495] Add convenience method to move code into Maven Filtering
 o Moving this code into maven-filtering makes changing the code
   simpler and makes the plugins more independant.

Modified:
    maven/shared/trunk/maven-filtering/pom.xml
    maven/shared/trunk/maven-filtering/src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java

Modified: maven/shared/trunk/maven-filtering/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-filtering/pom.xml?rev=1729092&r1=1729091&r2=1729092&view=diff
==============================================================================
--- maven/shared/trunk/maven-filtering/pom.xml (original)
+++ maven/shared/trunk/maven-filtering/pom.xml Mon Feb  8 08:19:47 2016
@@ -119,6 +119,13 @@
       <version>4.11</version>
       <scope>test</scope>
     </dependency>
+    
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <version>1.7.1</version>
+      <scope>test</scope>
+    </dependency>
 
   </dependencies>
 

Modified: maven/shared/trunk/maven-filtering/src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-filtering/src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java?rev=1729092&r1=1729091&r2=1729092&view=diff
==============================================================================
--- maven/shared/trunk/maven-filtering/src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java
(original)
+++ maven/shared/trunk/maven-filtering/src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java
Mon Feb  8 08:19:47 2016
@@ -331,6 +331,39 @@ public class AbstractMavenFilteringReque
     }
 
     /**
+     * @param delimiters If {@code null} than nothing will happen. If not {@code null} the
delimiters will be set
+     *            according to the contents. If delimiter entries are {@code null} those
entries will be set to '${*}'.
+     * @param useDefaultDelimiters true if the default delimiters will be used false otherwise.
+     */
+    public void setDelimiters( LinkedHashSet<String> delimiters, boolean useDefaultDelimiters
)
+    {
+        if ( delimiters != null && !delimiters.isEmpty() )
+        {
+            LinkedHashSet<String> delims = new LinkedHashSet<String>();
+            if ( useDefaultDelimiters )
+            {
+                delims.addAll( this.getDelimiters() );
+            }
+
+            for ( String delim : delimiters )
+            {
+                if ( delim == null )
+                {
+                    // FIXME: ${filter:*} could also trigger this condition. Need a better
long-term solution.
+                    delims.add( "${*}" );
+                }
+                else
+                {
+                    delims.add( delim );
+                }
+            }
+
+            this.setDelimiters( delims );
+        }
+
+    }
+
+    /**
      * @return If support multiple line filtering is active or not.
      */
     public boolean isSupportMultiLineFiltering()



Mime
View raw message