[richfaces-svn-commits] JBoss Rich Faces SVN: r15902 - in root/cdk/trunk/plugins/maven-cdk-plugin/src/main: mdo and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Nov 17 13:10:31 EST 2009


Author: nbelaevski
Date: 2009-11-17 13:10:31 -0500 (Tue, 17 Nov 2009)
New Revision: 15902

Removed:
   root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileTemplatesMojo.java
Modified:
   root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
   root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java
   root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo
Log:
https://jira.jboss.org/jira/browse/RF-7732

Deleted: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileTemplatesMojo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileTemplatesMojo.java	2009-11-17 17:41:37 UTC (rev 15901)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileTemplatesMojo.java	2009-11-17 18:10:31 UTC (rev 15902)
@@ -1,122 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- */
-
-
-
-package org.richfaces.builder.mojo;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.PrintWriter;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-import org.richfaces.builder.model.JavaClass;
-import org.richfaces.builder.render.JavaClassRenderer;
-import org.richfaces.builder.templates.TemplateReader;
-
-/**
- * @author Nick Belaevski
- * @goal compile-templates
- */
-public class CompileTemplatesMojo extends AbstractCDKMojo {
-
-    /**
-     * sourceFileIncludes
-     * @parameter
-     */
-    protected String[] templateFileIncludes = {"**/*.template.xml"};
-
-    /**
-     * sourceFileExcludes
-     * @parameter
-     */
-    protected String[] templatesFileExcludes = null;
-
-    /**
-     * @param templatesDirectory the templatesDirectory to set
-     */
-    protected void setTemplatesDirectory(File templatesDirectory) {
-        this.templatesDirectory = templatesDirectory;
-    }
-
-    /**
-     * @param templateFileIncludes the templateFileIncludes to set
-     */
-    public void setTemplateFileIncludes(String[] templateFileIncludes) {
-        this.templateFileIncludes = templateFileIncludes;
-    }
-
-    /**
-     * @param templatesFileExcludes the templatesFileExcludes to set
-     */
-    public void setTemplatesFileExcludes(String[] templatesFileExcludes) {
-        this.templatesFileExcludes = templatesFileExcludes;
-    }
-
-    protected Iterable<File> findTemplateFiles() throws MojoExecutionException {
-        Set<File> sourceFiles = new HashSet<File>();
-
-        if (templatesDirectory.exists() && templatesDirectory.isDirectory()) {
-            for (String fileName : doScan(templateFileIncludes, templatesFileExcludes, templatesDirectory)) {
-                sourceFiles.add(new File(templatesDirectory, fileName));
-            }
-        }
-
-        return sourceFiles;
-    }
-
-    protected void compileTemplates() throws MojoExecutionException, MojoFailureException {
-        try {
-            Iterable<File> templates = findTemplateFiles();
-
-            for (File file : templates) {
-                JavaClass javaClass = TemplateReader.parse(new FileInputStream(file));
-                String fullName = javaClass.getFullName();
-                File outFile = new File(outputJavaDirectory, fullName.replace('.', '/') + ".java");
-
-                if (outFile.exists()) {
-                    outFile.delete();
-                }
-
-                outFile.getParentFile().mkdirs();
-                new JavaClassRenderer().render(javaClass, new PrintWriter(outFile));
-            }
-        } catch (Exception e) {
-            throw new MojoExecutionException(e.getMessage(), e);
-        }
-    }
-
-    @Override
-    public void execute() throws MojoExecutionException, MojoFailureException {
-        outputJavaDirectory.mkdirs();
-        outputResourcesDirectory.mkdirs();
-        outputTestsDirectory.mkdirs();
-        project.addCompileSourceRoot(outputJavaDirectory.getAbsolutePath());
-        project.addCompileSourceRoot(outputResourcesDirectory.getAbsolutePath());
-        project.addTestCompileSourceRoot(outputTestsDirectory.getAbsolutePath());
-        compileTemplates();
-    }
-}

Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java	2009-11-17 17:41:37 UTC (rev 15901)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java	2009-11-17 18:10:31 UTC (rev 15902)
@@ -31,7 +31,6 @@
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
-
 import org.codehaus.plexus.util.DirectoryScanner;
 
 import org.richfaces.builder.maven.MavenLogger;
@@ -174,7 +173,7 @@
      */
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
-
+    	
         // Setup logger.
         LoggerFactory.setLogger(new MavenLogger(getLog()));
 
@@ -424,10 +423,16 @@
             for (FileSet fileSet : filesets) {
                 String[] includes = (String[]) fileSet.getIncludes().toArray(STRINGS_ARRAY);
                 String[] excludes = (String[]) fileSet.getExcludes().toArray(STRINGS_ARRAY);
-                String[] scan = doScan(includes, excludes, new File(fileSet.getDirectory()));
+                File fileSetDirectory = new File(fileSet.getDirectory());
+				String[] scan = doScan(includes, excludes, fileSetDirectory);
 
                 for (String filename : scan) {
-                    files.add(new File(filename));
+                	File file = new File(fileSetDirectory, filename);
+                	if (!file.exists()) {
+                		file = new File(project.getBasedir(), file.getPath());
+                	}
+                	
+					files.add(file);
                 }
             }
         }

Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java	2009-11-17 17:41:37 UTC (rev 15901)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java	2009-11-17 18:10:31 UTC (rev 15902)
@@ -26,7 +26,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.richfaces.cdk.model.Resource;
+import org.richfaces.cdk.model.legacy.Resource;
 
 /**
  * @author Maksim Kaszynski

Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo	2009-11-17 17:41:37 UTC (rev 15901)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo	2009-11-17 18:10:31 UTC (rev 15902)
@@ -5,7 +5,7 @@
 	<defaults>
 		<default>
 			<key>package</key>
-			<value>org.richfaces.cdk.model</value>
+			<value>org.richfaces.cdk.model.legacy</value>
 		</default>
 	</defaults>
 	<classes>



More information about the richfaces-svn-commits mailing list