Author: kmorin Date: 2009-04-29 15:41:34 +0000 (Wed, 29 Apr 2009) New Revision: 1366 Modified: guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java Log: log Modified: guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java =================================================================== --- guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java 2009-04-29 15:41:14 UTC (rev 1365) +++ guix/trunk/guix-maven-plugin/src/main/java/org/nuiton/guix/GuixMojo.java 2009-04-29 15:41:34 UTC (rev 1366) @@ -2,7 +2,6 @@ import java.io.File; import java.util.ArrayList; -import org.apache.log4j.Logger; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -15,6 +14,7 @@ */ public class GuixMojo extends AbstractMojo { + /** * Directory of the files to compile. * @parameter expression="${guixFilesDir}" @@ -24,10 +24,16 @@ /** * Directory of the generated files. - * @parameter expression="${generatedFilesDestination}" default-value="generatedFiles" + * @parameter expression="${targetDirectory}" default-value="generatedFiles" */ private String targetDirectory; + /** + * Directory of the generated files. + * @parameter expression="${rootPackage}" default-value="" + */ + private String rootPackage; + @Override public void execute() throws MojoExecutionException, MojoFailureException { GuixInitializer.initialize(); @@ -40,25 +46,25 @@ if(guixFilesDir.exists() && guixFilesDir.isDirectory()) { ArrayList<File> guixFiles = goDeeperInto(guixFilesDir); - GuixLauncher gcl = new GuixLauncher(guixFiles.toArray(new File[guixFiles.size()]),targetDirectory); + GuixLauncher gcl = new GuixLauncher(guixFiles.toArray( + new File[guixFiles.size()]),targetDirectory,rootPackage,guixFilesDir); boolean result = gcl.compile(); - if(result) - Logger.getLogger(GuixMojo.class).info("Compilation succeeded !"); + getLog().info("Compilation succeeded !"); else - Logger.getLogger(GuixMojo.class).error("Compilation failed..."); + getLog().error("Compilation failed..."); } } private ArrayList<File> goDeeperInto(File dir) { - Logger.getLogger(GuixMojo.class).debug("goind deeper into " + dir.getPath()); + getLog().debug("goind deeper into " + dir.getPath()); ArrayList<File> result = new ArrayList<File>(); for(File f : dir.listFiles()) { if(f.isDirectory() && !f.isHidden()) { result.addAll(goDeeperInto(f)); } else if(f.getName().endsWith(".guix")) { - Logger.getLogger(GuixMojo.class).debug("found " + f.getName()); + getLog().debug("found " + f.getName()); result.add(f); } }