Added new properties to ProjectConfiguration

Change-Id: I8f85cf4aff6f30a126d11847df541b4e5bfad352
diff --git a/src/main/java/com/google/gwt/benchmark/project/ProjectConfiguration.java b/src/main/java/com/google/gwt/benchmark/project/ProjectConfiguration.java
index 5d7db7f..b43c451 100644
--- a/src/main/java/com/google/gwt/benchmark/project/ProjectConfiguration.java
+++ b/src/main/java/com/google/gwt/benchmark/project/ProjectConfiguration.java
@@ -40,10 +40,28 @@
   private static final String GWT_ENTRY_POINT_PROPERTY = "gwt.compiler.entrypoint";
   private static final String GWT_OPTS_PROPERTY = "gwt.opts";
   private static final String JVM_OPTS_PROPERTY = "jvm.opts";
-  private static final String OUT_JAR = "out.jar";
   private static final String AUX_JAR = "aux.jar";
+  private static final String OUT_JAR = "out.jar";
   private static final String PROJECT_JAR_PATH = "input_jars";
   private static final String TARGET_MODULE_PROPERTY = "module";
+  private static final String OUTPUT_PATH_PROPERTY = "output.path";
+
+  /**
+   * Loads all project configurations.
+   */
+  public static List<ProjectConfiguration> getProjectConfigurations(String workdir) {
+    List<ProjectConfiguration> projectConfigurations = Lists.newArrayList();
+    File projectsDir = new File(workdir + "/projects");
+    String[] contents = projectsDir.list();
+    for (String projectDir : contents) {
+      ProjectConfiguration projectConfiguration =
+          getProjectConfiguration(projectsDir.getPath(), projectDir);
+      if (projectConfiguration != null) {
+        projectConfigurations.add(projectConfiguration);
+      }
+    }
+    return projectConfigurations;
+  }
 
   /**
    * Loads a project configuration from disk.
@@ -72,6 +90,8 @@
       }
       projectConfiguration.setTargetModule(targetModule);
       projectConfiguration.setPath(projectPath);
+      projectConfiguration.setOutputPath(projectProperties.getProperty(OUTPUT_PATH_PROPERTY,
+          targetModule));
 
       // Determine the input jars for this project.
       File projectJarPath = new File(projectPath + "/" + PROJECT_JAR_PATH);
@@ -88,30 +108,14 @@
     return projectConfiguration;
   }
 
-  /**
-   * Loads all project configurations.
-   */
-  public static List<ProjectConfiguration> getProjectConfigurations(String workdir) {
-    List<ProjectConfiguration> projectConfigurations = Lists.newArrayList();
-    File projectsDir = new File(workdir + "/projects");
-    String[] contents = projectsDir.list();
-    for (String projectDir : contents) {
-      ProjectConfiguration projectConfiguration =
-          getProjectConfiguration(projectsDir.getPath(), projectDir);
-      if (projectConfiguration != null) {
-        projectConfigurations.add(projectConfiguration);
-      }
-    }
-    return projectConfigurations;
-  }
-
   private String compilerEntryPoint;
   private String gwtCommandLineOpts;
+  private final List<String> inputJars = Lists.newArrayList();
   private String javaCommandLineOpts;
   private final String name;
+  private String outputPath;
   private String path;
   private String targetModule;
-  private final List<String> inputJars = Lists.newArrayList();
 
   /**
    * Constructs a project configuration.
@@ -122,6 +126,13 @@
   }
 
   /**
+   * Returns the compiler entrypoint to be used for this project.
+   */
+  public final String getCompilerEntryPoint() {
+    return compilerEntryPoint;
+  }
+
+  /**
    * Returns the complete command line required to compile this project.
    */
   public String getCompleteCommandLine(String outDir, List<String> extraJars) {
@@ -142,13 +153,6 @@
   }
 
   /**
-   * Returns the compiler entrypoint to be used for this project.
-   */
-  public final String getCompilerEntryPoint() {
-    return compilerEntryPoint;
-  }
-
-  /**
    * Returns the project gwt command line options.
    */
   public final String getGwtCommandLineOpts() {
@@ -170,6 +174,13 @@
   }
 
   /**
+   * @return the outputPath
+   */
+  public final String getOutputPath() {
+    return outputPath;
+  }
+
+  /**
    * Returns the project path.
    */
   public final String getPath() {
@@ -207,6 +218,13 @@
   }
 
   /**
+   * @param outputPath the outputPath to set
+   */
+  public final void setOutputPath(String outputPath) {
+    this.outputPath = outputPath;
+  }
+
+  /**
    * Sets the project path.
    */
   public final void setPath(String path) {
diff --git a/src/test/java/com/google/gwt/benchmark/project/ProjectConfigurationTest.java b/src/test/java/com/google/gwt/benchmark/project/ProjectConfigurationTest.java
index 777007f..d4e2f1d 100644
--- a/src/test/java/com/google/gwt/benchmark/project/ProjectConfigurationTest.java
+++ b/src/test/java/com/google/gwt/benchmark/project/ProjectConfigurationTest.java
@@ -73,6 +73,7 @@
     assertEquals("-draftCompile", projectConfiguration.getGwtCommandLineOpts());
     assertEquals("com.dummy.Compiler", projectConfiguration.getCompilerEntryPoint());
     assertEquals("com.target.Target", projectConfiguration.getTargetModule());
+    assertEquals("com.target.Target", projectConfiguration.getOutputPath());
     assertEquals("src/test/resources/workdir/projects/p1", projectConfiguration.getPath());
     assertEquals(
         "java -cp gwt-user.jar:gwt-dev.jar -Dtest com.dummy.Compiler "
@@ -109,6 +110,7 @@
     assertEquals("", projectConfiguration.getGwtCommandLineOpts());
     assertEquals("com.google.gwt.dev.Compiler", projectConfiguration.getCompilerEntryPoint());
     assertEquals("p2target", projectConfiguration.getTargetModule());
+    assertEquals("p2target_out", projectConfiguration.getOutputPath());
     assertEquals("src/test/resources/workdir/projects/p2", projectConfiguration.getPath());
     assertEquals(
         "java -cp gwt-user.jar:gwt-dev.jar com.google.gwt.dev.Compiler p2target -war outdir/out.jar"
diff --git a/src/test/resources/workdir/projects/p2/project.config b/src/test/resources/workdir/projects/p2/project.config
index e20bb05..799703b 100644
--- a/src/test/resources/workdir/projects/p2/project.config
+++ b/src/test/resources/workdir/projects/p2/project.config
@@ -1 +1,2 @@
-module=p2target
\ No newline at end of file
+module=p2target
+output.path=p2target_out
\ No newline at end of file
diff --git a/src/test/resources/workdir/projects/showcase/project.config b/src/test/resources/workdir/projects/showcase/project.config
index 45c9852..b9acd11 100644
--- a/src/test/resources/workdir/projects/showcase/project.config
+++ b/src/test/resources/workdir/projects/showcase/project.config
@@ -1,3 +1,4 @@
 jvm.opts=-Xmx1536m -Xss4m -XX:-UseSplitVerifier -client -XX:ErrorFile=/dev/stderr -XX:-UseSplitVerifier -Dgwt.persistentunitcache=false
 gwt.opts=-optimize 0 -style pretty 
 module=com.google.gwt.sample.showcase.Showcase
+output.path=showcase