Commits

Stephen McKamey committed fa95fe9

- moving to generate-sources phase
- adding better default locations
- fixing javadocs

Comments (0)

Files changed (3)

 relre:/*/*.iml
 relre:/*/*.ipr
 relre:/*/*.iws
+relre:/*/.DS_Store

duel/duel-maven-plugin/pom.xml

 		</dependency>
 		<dependency>
 			<groupId>org.apache.maven</groupId>
+			<artifactId>maven-core</artifactId>
+			<version>[2.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.maven</groupId>
 			<artifactId>maven-plugin-api</artifactId>
-			<version>2.0</version>
+			<version>[2.0,)</version>
 		</dependency>
 		<dependency>
 			<groupId>junit</groupId>

duel/duel-maven-plugin/src/main/java/org/duelengine/duel/maven/DuelMojo.java

 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
 import org.duelengine.duel.compiler.*;
 
 /**
- * Goal which touches a timestamp file.
+ * Compiles client-side and server-side templates.
  *
- * @goal compile
- * @phase process-sources
+ * @goal run
+ * @phase generate-sources
  */
 public class DuelMojo extends AbstractMojo {
 
 	// http://maven.apache.org/ref/3.0.2/maven-model/maven.html#class_build
 
 	/**
-	 * Location of the file.
-	 * @parameter expression="${project.build.sourceDirectory}"
+	 * The project currently being built.
+	 * 
+	 * @parameter default-value="${project}"
 	 * @required
+	 * @readonly
+	 */
+	private MavenProject project;
+
+	/**
+	 * Location of the template files.
+	 * 
+	 * @parameter default-value="${project.build.sourceDirectory}"
 	 */
 	private String inputRoot;
 
 	/**
-	 * Location of the file.
-	 * @parameter expression="${project.build.sourceDirectory}"
-	 * @required
+	 * Location of the generated client-side templates.
+	 * 
+	 * @parameter default-value="${project.build.directory}/generated-sources/duel/"
 	 */
 	private String outputClientFolder;
 
 	/**
-	 * Location of the file.
-	 * @parameter expression="${project.build.sourceDirectory}"
-	 * @required
+	 * Location of the generated server-side templates.
+	 * 
+	 * @parameter default-value="${project.build.directory}/generated-sources/duel/"
 	 */
 	private String outputServerFolder;
 
 	/**
-	 * Client-side package prefix
+	 * Client-side template package prefix
+	 * 
 	 * @parameter
 	 */
 	private String clientPrefix;
 
 	/**
-	 * Server-side class package prefix
+	 * Server-side template class package prefix
+	 * 
 	 * @parameter
 	 */
 	private String serverPrefix;
         throws MojoExecutionException {
 
 	    Log log = this.getLog();
-	    /*
 	    log.info("\tinputRoot="+this.inputRoot);
 	    log.info("\toutputClientFolder="+this.outputClientFolder);
 	    log.info("\toutputServerFolder="+this.outputServerFolder);
 	    log.info("\tclientPrefix="+this.clientPrefix);
 	    log.info("\tserverPrefix="+this.serverPrefix);
-	    */
 
 	    DuelCompiler compiler = new DuelCompiler();
 	    compiler.setInputRoot(this.inputRoot);
 	    try {
 		    compiler.execute();
 
+		    this.project.addCompileSourceRoot(compiler.getOutputServerFolder()); 
+
 	    } catch (IOException e) {
 		    log.error(e);
 	    }