You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/08/29 14:11:29 UTC

svn commit: r1518621 - in /myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin: AbstractThemeMojo.java IndexThemeMojo.java

Author: lofwyr
Date: Thu Aug 29 12:11:28 2013
New Revision: 1518621

URL: http://svn.apache.org/r1518621
Log:
TOBAGO-1302: Add support for a theme resources index file per theme 
 - first char should be a '/'
 - *.properties and *.properties.xml must also be added

Modified:
    myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java
    myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/IndexThemeMojo.java

Modified: myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java?rev=1518621&r1=1518620&r2=1518621&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/AbstractThemeMojo.java Thu Aug 29 12:11:28 2013
@@ -35,9 +35,15 @@ public abstract class AbstractThemeMojo 
    */
   private MavenProject project;
 
-  private String[] includes = new String[]{"**"};
-  private String[] excludes = new String[]{"META-INF/**/*",
-      "**/*.properties", "**/*.xml", "**/*.class"};
+  private static final String[] INCLUDES = new String[]{
+      "**"
+  };
+  private static final String[] EXCLUDES = new String[]{
+      "META-INF/**/*",
+      "**/*.properties",
+      "**/*.xml",
+      "**/*.class"
+  };
 
   public MavenProject getProject() {
     return project;
@@ -46,18 +52,18 @@ public abstract class AbstractThemeMojo 
   protected String[] getThemeFiles(File sourceDir) {
     DirectoryScanner scanner = new DirectoryScanner();
     scanner.setBasedir(sourceDir);
-    scanner.setIncludes(includes);
-    scanner.setExcludes(excludes);
+    scanner.setIncludes(INCLUDES);
+    scanner.setExcludes(EXCLUDES);
     scanner.scan();
     return scanner.getIncludedFiles();
   }
 
   public String[] getIncludes() {
-    return includes;
+    return INCLUDES;
   }
 
   public String[] getExcludes() {
-    return excludes;
+    return EXCLUDES;
   }
 
 

Modified: myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/IndexThemeMojo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/IndexThemeMojo.java?rev=1518621&r1=1518620&r2=1518621&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/IndexThemeMojo.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-theme-plugin/src/main/java/org/apache/myfaces/tobago/maven/plugin/IndexThemeMojo.java Thu Aug 29 12:11:28 2013
@@ -36,6 +36,11 @@ import java.io.StringWriter;
  */
 public class IndexThemeMojo extends AbstractThemeMojo {
 
+  private static final String[] EXCLUDES = new String[]{
+      "META-INF/**/*",
+      "**/*.class"
+  };
+
   /**
    * Directory containing the resource files that should be listed into the tobago-resources.properties.
    *
@@ -90,6 +95,7 @@ public class IndexThemeMojo extends Abst
         StringWriter stringWriter = new StringWriter();
         bufferedWriter = new BufferedWriter(stringWriter);
         for (String file : scanner.getIncludedFiles()) {
+          bufferedWriter.append('/');
           bufferedWriter.append(file);
           bufferedWriter.newLine();
         }
@@ -105,6 +111,10 @@ public class IndexThemeMojo extends Abst
     }
   }
 
+  public String[] getExcludes() {
+    return EXCLUDES;
+  }
+
   private static class StaleCheckDirectoryScanner extends DirectoryScanner {
     private long lastModified;
     private boolean isUp2date = true;