Author: alexsmirnov
Date: 2010-06-21 18:32:30 -0400 (Mon, 21 Jun 2010)
New Revision: 17655
Added:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AbstractPage.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessorImpl.java
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
Log:
Create output folders by default, process project without java files, do not generate
faces-config.xml for empty library.
Added:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AbstractPage.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AbstractPage.java
(rev 0)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AbstractPage.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -0,0 +1,35 @@
+/*
+ * $Id$
+ *
+ * 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.cdk.apt;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public abstract class AbstractPage extends UIComponentBase {
+
+}
Property changes on:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AbstractPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -23,8 +23,6 @@
package org.richfaces.cdk.apt;
-import javax.annotation.processing.Processor;
-
import org.richfaces.cdk.LibraryBuilder;
import org.richfaces.cdk.apt.processors.AttributesProcessor;
import org.richfaces.cdk.apt.processors.AttributesProcessorImpl;
@@ -67,7 +65,7 @@
setBinder.addBinding().to(FunctionProcessor.class);
setBinder.addBinding().to(EventProcessor.class);
- bind(Processor.class).to(CdkProcessor.class);
+ bind(CdkProcessor.class).to(CdkProcessorImpl.class);
bind(AttributesProcessor.class).to(AttributesProcessorImpl.class);
bind(DescriptionProcessor.class).to(DescriptionProcessorImpl.class);
bind(CompilationTaskFactory.class).to(TaskFactoryImpl.class);
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -23,31 +23,8 @@
package org.richfaces.cdk.apt;
-import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-import java.util.Collections;
-import java.util.Set;
+import javax.annotation.processing.Processor;
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.annotation.processing.RoundEnvironment;
-import javax.lang.model.SourceVersion;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.TypeElement;
-import javax.tools.Diagnostic.Kind;
-
-import org.richfaces.cdk.CdkProcessingException;
-import org.richfaces.cdk.LibraryBuilder;
-import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.ModelBuilder;
-import org.richfaces.cdk.ModelValidator;
-import org.richfaces.cdk.apt.processors.CdkAnnotationProcessor;
-import org.richfaces.cdk.model.ComponentLibrary;
-
-import com.google.inject.Inject;
-
/**
* <p class="changed_added_4_0">
* Base class for all CDK Annotation processors. That class provides access to current
CDK context and utility methods
@@ -57,144 +34,8 @@
* @author asmirnov(a)exadel.com
*
*/
-public class CdkProcessor extends AbstractProcessor {
+public interface CdkProcessor extends Processor {
- private static final Set<String> PROCESSED_ANNOTATION =
Collections.singleton("*");
+ public void processNonJavaSources();
- @Inject
- private Logger log;
-
- @Inject
- private Set<CdkAnnotationProcessor> processors;
-
- // TODO - set library as parameter.
- @Inject
- private ComponentLibrary library;
-
- @Inject
- private Set<ModelBuilder> builders;
-
- @Inject
- private SourceUtilsProvider sourceUtilsProducer;
-
- @Inject
- private ModelValidator validator;
-
- @Inject
- private LibraryBuilder builder;
-
- @Override
- public synchronized void init(ProcessingEnvironment processingEnv) {
- super.init(processingEnv);
- sourceUtilsProducer.setProcessingEnv(processingEnv);
- }
-
- @Override
- public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
roundEnv) {
- if (!roundEnv.processingOver()) {
- // Process annotations.
- for (CdkAnnotationProcessor process : processors) {
- processAnnotation(process, roundEnv);
- }
- // parse non-java sources
- for (ModelBuilder builder : builders) {
- log.debug("Run builder "+builder.getClass().getName());
- builder.build();
- }
- // validator should be called even if previvous phases finish with errors, to
collect all possible problems.
- log.debug("Validate model");
- validator.verify(library);
- } else if (0 == log.getErrorCount()) {
- // processing over, generate files.
- log.debug("Generate output files");
- builder.generate(library);
-
- }
- return false;
- }
-
- protected void processAnnotation(CdkAnnotationProcessor processor, RoundEnvironment
environment) {
- Class<? extends Annotation> processedAnnotation =
processor.getProcessedAnnotation();
- log.debug("Process all elements annotated with
"+processedAnnotation.getName());
- Target target = processedAnnotation.getAnnotation(Target.class);
- try {
- Set<? extends Element> rootElements = environment.getRootElements();
- for (Element element : rootElements) {
- if (isAppropriateTarget(element, target)){
- processElement(processor, processedAnnotation, element);
- } else {
- for (Element enclosedElement : element.getEnclosedElements()) {
- if (isAppropriateTarget(enclosedElement, target)){
- processElement(processor, processedAnnotation,
enclosedElement);
- }
- }
- }
- }
- } catch (Exception e) {
- processingEnv.getMessager().printMessage(Kind.ERROR,
- "Errorr processing annotation " + processedAnnotation + ":
" + e);
- }
- }
-
- private void processElement(CdkAnnotationProcessor processor, Class<? extends
Annotation> processedAnnotation,
- Element element) {
- if (null != element.getAnnotation(processedAnnotation)) {
- try {
- log.debug("Process "+element.getSimpleName()+" annotated
with "+processedAnnotation.getName());
- processor.process(element, library);
- } catch (CdkProcessingException e) {
- sendError(element, e);
- }
- }
- }
-
- private boolean isAppropriateTarget(Element element,Target target){
- boolean match = false;
- ElementKind kind = element.getKind();
- if(null != target){
- for(ElementType targetType : target.value()){
- switch (targetType) {
- case TYPE:
- match |=
ElementKind.CLASS.equals(kind)||ElementKind.INTERFACE.equals(kind)||ElementKind.ENUM.equals(kind);
- break;
- case PACKAGE:
- match |= ElementKind.PACKAGE.equals(kind);
- break;
- case METHOD:
- match |= ElementKind.METHOD.equals(kind);
- break;
- case FIELD:
- match |= ElementKind.FIELD.equals(kind);
- break;
- default:
- break;
- }
- }
- } else {
- // Annotation without @Target match any element.
- match =
- ElementKind.CLASS.equals(kind) || ElementKind.INTERFACE.equals(kind) ||
ElementKind.ENUM.equals(kind)
- || ElementKind.PACKAGE.equals(kind) ||
ElementKind.METHOD.equals(kind)
- || ElementKind.FIELD.equals(kind);
- }
- return match;
- }
-
- protected void sendError(Element componentElement, CdkProcessingException e) {
- // rise error and continue.
- processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR,
e.getMessage(), componentElement);
- }
-
- @Override
- public Set<String> getSupportedAnnotationTypes() {
- return PROCESSED_ANNOTATION;
- }
-
- @Override
- public SourceVersion getSupportedSourceVersion() {
-
- // CDK supports Java 5 or 6 source code.
- return SourceVersion.RELEASE_6;
- }
-
}
Copied:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessorImpl.java
(from rev 17654,
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java)
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessorImpl.java
(rev 0)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessorImpl.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -0,0 +1,209 @@
+/*
+ * $Id$
+ *
+ * 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.cdk.apt;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.util.Collections;
+import java.util.Set;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.annotation.processing.RoundEnvironment;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.TypeElement;
+import javax.tools.Diagnostic.Kind;
+
+import org.richfaces.cdk.CdkProcessingException;
+import org.richfaces.cdk.LibraryBuilder;
+import org.richfaces.cdk.Logger;
+import org.richfaces.cdk.ModelBuilder;
+import org.richfaces.cdk.ModelValidator;
+import org.richfaces.cdk.apt.processors.CdkAnnotationProcessor;
+import org.richfaces.cdk.model.ComponentLibrary;
+
+import com.google.inject.Inject;
+
+/**
+ * <p class="changed_added_4_0">
+ * Base class for all CDK Annotation processors. That class provides access to current
CDK context and utility methods
+ * for Java source models.
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class CdkProcessorImpl extends AbstractProcessor implements CdkProcessor {
+
+ private static final Set<String> PROCESSED_ANNOTATION =
Collections.singleton("*");
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private Set<CdkAnnotationProcessor> processors;
+
+ // TODO - set library as parameter.
+ @Inject
+ private ComponentLibrary library;
+
+ @Inject
+ private Set<ModelBuilder> builders;
+
+ @Inject
+ private SourceUtilsProvider sourceUtilsProducer;
+
+ @Inject
+ private ModelValidator validator;
+
+ @Inject
+ private LibraryBuilder builder;
+
+ @Override
+ public synchronized void init(ProcessingEnvironment processingEnv) {
+ super.init(processingEnv);
+ sourceUtilsProducer.setProcessingEnv(processingEnv);
+ }
+
+ @Override
+ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
roundEnv) {
+ if (!roundEnv.processingOver()) {
+ // Process annotations.
+ for (CdkAnnotationProcessor process : processors) {
+ processAnnotation(process, roundEnv);
+ }
+ } else {
+ // parse non-java sources
+ processNonJavaSources();
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.apt.CdkProcessor#processNonJavaSources()
+ */
+ public void processNonJavaSources() {
+ for (ModelBuilder builder : builders) {
+ log.debug("Run builder "+builder.getClass().getName());
+ builder.build();
+ }
+ // validator should be called even if previvous phases finish with errors, to
collect all possible problems.
+ log.debug("Validate model");
+ validator.verify(library);
+ if(0 == log.getErrorCount()) {
+ // processing over, generate files.
+ log.debug("Generate output files");
+ builder.generate(library);
+ }
+
+ }
+
+ protected void processAnnotation(CdkAnnotationProcessor processor, RoundEnvironment
environment) {
+ Class<? extends Annotation> processedAnnotation =
processor.getProcessedAnnotation();
+ log.debug("Process all elements annotated with
"+processedAnnotation.getName());
+ Target target = processedAnnotation.getAnnotation(Target.class);
+ try {
+ Set<? extends Element> rootElements = environment.getRootElements();
+ for (Element element : rootElements) {
+ if (isAppropriateTarget(element, target)){
+ processElement(processor, processedAnnotation, element);
+ } else {
+ for (Element enclosedElement : element.getEnclosedElements()) {
+ if (isAppropriateTarget(enclosedElement, target)){
+ processElement(processor, processedAnnotation,
enclosedElement);
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ processingEnv.getMessager().printMessage(Kind.ERROR,
+ "Errorr processing annotation " + processedAnnotation + ":
" + e);
+ }
+ }
+
+ private void processElement(CdkAnnotationProcessor processor, Class<? extends
Annotation> processedAnnotation,
+ Element element) {
+ if (null != element.getAnnotation(processedAnnotation)) {
+ try {
+ log.debug("Process "+element.getSimpleName()+" annotated
with "+processedAnnotation.getName());
+ processor.process(element, library);
+ } catch (CdkProcessingException e) {
+ sendError(element, e);
+ }
+ }
+ }
+
+ private boolean isAppropriateTarget(Element element,Target target){
+ boolean match = false;
+ ElementKind kind = element.getKind();
+ if(null != target){
+ for(ElementType targetType : target.value()){
+ switch (targetType) {
+ case TYPE:
+ match |=
ElementKind.CLASS.equals(kind)||ElementKind.INTERFACE.equals(kind)||ElementKind.ENUM.equals(kind);
+ break;
+ case PACKAGE:
+ match |= ElementKind.PACKAGE.equals(kind);
+ break;
+ case METHOD:
+ match |= ElementKind.METHOD.equals(kind);
+ break;
+ case FIELD:
+ match |= ElementKind.FIELD.equals(kind);
+ break;
+ default:
+ break;
+ }
+ }
+ } else {
+ // Annotation without @Target match any element.
+ match =
+ ElementKind.CLASS.equals(kind) || ElementKind.INTERFACE.equals(kind) ||
ElementKind.ENUM.equals(kind)
+ || ElementKind.PACKAGE.equals(kind) ||
ElementKind.METHOD.equals(kind)
+ || ElementKind.FIELD.equals(kind);
+ }
+ return match;
+ }
+
+ protected void sendError(Element componentElement, CdkProcessingException e) {
+ // rise error and continue.
+ processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR,
e.getMessage(), componentElement);
+ }
+
+ @Override
+ public Set<String> getSupportedAnnotationTypes() {
+ return PROCESSED_ANNOTATION;
+ }
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+
+ // CDK supports Java 5 or 6 source code.
+ return SourceVersion.RELEASE_6;
+ }
+
+}
Property changes on:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessorImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -52,6 +52,8 @@
import org.richfaces.cdk.Source;
import org.richfaces.cdk.Sources;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
import com.google.inject.Inject;
/**
@@ -86,8 +88,7 @@
}
}
- private static List<String> compilerOptions =
- new ArrayList<String>(Arrays.asList("-proc:only",
"-implicit:class"));
+ private static List<String> compilerOptions = new
ArrayList<String>(Arrays.asList("-proc:only",
"-implicit:class"));
@Inject
private Logger log;
@@ -100,7 +101,7 @@
@Inject
private CdkClassLoader classPathLoader;
-
+
@Inject
@Output(Outputs.JAVA_CLASSES)
private FileManager outputFolder;
@@ -110,13 +111,13 @@
private FileManager sourceFolders;
@Inject
- private Processor cdkProcessor;
+ private CdkProcessor cdkProcessor;
private JavaCompiler javaCompiler;
private StandardJavaFileManager fileManager;
- private DiagnosticListener<JavaFileObject> diagnosticListener = new
DiagnosticListenerImplementation();
+ private final DiagnosticListener<JavaFileObject> diagnosticListener = new
DiagnosticListenerImplementation();
/*
* (non-Javadoc)
@@ -125,19 +126,41 @@
*/
@Override
public CompilationTask get() throws AptException {
- diagnosticListener = new DiagnosticListenerImplementation();
- Iterable<? extends JavaFileObject> sourceObjects = getFileManager()
- .getJavaFileObjectsFromFiles(sourceFolders.getFiles());
+ if (sourceFolders.getFiles().iterator().hasNext()) {
+ Iterable<? extends JavaFileObject> sourceObjects =
+ getFileManager().getJavaFileObjectsFromFiles(sourceFolders.getFiles());
- if (log.isDebugEnabled()) {
- compilerOptions.add("-verbose");
+ if (log.isDebugEnabled()) {
+ compilerOptions.add("-verbose");
+ }
+
+ CompilationTask task =
+ getJavaCompiler().getTask(null, getFileManager(), diagnosticListener,
compilerOptions, null,
+ sourceObjects);
+ task.setLocale(locale);
+ task.setProcessors(Collections.singleton(cdkProcessor));
+ return task;
+ } else {
+ // no Java sources, try to build from xml files
+ return new CompilationTask() {
+
+ @Override
+ public void setProcessors(Iterable<? extends Processor> processors)
{
+ // do nothing
+ }
+
+ @Override
+ public void setLocale(Locale locale) {
+
+ }
+
+ @Override
+ public Boolean call() {
+ cdkProcessor.processNonJavaSources();
+ return 0 == log.getErrorCount();
+ }
+ };
}
-
- CompilationTask task = getJavaCompiler()
- .getTask(null, getFileManager(), diagnosticListener, compilerOptions,
null, sourceObjects);
- task.setLocale(locale);
- task.setProcessors(Collections.singleton(cdkProcessor));
- return task;
}
private StandardJavaFileManager getFileManager() {
@@ -147,7 +170,17 @@
fileManager.setLocation(StandardLocation.CLASS_PATH,
classPathLoader.getFiles());
Iterable<File> outputFolders = outputFolder.getFolders();
if (null != outputFolders) {
- fileManager.setLocation(StandardLocation.SOURCE_OUTPUT,
outputFolders);
+ // Append only existed folders to output.
+ Iterable<File> existedFolders = Iterables.filter(outputFolders,
new Predicate<File>() {
+
+ @Override
+ public boolean apply(File input) {
+ return input.exists();
+ }
+ });
+ if (existedFolders.iterator().hasNext()) {
+ fileManager.setLocation(StandardLocation.SOURCE_OUTPUT,
outputFolders);
+ }
}
fileManager.setLocation(StandardLocation.SOURCE_PATH,
sourceFolders.getFolders());
} catch (IOException e) {
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -40,7 +40,7 @@
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.SubComponent;
+import org.richfaces.cdk.annotations.RendererSpecificComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
@@ -87,7 +87,7 @@
library.getComponents().add(component);
// Process the second level annotations.
- for (final SubComponent subcomponent : annotation.components()) {
+ for (final RendererSpecificComponent subcomponent : annotation.components()) {
JsfComponent subAnnotation = new JsfSubComponent(subcomponent, annotation);
ComponentModel subcomponentModel = new ComponentModel();
subcomponentModel.setBaseClass(component.getTargetClass());
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -30,12 +30,12 @@
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.SubComponent;
+import org.richfaces.cdk.annotations.RendererSpecificComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.Test;
/**
- * This calss wraps {@link SubComponent} annotation so it would be used by {@link
ComponentProcessor} methods, so they
+ * This calss wraps {@link RendererSpecificComponent} annotation so it would be used by
{@link ComponentProcessor} methods, so they
* can be reused for different types of the component annotations.
*
* @author akolonitsky
@@ -43,11 +43,11 @@
*/
public class JsfSubComponent implements JsfComponent {
- private final SubComponent subcomponent;
+ private final RendererSpecificComponent subcomponent;
private final JsfComponent parent;
- public JsfSubComponent(SubComponent subcomponent, JsfComponent parent) {
+ public JsfSubComponent(RendererSpecificComponent subcomponent, JsfComponent parent)
{
this.subcomponent = subcomponent;
this.parent = parent;
}
@@ -109,8 +109,8 @@
}
@Override
- public SubComponent[] components() {
- return new SubComponent[0];
+ public RendererSpecificComponent[] components() {
+ return new RendererSpecificComponent[0];
}
@Override
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -352,7 +352,21 @@
public long lastModified() {
return lastModified;
}
+
+ /**
+ * <p class="changed_added_4_0">Check that library is
empty</p>
+ * @param this
+ * @return
+ */
+ public boolean isEmpty() {
+ return this.getComponents().isEmpty() && this.getBehaviors().isEmpty()
+ && this.getConverters().isEmpty() &&
this.getEvents().isEmpty() && this.getFunctions().isEmpty()
+ && this.getListeners().isEmpty() &&
this.getRenderKits().isEmpty()
+ && this.getValidators().isEmpty() && (null ==
this.getExtension() || this.getExtension().getExtensions().isEmpty());
+ }
+
+
static <T extends ModelElement<T>> void merge(Collection<T> target,
Collection<T> source) {
for (T element : source) {
T targetElement = null;
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.xmlconfig;
import java.io.Writer;
@@ -40,24 +38,24 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class FacesConfigGenerator implements CdkWriter {
-
- public static final String FACES_SCHEMA_LOCATION =
ComponentLibrary.FACES_CONFIG_NAMESPACE + " "
- + ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION;
+ public static final String FACES_SCHEMA_LOCATION =
+ ComponentLibrary.FACES_CONFIG_NAMESPACE + " " +
ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION;
+
private static final String FACES_CONFIG_XML =
"META-INF/faces-config.xml";
@Inject
private JAXB jaxbBinding;
+ @Inject
+ @Output(Outputs.RESOURCES)
+ private FileManager outputFileManager;
- @Inject @Output(Outputs.RESOURCES)
- private FileManager outputFileManager;
-
private FacesConfigAdapter libraryAdapter;
public FacesConfigGenerator() {
@@ -66,27 +64,40 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.richfaces.cdk.CdkWriter#render(org.richfaces.cdk.model.ComponentLibrary
- * )
+ *
+ * @see org.richfaces.cdk.CdkWriter#render(org.richfaces.cdk.model.ComponentLibrary
)
*/
@Override
public void render(ComponentLibrary library) throws CdkException {
- // TODO - check modification time.
- try {
- Writer facesConfigXml = outputFileManager.createOutput(FACES_CONFIG_XML,
library.lastModified());
+ // do not render empty config.
+ if (!library.isEmpty()) {
+ try {
+ Writer facesConfigXml = outputFileManager.createOutput(FACES_CONFIG_XML,
library.lastModified());
- if (null != facesConfigXml) {
- jaxbBinding.marshal(facesConfigXml, FACES_SCHEMA_LOCATION,
libraryAdapter.marshal(library));
+ if (null != facesConfigXml) {
+ jaxbBinding.marshal(facesConfigXml, FACES_SCHEMA_LOCATION,
libraryAdapter.marshal(library));
+ }
+ } catch (Exception e) {
+ if (e instanceof CdkException) {
+ throw (CdkException) e;
+ } else {
+ throw new CdkException(e);
+ }
}
- } catch (Exception e) {
- if (e instanceof CdkException) {
- throw (CdkException) e;
- } else {
- throw new CdkException(e);
- }
}
}
+
+ /**
+ * <p class="changed_added_4_0">Check that library is
empty</p>
+ * @param library
+ * @return
+ */
+ private boolean empty(ComponentLibrary library) {
+
+ return library.getComponents().isEmpty() &&
library.getBehaviors().isEmpty()
+ && library.getConverters().isEmpty() &&
library.getEvents().isEmpty() && library.getFunctions().isEmpty()
+ && library.getListeners().isEmpty() &&
library.getRenderKits().isEmpty()
+ && library.getValidators().isEmpty() &&
library.getExtension().getExtensions().isEmpty();
+ }
}
Modified:
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -28,7 +28,6 @@
import java.util.Collections;
import java.util.Set;
-import javax.annotation.processing.Processor;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
@@ -84,7 +83,7 @@
@Mock
private TypeElement element;
- @Mock
+ @Stub
private Logger log;
@Stub
@@ -103,8 +102,7 @@
@Override
public void configure(Binder binder) {
super.configure(binder);
- binder.bind(CdkProcessor.class).in(Singleton.class);
- binder.bind(Processor.class).to(CdkProcessor.class);
+ binder.bind(CdkProcessor.class).to(CdkProcessorImpl.class).in(Singleton.class);
CdkAnnotationProcessor cdkProcessor = createMock(CdkAnnotationProcessor.class);
binder.bind(CdkAnnotationProcessor.class).toInstance(cdkProcessor);
binder.bind(new TypeLiteral<Set<CdkAnnotationProcessor>>() {
@@ -124,8 +122,8 @@
expect(element.getSimpleName()).andStubReturn(new TestName("foo"));
cdkProcessor.process(element, library);
expectLastCall();
- validator.verify(library);
- expectLastCall();
+// validator.verify(library);
+// expectLastCall();
replay(element, roundEnv, builder, validator, cdkProcessor);
processor.process(Collections.singleton(element), roundEnv);
verify(element, roundEnv, builder, validator, cdkProcessor);
@@ -138,8 +136,8 @@
expect((Set<TypeElement>)
roundEnv.getRootElements()).andReturn(Collections.singleton(element));
expect(element.getKind()).andReturn(ElementKind.CLASS);
expect(element.getAnnotation(TestAnnotation.class)).andReturn(null);
- validator.verify(library);
- expectLastCall();
+// validator.verify(library);
+// expectLastCall();
replay(element, roundEnv, builder, validator, cdkProcessor);
processor.process(Collections.singleton(element), roundEnv);
verify(element, roundEnv, builder, validator, cdkProcessor);
@@ -148,6 +146,8 @@
@Test
public void testProcessOver() throws Exception {
expect(roundEnv.processingOver()).andReturn(true);
+ validator.verify(library);
+ expectLastCall();
expect(log.getErrorCount()).andReturn(0);
log.debug((CharSequence) anyObject());
expectLastCall().asStub();
@@ -163,6 +163,8 @@
@Test
public void testProcessOver2() throws Exception {
expect(roundEnv.processingOver()).andReturn(true);
+ validator.verify(library);
+ expectLastCall();
expect(log.getErrorCount()).andReturn(1);
replay(log, element, roundEnv, builder, validator, cdkProcessor);
processor.process(Collections.singleton(element), roundEnv);
Modified:
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -30,7 +30,6 @@
import java.util.Set;
import javax.annotation.processing.ProcessingEnvironment;
-import javax.annotation.processing.Processor;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
@@ -67,7 +66,7 @@
private static final String SUB_CLASS_JAVA =
"org/richfaces/cdk/apt/TestSubClass.java";
@Mock
- Processor processor;
+ CdkProcessor processor;
@Inject
private TaskFactoryImpl factory;
Modified:
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java
===================================================================
---
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -167,7 +167,7 @@
/**
* Test method for
- * {@link org.richfaces.cdk.apt.CdkProcessor#process(java.util.Set,
javax.annotation.processing.RoundEnvironment)} .
+ * {@link org.richfaces.cdk.apt.CdkProcessorImpl#process(java.util.Set,
javax.annotation.processing.RoundEnvironment)} .
*
* @throws Exception
*/
@@ -185,7 +185,7 @@
/**
* Test method for
- * {@link org.richfaces.cdk.apt.CdkProcessor#process(java.util.Set,
javax.annotation.processing.RoundEnvironment)} .
+ * {@link org.richfaces.cdk.apt.CdkProcessorImpl#process(java.util.Set,
javax.annotation.processing.RoundEnvironment)} .
*
* @throws Exception
*/
@@ -205,7 +205,7 @@
/**
* Test method for
- * {@link org.richfaces.cdk.apt.CdkProcessor#process(java.util.Set,
javax.annotation.processing.RoundEnvironment)} .
+ * {@link org.richfaces.cdk.apt.CdkProcessorImpl#process(java.util.Set,
javax.annotation.processing.RoundEnvironment)} .
*
* @throws Exception
*/
Modified:
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
---
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -33,7 +33,7 @@
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.SubComponent;
+import org.richfaces.cdk.annotations.RendererSpecificComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.test.event.TestEvent;
@@ -53,13 +53,13 @@
fires=TestEvent.class,
interfaces=ValueHolder.class,
components={
- @SubComponent(type = "org.richfaces.cdk.test.TestHtmlAbbr",
+ @RendererSpecificComponent(type =
"org.richfaces.cdk.test.TestHtmlAbbr",
description=@Description(displayName="Test HTML5
abbreviation",largeIcon="large.gif",smallIcon="spall.png"),
tag=(a)Tag(name="abbr",generate=true,handler="org.richfaces.cdk.test.facelets.AbbrTagHandler"),
generate="org.richfaces.cdk.test.component.html.HtmlTestAbbr",
interfaces=Html5Attributes.class,
renderer=(a)JsfRenderer(type="org.richfaces.cdk.test.HtmlAbbrRenderer")),
- @SubComponent(type = "org.richfaces.cdk.test.TestHtmlDfn",
+ @RendererSpecificComponent(type =
"org.richfaces.cdk.test.TestHtmlDfn",
tag=@Tag(name="dfn"),
generate="org.richfaces.cdk.test.component.html.HtmlTestDfn",
attributes="html5.xml")
Modified:
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
---
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-06-21
12:36:34 UTC (rev 17654)
+++
root/cdk/branches/RF8755/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-06-21
22:32:30 UTC (rev 17655)
@@ -51,14 +51,14 @@
/**
* <p class="changed_added_4_0">
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
* @goal generate
* @requiresDependencyResolution compile
* @phase generate-sources
*/
public class GenerateMojo extends AbstractMojo {
- private static final String[] JAVA_INCLUDES = new String[]{"**/*.java"};
+ private static final String[] JAVA_INCLUDES = new String[] { "**/*.java"
};
private static final String MAIN_CONFIG = "src/main/config";
private static final String MAIN_TEMPLATES = "src/main/templates";
private static final String[] STRINGS_ARRAY = new String[0];
@@ -66,7 +66,7 @@
/**
* Project classpath.
- *
+ *
* @parameter expression="${project.compileClasspathElements}"
* @required
* @readonly
@@ -75,7 +75,7 @@
/**
* The source directories containing the sources to be compiled.
- *
+ *
* @parameter expression="${project.compileSourceRoots}"
* @required
* @readonly
@@ -83,10 +83,9 @@
protected List<String> compileSourceRoots;
/**
- * The list of JSF configuration files that will be processed by CDK.
- * By default, CDK looks for all files in the
<code>src/main/config</code> folder
- * with "xml" extension.
- *
+ * The list of JSF configuration files that will be processed by CDK. By default, CDK
looks for all files in the
+ * <code>src/main/config</code> folder with "xml" extension.
+ *
* @parameter
*/
protected FileSet[] facesConfigs;
@@ -103,7 +102,7 @@
/**
* The directory for compiled classes.
- *
+ *
* @parameter expression="${project.build.outputDirectory}"
* @required
* @readonly
@@ -112,14 +111,14 @@
/**
* Directory where the output Java Files will be located.
- *
+ *
* @parameter
expression="${project.build.directory}/generated-sources/main/java"
*/
protected File outputJavaDirectory;
/**
* Directory where the output Java Files will be located.
- *
+ *
* @parameter
expression="${project.build.directory}/generated-sources/main/resources"
*/
protected File outputResourcesDirectory;
@@ -131,40 +130,39 @@
/**
* Directory where the output Java Files will be located.
- *
+ *
* @parameter
expression="${project.build.directory}/generated-sources/test/resources"
*/
protected File outputTestResourcesDirectory;
/**
* Top maven project.
- *
+ *
* @parameter expression="${project}"
* @readonly
*/
protected MavenProject project;
/**
- * List of filename patterns that will be excluded from process by annotations
processor.
- * By default, all *.java files will be processed.
- *
+ * List of filename patterns that will be excluded from process by annotations
processor. By default, all *.java
+ * files will be processed.
+ *
* @parameter
*/
protected String[] sourceExcludes;
/**
- * List of filename patterns that will be included to process by annotations
processor.
- * By default, all *.java files will be processed.
- *
+ * List of filename patterns that will be included to process by annotations
processor. By default, all *.java files
+ * will be processed.
+ *
* @parameter
*/
protected String[] sourceIncludes;
/**
- * The list of JsfRenderer template files that will be processed by CDK.
- * By default, CDK looks for all files in the
<code>src/main/templates</code> folder
- * with "xml" extension.
- *
+ * The list of JsfRenderer template files that will be processed by CDK. By default,
CDK looks for all files in the
+ * <code>src/main/templates</code> folder with "xml"
extension.
+ *
* @parameter
*/
protected FileSet[] templates;
@@ -176,7 +174,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.maven.plugin.Mojo#execute()
*/
@Override
@@ -203,13 +201,11 @@
}
}
-
generator.addSources(Sources.JAVA_SOURCES, findJavaFiles(), folders);
- // TODO - detect templates and configs directories.
+ // detect templates and configs directories.
generator.addSources(Sources.RENDERER_TEMPLATES, findTemplateFiles(), null);
generator.addSources(Sources.FACES_CONFIGS, findFacesConfigFiles(), null);
-
// Setup output folders.
setOutput(generator, outputJavaDirectory, Outputs.JAVA_CLASSES);
setOutput(generator, outputResourcesDirectory, Outputs.RESOURCES);
@@ -226,70 +222,83 @@
}
try {
- if (this.library != null
- && this.library.getTaglib() != null
+ if (this.library != null && this.library.getTaglib() != null
&& this.library.getTaglib().getShortName() != null) {
-
+
generator.setNamespace(this.library.getTaglib().getShortName());
}
// Build JSF library.
-// LibraryBuilder builder = LibraryBuilder.createInstance(context);
+ // LibraryBuilder builder = LibraryBuilder.createInstance(context);
generator.init();
generator.execute();
- if(logger.getErrorCount()>0){
+ if (logger.getErrorCount() > 0) {
throw new MojoFailureException("Errors occurred while JSF library
was built");
}
// Tell project about generated files.
- project.addCompileSourceRoot(outputJavaDirectory.getAbsolutePath());
+ if (outputJavaDirectory.exists()) {
+ project.addCompileSourceRoot(outputJavaDirectory.getAbsolutePath());
- Resource resource = new Resource();
+ }
- resource.setDirectory(outputResourcesDirectory.getAbsolutePath());
- project.addResource(resource);
- project.addTestCompileSourceRoot(outputTestDirectory.getAbsolutePath());
+ if (outputResourcesDirectory.exists()) {
+ Resource resource = new Resource();
- Resource testResource = new Resource();
+ resource.setDirectory(outputResourcesDirectory.getAbsolutePath());
+ project.addResource(resource);
- testResource.setDirectory(outputTestResourcesDirectory.getAbsolutePath());
- project.addTestResource(testResource);
+ }
+ if (outputTestDirectory.exists()) {
+ project.addTestCompileSourceRoot(outputTestDirectory.getAbsolutePath());
+
+ }
+ if (outputTestResourcesDirectory.exists()) {
+ Resource testResource = new Resource();
+
+
testResource.setDirectory(outputTestResourcesDirectory.getAbsolutePath());
+ project.addTestResource(testResource);
+
+ }
} catch (CdkException e) {
throw new MojoExecutionException("CDK build error", e);
}
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @param generator
* @throws MojoFailureException
*/
private void setupPlugins(Generator generator) throws MojoFailureException {
- // TODO - get additional modules, as Maven components ?
+ // TODO - get additional modules, as Maven components ?
}
/**
- * <p class="changed_added_4_0">This utility method sets output
directory for particular type.
- * I such directory does not exist, it is created.</p>
- *
+ * <p class="changed_added_4_0">
+ * This utility method sets output directory for particular type. I such directory
does not exist, it is created.
+ * </p>
+ *
* @param generator
* @param directory
* @param type
*/
private static void setOutput(Generator generator, File directory, Outputs type) {
- if (!directory.exists()) {
- directory.mkdirs();
- }
+ // if (!directory.exists()) {
+ // directory.mkdirs();
+ // }
generator.addOutputFolder(type, directory);
}
-// /**
-// * <p class="changed_added_4_0">This method checks library
configuration and sets default values if necessary.</p>
-// */
-// protected void checkLibraryConfig() {
-//
-// // TODO Auto-generated method stub
-// }
+ // /**
+ // * <p class="changed_added_4_0">This method checks library
configuration and sets default values if necessary.</p>
+ // */
+ // protected void checkLibraryConfig() {
+ //
+ // // TODO Auto-generated method stub
+ // }
private File resolveRelativePath(File file) {
File result = file;
@@ -309,7 +318,7 @@
fileSet.setDirectory(MAIN_TEMPLATES);
fileSet.addInclude(XML_INCLUDES);
- templates = new FileSet[]{fileSet};
+ templates = new FileSet[] { fileSet };
}
}
@@ -323,7 +332,6 @@
for (String compileRoot : compileSourceRoots) {
File rootFolder = new File(compileRoot);
String[] sources = doScan(includes, sourceExcludes, rootFolder);
-
for (String src : sources) {
javaSources.add(new File(rootFolder, src));
}
@@ -341,7 +349,7 @@
fileSet.setDirectory(MAIN_CONFIG);
fileSet.addInclude(XML_INCLUDES);
- facesConfigs = new FileSet[]{fileSet};
+ facesConfigs = new FileSet[] { fileSet };
}
}
@@ -389,7 +397,7 @@
/**
* Skan Array of filesets for selected resources.
- *
+ *
* @param filesets
* @return
* @throws MojoExecutionException