Index: src/main/java/org/codehaus/mojo/gwt/shell/CompileMojo.java =================================================================== --- src/main/java/org/codehaus/mojo/gwt/shell/CompileMojo.java (revision 10045) +++ src/main/java/org/codehaus/mojo/gwt/shell/CompileMojo.java (working copy) @@ -76,7 +76,79 @@ * @parameter default-value="false" */ private boolean enableAssertions; + + /** + * Logs output in a graphical tree view. + *
+ * Can be set from command line using '-Dgwt.treeLogger=true'. + * + * @parameter default-value="false" expression="${gwt.treeLogger}" + */ + private boolean treeLogger = false; + /** + * EXPERIMENTAL: Disables some java.lang.Class methods (e.g. getName()). + *
+ * Can be set from command line using '-Dgwt.disableClassMetadata=true'. + * + * @parameter default-value="false" expression="${gwt.disableClassMetadata}" + */ + private boolean disableClassMetadata = false; + + /** + * EXPERIMENTAL: Disables run-time checking of cast operations. + *
+ * Can be set from command line using '-Dgwt.disableCastChecking=true'. + * + * @parameter default-value="false" expression="${gwt.disableCastChecking}" + */ + private boolean disableCastChecking = false; + + /** + * Ask GWT to create the Story of Your Compile (SOYC). + *
+ * Can be set from command line using '-Dgwt.soyc=true'. + * + * @parameter default-value="false" expression="${gwt.soyc}" + */ + private boolean soyc = false; + + /** + * Validate all source code, but do not compile. + *
+ * Can be set from command line using '-Dgwt.validateOnly=true'. + * + * @parameter default-value="false" expression="${gwt.validateOnly}" + */ + private boolean validateOnly = false; + + /** + * Enable faster, but less-optimized, compilations. + *
+ * Can be set from command line using '-Dgwt.draftCompile=true'. + * + * @parameter default-value="false" expression="${gwt.draftCompile}" + */ + private boolean draftCompile = false; + + /** + * The compiler work directory (must be writeable; defaults to a system temp dir). + *
+ * Can be set from command line using '-Dgwt.workDir=path'. + * + * @parameter default-value="${project.build.directory}/workDir" expression="${gwt.workDir}" + */ + private File workDir; + + /** + * The directory into which extra, non-deployed files will be written. + *
+ * Can be set from command line using '-Dgwt.extra=path'. + * + * @parameter default-value="${project.build.directory}/extra" expression="${gwt.extra}" + */ + private File extra; + public void doExecute( GwtRuntime runtime ) throws MojoExecutionException, MojoFailureException { @@ -128,6 +200,31 @@ cmd.arg( "-localWorkers" ) .arg( String.valueOf( getLocalWorkers() ) ); } + + // version specific parameters + switch ( runtime.getVersion() ) + { + case TWO_DOT_ZERO: + cmd.arg(soyc, "-soyc") + .arg(draftCompile, "-draftCompile") + .arg(validateOnly,"-validateOnly") + .arg(treeLogger, "-treeLogger") + // NOTE: experimental in GWT 2.0.0-SNAPSHOT + .arg(disableClassMetadata, "-XdisableClassMetadata") + // NOTE: experimental in GWT 2.0.0-SNAPSHOT + .arg(disableCastChecking, "-XdisableCastChecking"); + if (!workDir.exists() && workDir.mkdirs()) { + cmd.arg("-workDir") + .arg(workDir.getAbsolutePath()); + } + if (!extra.exists() && extra.mkdirs()) { + cmd.arg("-extra") + .arg(extra.getAbsolutePath()); + } + + default: + } + for ( String target : modules ) { if ( !compilationRequired( target, getOutputDirectory() ) ) @@ -138,6 +235,7 @@ cmd.arg( target ); upToDate = false; } + if ( !upToDate ) { cmd.execute(); Index: src/main/java/org/codehaus/mojo/gwt/GwtVersion.java =================================================================== --- src/main/java/org/codehaus/mojo/gwt/GwtVersion.java (revision 10045) +++ src/main/java/org/codehaus/mojo/gwt/GwtVersion.java (working copy) @@ -33,6 +33,9 @@ , ONE_DOT_SIX( true, "com.google.gwt.dev.HostedMode", "com.google.gwt.dev.Compiler", EmbeddedServer.JETTY, true, true, "-war" ) + , TWO_DOT_ZERO( true, "com.google.gwt.dev.HostedMode", "com.google.gwt.dev.Compiler", EmbeddedServer.JETTY, + true, true, "-war" ) + , FUTURE( true, "com.google.gwt.dev.HostedMode", "com.google.gwt.dev.Compiler", EmbeddedServer.JETTY, true, true, "-war" ); @@ -51,6 +54,10 @@ { return ONE_DOT_SIX; } + if ( version.startsWith( "2.0" ) ) + { + return TWO_DOT_ZERO; + } return FUTURE; }