Commits

Stephen McKamey  committed ff70ab8

- modifying naming for consistency

  • Participants
  • Parent commits fa95fe9

Comments (0)

Files changed (3)

File duel/duel-compiler/src/main/java/org/duelengine/duel/compiler/DuelCompiler.java

 		}
 
 		DuelCompiler compiler = new DuelCompiler();
-		compiler.setInputRoot(args[0]);
+		compiler.setInputFolder(args[0]);
 
 		if (args.length > 1) {
 			compiler.setOutputClientFolder(args[1]);
 	}
 
 	private boolean verbose;
-	private File inputRoot;
+	private File inputFolder;
 	private File outputClientFolder;
 	private File outputServerFolder;
 	private String clientPrefix;
 	private String serverPrefix;
 
-	public String getInputRoot() {
-		return this.inputRoot.getAbsolutePath();
+	public String getInputFolder() {
+		return this.inputFolder.getAbsolutePath();
 	}
 
-	public void setInputRoot(String value) {
-		this.inputRoot = (value != null) ? new File(value.replace('\\', '/')) : null;
+	public void setInputFolder(String value) {
+		this.inputFolder = (value != null) ? new File(value.replace('\\', '/')) : null;
 	}
 
 	public String getOutputClientFolder() {
 	}
 
 	private boolean ensureSettings() {
-		if (this.inputRoot == null || !this.inputRoot.exists()) {
-			System.err.println("Error: no input files found: "+this.inputRoot);
-			return false;
+		if (this.inputFolder == null || !this.inputFolder.exists()) {
+			throw new IllegalArgumentException("Error: no input files found: "+this.inputFolder);
 		}
 
 		if (this.outputClientFolder == null) {
-			this.outputClientFolder = this.inputRoot.getParentFile();
+			this.outputClientFolder = this.inputFolder.getParentFile();
 		}
 
 		if (this.outputServerFolder == null) {
-			this.outputServerFolder = this.inputRoot.getParentFile();
+			this.outputServerFolder = this.inputFolder.getParentFile();
 		}
 
 		return true;
 			return;
 		}
 
-		List<File> inputFiles = findFiles(this.inputRoot);
+		List<File> inputFiles = findFiles(this.inputFolder);
 		if (inputFiles.size() < 1) {
-			System.err.println("this.inputRoot.getAbsolutePath(): Error: no input files found");
-			return;
+			throw new IllegalArgumentException("this.inputFolder.getAbsolutePath(): Error: no input files found");
 		}
 
 		for (File inputFile : inputFiles) {
 			}
 
 			if (views == null || views.size() < 1) {
-				System.err.println(inputFile.getAbsolutePath()+": Syntax error: no view found");
-				return;
+				throw new IllegalArgumentException(inputFile.getAbsolutePath()+": Syntax error: no view found");
 			}
 
 			// TODO: allow setting of more properties from args
 		}
 	}
 
-	private static List<File> findFiles(File inputRoot) {
+	private static List<File> findFiles(File inputFolder) {
 
 		List<File> files = new ArrayList<File>();
 		Queue<File> folders = new LinkedList<File>();
-		folders.add(inputRoot);
+		folders.add(inputFolder);
 
 		while (!folders.isEmpty()) {
 			File file = folders.poll();

File duel/duel-maven-plugin/pom.xml

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

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

 /**
  * Compiles client-side and server-side templates.
  *
- * @goal run
+ * @goal compile
  * @phase generate-sources
  */
 public class DuelMojo extends AbstractMojo {
 	 * 
 	 * @parameter default-value="${project.build.sourceDirectory}"
 	 */
-	private String inputRoot;
+	private String inputFolder;
 
 	/**
 	 * Location of the generated client-side templates.
         throws MojoExecutionException {
 
 	    Log log = this.getLog();
-	    log.info("\tinputRoot="+this.inputRoot);
+	    log.info("\tinputFolder="+this.inputFolder);
 	    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);
+	    compiler.setInputFolder(this.inputFolder);
 
 	    if (this.outputClientFolder != null && !this.outputClientFolder.isEmpty()) {
 		    compiler.setOutputClientFolder(this.outputClientFolder);