Revision: 1030
Author: kebernet
Date: Sun Jul 1 10:08:58 2012
Log: Super Dev Mode
http://code.google.com/p/gwt-maven/source/detail?r=1030
Added:
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/SuperDevModeMojo.java
Modified:
/trunk/maven-googlewebtoolkit2-plugin/pom.xml
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/AbstractGWTMojo.java
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/scripting/ScriptWriterUnix20.java
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/scripting/ScriptWriterWindows20.java
=======================================
--- /dev/null
+++
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/SuperDevModeMojo.java
Sun Jul 1 10:08:58 2012
@@ -0,0 +1,49 @@
+package com.totsp.mavenplugin.gwt;
+
+import com.totsp.mavenplugin.gwt.scripting.ScriptUtil;
+import com.totsp.mavenplugin.gwt.scripting.ScriptWriter;
+import com.totsp.mavenplugin.gwt.scripting.ScriptWriterFactory;
+import java.io.File;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Runs the the project in the GWTShell for development.
+ *
+ * Note that this goal is intended to be explicitly run from the command
line
+ * (execute phase=), whereas other GWT-Maven goals are not (others happen
as
+ * part of the standard Maven life-cycle
phases: "compile" "test" "install").
+ *
+ * @goal codeserver
+ * @execute phase=install
+ * @requiresDependencyResolution compile
+ * @description Runs the the project in the GWTShell for development.
+ *
+ * @author kebernet
+ */
+public class SuperDevModeMojo extends AbstractGWTMojo {
+
+ /** Creates a new instance of GWTMojo */
+ public SuperDevModeMojo() {
+ super();
+ }
+
+ public void execute() throws MojoExecutionException,
MojoFailureException {
+
+ try {
+ this.makeCatalinaBase();
+ } catch (Exception e) {
+ throw new MojoExecutionException("Unable to build
catalina.base", e);
+ }
+ if (!this.getOutput().exists()) {
+ this.getOutput().mkdirs();
+ }
+
+ // build it for the correct platform
+ ScriptWriter writer = ScriptWriterFactory.getInstance(this);
+ File exec = writer.writeRunScript(this);
+
+ // run it
+ ScriptUtil.runScript(exec);
+ }
+}
=======================================
--- /trunk/maven-googlewebtoolkit2-plugin/pom.xml Sun Jul 1 07:48:34 2012
+++ /trunk/maven-googlewebtoolkit2-plugin/pom.xml Sun Jul 1 10:08:58 2012
@@ -5,7 +5,7 @@
<groupId>com.totsp.gwt</groupId>
<artifactId>maven-googlewebtoolkit2-plugin</artifactId>
<packaging>maven-plugin</packaging>
- <version>2.0-b2</version>
+ <version>2.0-b3</version>
<description>Maven 2 Plugin for the Google Web Toolkit</description>
<name>Maven 2 Plugin for the Google Web Toolkit</name>
<url>
http://code.google.com/p/gwt-maven</url>
=======================================
---
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/AbstractGWTMojo.java
Tue Nov 2 19:42:01 2010
+++
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/AbstractGWTMojo.java
Sun Jul 1 10:08:58 2012
@@ -283,6 +283,14 @@
* @required
*/
private String[] compileTarget;
+
+ /**
+ * List of GWT module names that should be compiled with the GWT
compiler.
+ *
+ * @parameter property="codeserverTargets"
+ * @required
+ */
+ private String[] codeserverTargets;
/**
* Top level (root) of classes to begin generation from.
@@ -442,6 +450,13 @@
* @parameter default-value="8888"
*/
private int port;
+
+ /**
+ * Runs the embedded GWT Code server on the specified port.
+ *
+ * @parameter default-value="9876"
+ */
+ private int codeserverPort;
// ctor
@@ -486,6 +501,22 @@
public String[] getCompileTarget() {
return this.compileTarget;
}
+
+ public String[] getCodeserverTargets(){
+ return this.codeserverTargets;
+ }
+
+ public void setCodeserverTargets(String[] targets){
+ this.codeserverTargets = targets;
+ }
+
+ public int getCodeserverPort(){
+ return this.codeserverPort;
+ }
+
+ public void setCodeserverPort(int port){
+ this.codeserverPort = port;
+ }
public void setCompileTargets(String[] targets) {
this.compileTarget = targets;
=======================================
---
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/scripting/ScriptWriterUnix20.java
Tue Nov 2 19:42:01 2010
+++
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/scripting/ScriptWriterUnix20.java
Sun Jul 1 10:08:58 2012
@@ -2,114 +2,42 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
-
package com.totsp.mavenplugin.gwt.scripting;
import com.totsp.mavenplugin.gwt.AbstractGWTMojo;
import com.totsp.mavenplugin.gwt.DebugMojo;
+import com.totsp.mavenplugin.gwt.SuperDevModeMojo;
import com.totsp.mavenplugin.gwt.util.BuildClasspathUtil;
import com.totsp.mavenplugin.gwt.util.DependencyScope;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.HiddenFileFilter;
+import org.apache.commons.io.filefilter.WildcardFileFilter;
+
+import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import org.codehaus.plexus.util.StringUtils;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
+
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.filefilter.HiddenFileFilter;
-import org.apache.commons.io.filefilter.WildcardFileFilter;
-import org.apache.maven.artifact.DependencyResolutionRequiredException;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.codehaus.plexus.util.StringUtils;
/**
*
* @author kebernet
*/
-public class ScriptWriterUnix20 implements ScriptWriter16 {
-
- /** Creates a new instance of ScriptWriterUnix */
- public ScriptWriterUnix20() {
- }
-
+public class ScriptWriterUnix20 implements ScriptWriter16 {
/**
- * Write run script.
- *
- * @param mojo The Mojo calling this (contianing config parametersd)
- * @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
+ * Creates a new instance of ScriptWriterUnix
*/
- public File writeRunScript(AbstractGWTMojo mojo) throws
MojoExecutionException {
- String filename = (mojo instanceof
DebugMojo) ? "debug.sh" : "run.sh";
- File file = new File(mojo.getBuildDir(), filename);
- PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
DependencyScope.RUNTIME);
-
- String extra = (mojo.getExtraJvmArgs() != null) ?
mojo.getExtraJvmArgs() : "";
-
- writer.print("\"" + mojo.getJavaCommand() + "\" " + extra + " -cp
$CP ");
-
- if (mojo instanceof DebugMojo) {
- writer.print(" -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,address=");
- writer.print(mojo.getDebugPort());
-
writer.print(mojo.isDebugSuspend() ? ",suspend=y " : ",suspend=n ");
- }
-
- writer.print(" com.google.gwt.dev.DevMode");
- if(mojo.getServer() != null){
- writer.print( " -server ");
- writer.print(mojo.getServer());
- writer.print(" ");
- }
- writer.print(" -logLevel ");
- writer.print(mojo.getLogLevel());
- if (mojo.isEnableAssertions()) {
- writer.print(" -ea ");
- }
-
- if ((mojo.isShowTreeLogger())) {
- writer.print(" -treeLogger ");
- }
-
-// writer.print(" -workDir ");
-// mojo.getWorkDir().mkdirs();
-// writer.print(mojo.getWorkDir().getAbsolutePath());
-// writer.print(" -extra ");
-// mojo.getExtraDir().mkdirs();
-// writer.print(mojo.getExtraDir());
- writer.print(" -war ");
- writer.print("\"" + mojo.getOutput().getAbsolutePath() + "\" ");
- writer.print(" -port ");
- writer.print(Integer.toString(mojo.getPort()));
-
- if (mojo.isNoServer()) {
- writer.print(" -noserver ");
- }
-
- if ((mojo.getWhitelist() != null) && (mojo.getWhitelist().length()
> 0)) {
- writer.print(" -whitelist \"");
- writer.print(mojo.getWhitelist());
- writer.print("\" ");
- }
-
- if ((mojo.getBlacklist() != null) && (mojo.getBlacklist().length()
> 0)) {
- writer.print(" -blacklist \"");
- writer.print(mojo.getBlacklist());
- writer.print("\" ");
- }
-
- writer.print(" -startupUrl " + mojo.getRunTarget());
- writer.print(" ");
- writer.print(mojo.getCompileTarget()[0]);
- writer.println();
-
- writer.flush();
- writer.close();
-
- this.chmodUnixFile(file);
-
- return file;
+ public ScriptWriterUnix20() {
}
/**
@@ -117,109 +45,69 @@
*
* @param mojo The Mojo calling this (contianing config parametersd)
* @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
*/
- public File writeCompileScript(AbstractGWTMojo mojo) throws
MojoExecutionException {
+ public File writeCompileScript(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
return this.writeCompilerInvocationScript(mojo, false);
}
-
- /**
- * Write compile script.
- *
- * @param mojo The Mojo calling this (contianing config parametersd)
- * @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
- */
- protected File writeCompilerInvocationScript(AbstractGWTMojo mojo,
boolean validateOnly)
- throws MojoExecutionException {
- File file = new File(mojo.getBuildDir(),
validateOnly ? "validate.sh" : "compile.sh");
- PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
DependencyScope.COMPILE);
-
- String extra = (mojo.getExtraJvmArgs() != null) ?
mojo.getExtraJvmArgs() : "";
-
-
- writer.print("\"" + mojo.getJavaCommand() + "\" " + extra + " -cp
\"$CP\" ");
- writer.print(" com.google.gwt.dev.Compiler ");
- writer.print(" -gen ");
- writer.print(mojo.getGen().getAbsolutePath());
- writer.print(" -logLevel ");
- writer.print(mojo.getLogLevel());
- writer.print(" -style ");
- writer.print(mojo.getStyle());
-
- if (mojo.isEnableAssertions()) {
- writer.print(" -ea ");
- }
-
- if ((mojo.isShowTreeLogger())) {
- writer.print(" -treeLogger ");
- }
-
- writer.print(" -workDir ");
- writer.print(mojo.getWorkDir().getAbsolutePath());
- writer.print(" -extra ");
- writer.print(mojo.getExtraDir());
- writer.print(" -war ");
- writer.print("\"" + mojo.getOutput().getAbsolutePath() + "\"");
- writer.print(" -localWorkers ");
- writer.print(mojo.getLocalWorkers());
- writer.print(" ");
- for (String target : mojo.getCompileTarget()) {
- writer.print(target);
- writer.print(" ");
- }
-
- writer.println();
-
- writer.flush();
- writer.close();
-
- this.chmodUnixFile(file);
-
- return file;
- }
/**
* Write i18n script.
*
*/
- public File writeI18nScript(AbstractGWTMojo mojo) throws
MojoExecutionException {
+ public File writeI18nScript(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
File file = new File(mojo.getBuildDir(), "i18n.sh");
if (!file.exists()) {
- if (mojo.getLog().isDebugEnabled()) {
- mojo.getLog().debug("File '" + file.getAbsolutePath() + "'
does not exsists, trying to create.");
+ if (mojo.getLog()
+ .isDebugEnabled()) {
+ mojo.getLog()
+ .debug("File '" + file.getAbsolutePath()
+ + "' does not exsists, trying to create.");
}
try {
- file.getParentFile().mkdirs();
+ file.getParentFile()
+ .mkdirs();
file.createNewFile();
- if (mojo.getLog().isDebugEnabled()) {
- mojo.getLog().debug("New file '" +
file.getAbsolutePath() + "' created.");
+ if (mojo.getLog()
+ .isDebugEnabled()) {
+ mojo.getLog()
+ .debug("New file '" + file.getAbsolutePath()
+ + "' created.");
}
} catch (Exception exe) {
- mojo.getLog().error(
- "Couldn't create file '" + file.getAbsolutePath()
+ "'. Reason: " + exe.getMessage(), exe);
+ mojo.getLog()
+ .error("Couldn't create file '" +
file.getAbsolutePath()
+ + "'. Reason: " + exe.getMessage(), exe);
}
}
- PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
DependencyScope.COMPILE);
+ PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
+ DependencyScope.COMPILE);
// constants
if (mojo.getI18nConstantsNames() != null) {
for (String target : mojo.getI18nConstantsNames()) {
- String extra = (mojo.getExtraJvmArgs() != null) ?
mojo.getExtraJvmArgs() : "";
-
- if (AbstractGWTMojo.OS_NAME.startsWith("mac") &&
(extra.indexOf("-XstartOnFirstThread") == -1)) {
+ String extra = (mojo.getExtraJvmArgs() != null)
+ ? mojo.getExtraJvmArgs() : "";
+
+ if (AbstractGWTMojo.OS_NAME.startsWith("mac")
+ && (extra.indexOf("-XstartOnFirstThread") == -1)) {
extra = "-XstartOnFirstThread " + extra;
}
- writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ " -cp \"$CP\" ");
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ + " -cp \"$CP\" ");
writer.print(" com.google.gwt.i18n.tools.I18NSync");
writer.print(" -out ");
writer.print(mojo.getI18nOutputDir());
- writer.print(mojo.isI18nConstantsWithLookup() ? "
-createConstantsWithLookup " : " ");
+ writer.print(mojo.isI18nConstantsWithLookup()
+ ? " -createConstantsWithLookup " : " ");
writer.print(target);
writer.println();
}
@@ -228,13 +116,16 @@
// messages
if (mojo.getI18nMessagesNames() != null) {
for (String target : mojo.getI18nMessagesNames()) {
- String extra = (mojo.getExtraJvmArgs() != null) ?
mojo.getExtraJvmArgs() : "";
-
- if (AbstractGWTMojo.OS_NAME.startsWith("mac") &&
(extra.indexOf("-XstartOnFirstThread") == -1)) {
+ String extra = (mojo.getExtraJvmArgs() != null)
+ ? mojo.getExtraJvmArgs() : "";
+
+ if (AbstractGWTMojo.OS_NAME.startsWith("mac")
+ && (extra.indexOf("-XstartOnFirstThread") == -1)) {
extra = "-XstartOnFirstThread " + extra;
}
- writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ " -cp \"$CP\" ");
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ + " -cp \"$CP\" ");
writer.print(" com.google.gwt.i18n.tools.I18NSync");
writer.print(" -createMessages ");
writer.print(" -out ");
@@ -252,15 +143,126 @@
return file;
}
+
+ /**
+ * Write run script.
+ *
+ * @param mojo The Mojo calling this (contianing config parametersd)
+ * @return the script file that was written.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
+ */
+ public File writeRunScript(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
+ String filename = (mojo instanceof DebugMojo) ? "debug.sh"
+ : ((mojo instanceof
SuperDevModeMojo)
+ ? "codeserver.cmd" : "run.cmd");
+
+ File file = new File(mojo.getBuildDir(), filename);
+ PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
+ DependencyScope.RUNTIME);
+
+ String extra = (mojo.getExtraJvmArgs() != null)
+ ? mojo.getExtraJvmArgs() : "";
+
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra + " -cp
$CP ");
+
+ if (mojo instanceof DebugMojo) {
+ writer.print(
+ " -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,address=");
+ writer.print(mojo.getDebugPort());
+
writer.print(mojo.isDebugSuspend() ? ",suspend=y " : ",suspend=n ");
+ }
+
+ if (mojo instanceof SuperDevModeMojo) {
+ writer.print(" com.google.gwt.dev.codeserver.CodeServer ");
+ writer.print(" -port ");
+ writer.print(Integer.toString(mojo.getCodeserverPort()));
+ writer.print(" -workDir ");
+ writer.print(mojo.getWorkDir());
+ writer.print(" -src ./src/main/java");
+
+ for (String s : mojo.getCodeserverTargets()) {
+ writer.print(" ");
+ writer.print(s);
+ }
+ } else {
+ writer.print(" com.google.gwt.dev.DevMode");
+
+ if (mojo.getServer() != null) {
+ writer.print(" -server ");
+ writer.print(mojo.getServer());
+ writer.print(" ");
+ }
+
+ writer.print(" -logLevel ");
+ writer.print(mojo.getLogLevel());
+
+ if (mojo.isEnableAssertions()) {
+ writer.print(" -ea ");
+ }
+
+ if ((mojo.isShowTreeLogger())) {
+ writer.print(" -treeLogger ");
+ }
+
+ // writer.print(" -workDir ");
+ // mojo.getWorkDir().mkdirs();
+ // writer.print(mojo.getWorkDir().getAbsolutePath());
+ // writer.print(" -extra ");
+ // mojo.getExtraDir().mkdirs();
+ // writer.print(mojo.getExtraDir());
+ writer.print(" -war ");
+ writer.print("\"" + mojo.getOutput().getAbsolutePath()
+ "\" ");
+ writer.print(" -port ");
+ writer.print(Integer.toString(mojo.getPort()));
+
+ if (mojo.isNoServer()) {
+ writer.print(" -noserver ");
+ }
+
+ if ((mojo.getWhitelist() != null)
+ && (mojo.getWhitelist()
+ .length() > 0)) {
+ writer.print(" -whitelist \"");
+ writer.print(mojo.getWhitelist());
+ writer.print("\" ");
+ }
+
+ if ((mojo.getBlacklist() != null)
+ && (mojo.getBlacklist()
+ .length() > 0)) {
+ writer.print(" -blacklist \"");
+ writer.print(mojo.getBlacklist());
+ writer.print("\" ");
+ }
+
+ writer.print(" -startupUrl " + mojo.getRunTarget());
+ writer.print(" ");
+ writer.print(mojo.getCompileTarget()[0]);
+ }
+
+ writer.println();
+
+ writer.flush();
+ writer.close();
+
+ this.chmodUnixFile(file);
+
+ return file;
+ }
/**
* Write test scripts.
*/
- public void writeTestScripts(AbstractGWTMojo mojo) throws
MojoExecutionException {
+ public void writeTestScripts(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
// get extras
- String extra = (mojo.getExtraJvmArgs() != null) ?
mojo.getExtraJvmArgs() : "";
-
- String testExtra = (mojo.getExtraTestArgs() != null) ?
mojo.getExtraTestArgs() : "";
+ String extra = (mojo.getExtraJvmArgs() != null)
+ ? mojo.getExtraJvmArgs() : "";
+
+ String testExtra = (mojo.getExtraTestArgs() != null)
+ ? mojo.getExtraTestArgs() : "";
// make sure output dir is present
File outputDir = new File(mojo.getBuildDir(), "gwtTest");
@@ -268,19 +270,24 @@
outputDir.mkdir();
// for each test compile source root, build a test script
- List<String> testCompileRoots =
mojo.getProject().getTestCompileSourceRoots();
+ List<String> testCompileRoots = mojo.getProject()
+ .getTestCompileSourceRoots();
for (String currRoot : testCompileRoots) {
// TODO better file filter here
Collection<File> coll = FileUtils.listFiles(new File(currRoot),
- new WildcardFileFilter(mojo.getTestFilter()),
HiddenFileFilter.VISIBLE);
+ new WildcardFileFilter(mojo.getTestFilter()),
+ HiddenFileFilter.VISIBLE);
for (File currFile : coll) {
String testName = currFile.toString();
- mojo.getLog().debug(("gwtTest test match found (after
filter applied) - " + testName));
+ mojo.getLog()
+ .debug(("gwtTest test match found (after filter
applied) - "
+ + testName));
// parse off the extension
- if (testName.lastIndexOf('.') >
testName.lastIndexOf(File.separatorChar)) {
+ if (testName.lastIndexOf('.') > testName.lastIndexOf(
+ File.separatorChar)) {
testName = testName.substring(0,
testName.lastIndexOf('.'));
}
@@ -293,11 +300,14 @@
}
testName = StringUtils.replace(testName,
File.separatorChar, '.');
- mojo.getLog().debug("testName after parsing - " +
testName);
+ mojo.getLog()
+ .debug("testName after parsing - " + testName);
// start script inside gwtTest output dir, and name it
with test class name
- File file = new File(mojo.getBuildDir() + File.separator
+ "gwtTest", "gwtTest-" + testName + ".sh");
- PrintWriter writer =
this.getPrintWriterWithClasspath(mojo, file, DependencyScope.TEST);
+ File file = new File(mojo.getBuildDir() + File.separator
+ + "gwtTest", "gwtTest-" + testName + ".sh");
+ PrintWriter writer = this.getPrintWriterWithClasspath(mojo,
+ file, DependencyScope.TEST);
// build Java command
writer.print("\"" + mojo.getJavaCommand() + "\" ");
@@ -306,32 +316,31 @@
writer.print(" " + extra + " ");
}
- if(mojo.isUseHtmlUnit() ){
+ if (mojo.isUseHtmlUnit()) {
testExtra += " -Dgwt.args=\"-runStyle HtmlUnit:";
+
boolean first = true;
- for(String mode : mojo.getHtmlUnitBrowsers() ){
- if(!first){
- testExtra+=",";
- }
- testExtra+=mode;
+
+ for (String mode : mojo.getHtmlUnitBrowsers()) {
+ if (!first) {
+ testExtra += ",";
+ }
+
+ testExtra += mode;
first = false;
}
- testExtra +="\" ";
+
+ testExtra += "\" ";
}
if (testExtra.length() > 0) {
writer.print(" " + testExtra + " ");
}
-
-
-
writer.print(" -cp \"$CP\" ");
writer.print("junit.textui.TestRunner ");
writer.print(testName);
-
-
// write script out
writer.flush();
writer.close();
@@ -339,6 +348,72 @@
}
}
}
+
+ public File writeValidationScript(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
+ return this.writeCompilerInvocationScript(mojo, true);
+ }
+
+ /**
+ * Write compile script.
+ *
+ * @param mojo The Mojo calling this (contianing config parametersd)
+ * @return the script file that was written.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
+ */
+ protected File writeCompilerInvocationScript(AbstractGWTMojo mojo,
+ boolean validateOnly) throws MojoExecutionException {
+ File file = new File(mojo.getBuildDir(),
+ validateOnly ? "validate.sh" : "compile.sh");
+ PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
+ DependencyScope.COMPILE);
+
+ String extra = (mojo.getExtraJvmArgs() != null)
+ ? mojo.getExtraJvmArgs() : "";
+
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ + " -cp \"$CP\" ");
+ writer.print(" com.google.gwt.dev.Compiler ");
+ writer.print(" -gen ");
+ writer.print(mojo.getGen().getAbsolutePath());
+ writer.print(" -logLevel ");
+ writer.print(mojo.getLogLevel());
+ writer.print(" -style ");
+ writer.print(mojo.getStyle());
+
+ if (mojo.isEnableAssertions()) {
+ writer.print(" -ea ");
+ }
+
+ if ((mojo.isShowTreeLogger())) {
+ writer.print(" -treeLogger ");
+ }
+
+ writer.print(" -workDir ");
+ writer.print(mojo.getWorkDir().getAbsolutePath());
+ writer.print(" -extra ");
+ writer.print(mojo.getExtraDir());
+ writer.print(" -war ");
+ writer.print("\"" + mojo.getOutput().getAbsolutePath() + "\"");
+ writer.print(" -localWorkers ");
+ writer.print(mojo.getLocalWorkers());
+ writer.print(" ");
+
+ for (String target : mojo.getCompileTarget()) {
+ writer.print(target);
+ writer.print(" ");
+ }
+
+ writer.println();
+
+ writer.flush();
+ writer.close();
+
+ this.chmodUnixFile(file);
+
+ return file;
+ }
/**
* Util to get a PrintWriter with Unix preamble and classpath.
@@ -348,14 +423,16 @@
* @return
* @throws MojoExecutionException
*/
- private PrintWriter getPrintWriterWithClasspath(final AbstractGWTMojo
mojo, File file, final DependencyScope scope)
+ private PrintWriter getPrintWriterWithClasspath(
+ final AbstractGWTMojo mojo, File file, final DependencyScope scope)
throws MojoExecutionException {
PrintWriter writer = null;
try {
writer = new PrintWriter(new FileWriter(file));
} catch (IOException e) {
- throw new MojoExecutionException("Error creating script - " +
file, e);
+ throw new MojoExecutionException("Error creating script - " +
file,
+ e);
}
File sh = new File("/bin/bash");
@@ -372,7 +449,8 @@
writer.println();
try {
- Collection<File> classpath =
BuildClasspathUtil.buildClasspathList(mojo, scope);
+ Collection<File> classpath =
BuildClasspathUtil.buildClasspathList(mojo,
+ scope);
writer.print("CP=");
Iterator it = classpath.iterator();
@@ -387,7 +465,8 @@
}
}
} catch (DependencyResolutionRequiredException e) {
- throw new MojoExecutionException("Error creating script - " +
file, e);
+ throw new MojoExecutionException("Error creating script - " +
file,
+ e);
}
writer.println();
@@ -403,15 +482,13 @@
*/
private void chmodUnixFile(File file) {
try {
- ProcessWatcher pw = new ProcessWatcher(new String[]
{ "chmod", "+x", file.getAbsolutePath() });
+ ProcessWatcher pw = new ProcessWatcher(new String[] {
+ "chmod", "+x", file.getAbsolutePath()
+ });
pw.startProcess(System.out, System.err);
pw.waitFor();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
-
- public File writeValidationScript(AbstractGWTMojo mojo) throws
MojoExecutionException {
- return this.writeCompilerInvocationScript(mojo, true);
- }
-}
+}
=======================================
---
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/scripting/ScriptWriterWindows20.java
Sun Jul 1 07:48:34 2012
+++
/trunk/maven-googlewebtoolkit2-plugin/src/main/java/com/totsp/mavenplugin/gwt/scripting/ScriptWriterWindows20.java
Sun Jul 1 10:08:58 2012
@@ -2,6 +2,7 @@
import com.totsp.mavenplugin.gwt.AbstractGWTMojo;
import com.totsp.mavenplugin.gwt.DebugMojo;
+import com.totsp.mavenplugin.gwt.SuperDevModeMojo;
import com.totsp.mavenplugin.gwt.util.BuildClasspathUtil;
import com.totsp.mavenplugin.gwt.util.DependencyScope;
@@ -22,188 +23,64 @@
import java.util.Collection;
import java.util.List;
+
/**
*
* @author kebernet
*/
public class ScriptWriterWindows20 implements ScriptWriter16 {
-
public ScriptWriterWindows20() {
super();
}
-
- /**
- * Write run script.
- * @param mojo The Mojo calling this (contianing config parametersd)
- * @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
- */
- public File writeRunScript(AbstractGWTMojo mojo)
- throws MojoExecutionException {
- String filename = (mojo instanceof
DebugMojo) ? "debug.cmd" : "run.cmd";
- File file = new File(mojo.getBuildDir(), filename);
- PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
- DependencyScope.RUNTIME);
-
- String extra = (mojo.getExtraJvmArgs() != null)
- ? mojo.getExtraJvmArgs() : "";
- writer.print("\"" + mojo.getJavaCommand() + "\" " + extra + "
-cp %CLASSPATH% ");
-
- if (mojo instanceof DebugMojo) {
- writer.print(" -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,address=");
- writer.print(mojo.getDebugPort());
-
writer.print(mojo.isDebugSuspend() ? ",suspend=y " : ",suspend=n ");
- }
-
- writer.print(" com.google.gwt.dev.DevMode");
- if(mojo.getServer() != null){
- writer.print( " -server ");
- writer.print(mojo.getServer());
- writer.print(" ");
- }
- writer.print(" -logLevel ");
- writer.print(mojo.getLogLevel());
- if (mojo.isEnableAssertions()) {
- writer.print(" -ea ");
- }
-
- if ((mojo.isShowTreeLogger())) {
- writer.print(" -treeLogger ");
- }
-
-// writer.print(" -workDir ");
-// mojo.getWorkDir().mkdirs();
-// writer.print(mojo.getWorkDir().getAbsolutePath());
-// writer.print(" -extra ");
-// mojo.getExtraDir().mkdirs();
-// writer.print(mojo.getExtraDir());
- writer.print(" -war ");
- writer.print("\"" + mojo.getOutput().getAbsolutePath() + "\" ");
- writer.print(" -port ");
- writer.print(Integer.toString(mojo.getPort()));
-
- if (mojo.isNoServer()) {
- writer.print(" -noserver ");
- }
-
- if ((mojo.getWhitelist() != null) && (mojo.getWhitelist().length()
> 0)) {
- writer.print(" -whitelist \"");
- writer.print(mojo.getWhitelist());
- writer.print("\" ");
- }
-
- if ((mojo.getBlacklist() != null) && (mojo.getBlacklist().length()
> 0)) {
- writer.print(" -blacklist \"");
- writer.print(mojo.getBlacklist());
- writer.print("\" ");
- }
-
- writer.print(" -startupUrl " + mojo.getRunTarget());
- writer.print(" ");
- writer.print(mojo.getCompileTarget()[0]);
- writer.println();
-
- writer.flush();
- writer.close();
-
- return file;
- }
/**
* Write compile script.
+ *
* @param mojo The Mojo calling this (contianing config parametersd)
* @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
*/
- public File writeCompileScript(AbstractGWTMojo mojo) throws
MojoExecutionException {
+ public File writeCompileScript(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
return this.writeCompilerInvocationScript(mojo, false);
}
-
- /**
- * Write compile script.
- * @param mojo The Mojo calling this (contianing config parametersd)
- * @param validateOnly Indicates whether this should write a
validation or compile script
- * @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
- */
- protected File writeCompilerInvocationScript(AbstractGWTMojo mojo,
boolean validateOnly)
- throws MojoExecutionException {
- File file = new File(mojo.getBuildDir(),
validateOnly ? "validate.cmd" : "compile.cmd");
- PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
- DependencyScope.COMPILE);
-
-
- String extra = (mojo.getExtraJvmArgs() != null)
- ? mojo.getExtraJvmArgs() : "";
- writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
- + " -cp %CLASSPATH% ");
- writer.print(" com.google.gwt.dev.Compiler ");
- if (validateOnly) {
- writer.print(" -validateOnly ");
- }
- writer.print(" -gen ");
- writer.print(mojo.getGen().getAbsolutePath());
- writer.print(" -logLevel ");
- writer.print(mojo.getLogLevel());
- writer.print(" -style ");
- writer.print(mojo.getStyle());
-
- if (mojo.isEnableAssertions()) {
- writer.print(" -ea ");
- }
-
- if ((mojo.isShowTreeLogger())) {
- writer.print(" -treeLogger ");
- }
-
- writer.print(" -workDir ");
- writer.print(mojo.getWorkDir().getAbsolutePath());
- writer.print(" -extra ");
- writer.print(mojo.getExtraDir());
- writer.print(" -war ");
- writer.print("\"" + mojo.getOutput().getAbsolutePath() + "\"");
- writer.print(" -localWorkers ");
- writer.print(mojo.getLocalWorkers());
- writer.print(" ");
- for (String target : mojo.getCompileTarget()) {
- writer.print(target);
- writer.print(" ");
- }
-
- writer.println();
-
- writer.flush();
- writer.close();
- return file;
- }
/**
* Write i18n script.
+ *
* @param mojo The Mojo calling this (contianing config parametersd)
* @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
*/
public File writeI18nScript(AbstractGWTMojo mojo)
- throws MojoExecutionException {
+ throws MojoExecutionException {
File file = new File(mojo.getBuildDir(), "i18n.cmd");
if (!file.exists()) {
- if (mojo.getLog().isDebugEnabled()) {
- mojo.getLog().debug("File '" + file.getAbsolutePath()
- + "' does not exsists, trying to create.");
+ if (mojo.getLog()
+ .isDebugEnabled()) {
+ mojo.getLog()
+ .debug("File '" + file.getAbsolutePath()
+ + "' does not exsists, trying to create.");
}
try {
- file.getParentFile().mkdirs();
+ file.getParentFile()
+ .mkdirs();
file.createNewFile();
- if (mojo.getLog().isDebugEnabled()) {
- mojo.getLog().debug("New file '" +
file.getAbsolutePath()
- + "' created.");
+ if (mojo.getLog()
+ .isDebugEnabled()) {
+ mojo.getLog()
+ .debug("New file '" + file.getAbsolutePath()
+ + "' created.");
}
} catch (Exception exe) {
- mojo.getLog().error("Couldn't create file '" +
file.getAbsolutePath()
- + "'. Reason: " + exe.getMessage(), exe);
+ mojo.getLog()
+ .error("Couldn't create file '" +
file.getAbsolutePath()
+ + "'. Reason: " + exe.getMessage(), exe);
}
}
@@ -214,10 +91,10 @@
if (mojo.getI18nConstantsNames() != null) {
for (String target : mojo.getI18nConstantsNames()) {
String extra = (mojo.getExtraJvmArgs() != null)
- ? mojo.getExtraJvmArgs() : "";
-
- writer.print("\"" + mojo.getJavaCommand() + "\" "
- + extra + " -cp %CLASSPATH%");
+ ? mojo.getExtraJvmArgs() : "";
+
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ + " -cp %CLASSPATH%");
writer.print(" com.google.gwt.i18n.tools.I18NSync");
writer.print(" -out ");
writer.print("\"" + mojo.getI18nOutputDir() + "\"");
@@ -231,10 +108,10 @@
if (mojo.getI18nMessagesNames() != null) {
for (String target : mojo.getI18nMessagesNames()) {
String extra = (mojo.getExtraJvmArgs() != null)
- ? mojo.getExtraJvmArgs() : "";
-
- writer.print("\"" + mojo.getJavaCommand() + "\" "
- + extra + " -cp %CLASSPATH%");
+ ? mojo.getExtraJvmArgs() : "";
+
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ + " -cp %CLASSPATH%");
writer.print(" com.google.gwt.i18n.tools.I18NSync");
writer.print(" -createMessages ");
writer.print(" -out ");
@@ -250,17 +127,122 @@
return file;
}
+
+ /**
+ * Write run script.
+ *
+ * @param mojo The Mojo calling this (contianing config parametersd)
+ * @return the script file that was written.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
+ */
+ public File writeRunScript(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
+ String filename = (mojo instanceof DebugMojo) ? "debug.cmd"
+ : ((mojo instanceof
SuperDevModeMojo)
+ ? "codeserver.cmd" : "run.cmd");
+ File file = new File(mojo.getBuildDir(), filename);
+ PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
+ DependencyScope.RUNTIME);
+
+ String extra = (mojo.getExtraJvmArgs() != null)
+ ? mojo.getExtraJvmArgs() : "";
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ + " -cp %CLASSPATH% ");
+
+ if (mojo instanceof DebugMojo) {
+ writer.print(
+ " -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,address=");
+ writer.print(mojo.getDebugPort());
+
writer.print(mojo.isDebugSuspend() ? ",suspend=y " : ",suspend=n ");
+ }
+
+ if (mojo instanceof SuperDevModeMojo) {
+ writer.print(" com.google.gwt.dev.codeserver.CodeServer ");
+ writer.print(" -port ");
+ writer.print(Integer.toString(mojo.getCodeserverPort()));
+ writer.print(" -workDir ");
+ writer.print(mojo.getWorkDir());
+ writer.print(" -src .\\src\\main\\java");
+
+ for (String s : mojo.getCodeserverTargets()) {
+ writer.print(" ");
+ writer.print(s);
+ }
+ } else {
+ writer.print(" com.google.gwt.dev.DevMode");
+
+ if (mojo.getServer() != null) {
+ writer.print(" -server ");
+ writer.print(mojo.getServer());
+ writer.print(" ");
+ }
+
+ writer.print(" -logLevel ");
+ writer.print(mojo.getLogLevel());
+
+ if (mojo.isEnableAssertions()) {
+ writer.print(" -ea ");
+ }
+
+ if ((mojo.isShowTreeLogger())) {
+ writer.print(" -treeLogger ");
+ }
+
+ // writer.print(" -workDir ");
+ // mojo.getWorkDir().mkdirs();
+ // writer.print(mojo.getWorkDir().getAbsolutePath());
+ // writer.print(" -extra ");
+ // mojo.getExtraDir().mkdirs();
+ // writer.print(mojo.getExtraDir());
+ writer.print(" -war ");
+ writer.print("\"" + mojo.getOutput().getAbsolutePath()
+ "\" ");
+ writer.print(" -port ");
+ writer.print(Integer.toString(mojo.getPort()));
+
+ if (mojo.isNoServer()) {
+ writer.print(" -noserver ");
+ }
+
+ if ((mojo.getWhitelist() != null)
+ && (mojo.getWhitelist()
+ .length() > 0)) {
+ writer.print(" -whitelist \"");
+ writer.print(mojo.getWhitelist());
+ writer.print("\" ");
+ }
+
+ if ((mojo.getBlacklist() != null)
+ && (mojo.getBlacklist()
+ .length() > 0)) {
+ writer.print(" -blacklist \"");
+ writer.print(mojo.getBlacklist());
+ writer.print("\" ");
+ }
+
+ writer.print(" -startupUrl " + mojo.getRunTarget());
+ writer.print(" ");
+ writer.print(mojo.getCompileTarget()[0]);
+ }
+
+ writer.println();
+
+ writer.flush();
+ writer.close();
+
+ return file;
+ }
/**
* Write test scripts.
*/
public void writeTestScripts(AbstractGWTMojo mojo)
- throws MojoExecutionException {
+ throws MojoExecutionException {
// get extras
String extra = (mojo.getExtraJvmArgs() != null)
- ? mojo.getExtraJvmArgs() : "";
+ ? mojo.getExtraJvmArgs() : "";
String testExtra = (mojo.getExtraTestArgs() != null)
- ? mojo.getExtraTestArgs() : "";
+ ? mojo.getExtraTestArgs() : "";
// make sure output dir is present
File outputDir = new File(mojo.getBuildDir(), "gwtTest");
@@ -268,7 +250,8 @@
outputDir.mkdir();
// for each test compile source root, build a test script
- List<String> testCompileRoots =
mojo.getProject().getTestCompileSourceRoots();
+ List<String> testCompileRoots = mojo.getProject()
+ .getTestCompileSourceRoots();
for (String currRoot : testCompileRoots) {
Collection<File> coll = FileUtils.listFiles(new File(currRoot),
@@ -277,12 +260,13 @@
for (File currFile : coll) {
String testName = currFile.toString();
- mojo.getLog().debug(("gwtTest test match found (after
filter applied) - "
- + testName));
+ mojo.getLog()
+ .debug(("gwtTest test match found (after filter
applied) - "
+ + testName));
// parse off the extension
if (testName.lastIndexOf('.') > testName.lastIndexOf(
- File.separatorChar)) {
+ File.separatorChar)) {
testName = testName.substring(0,
testName.lastIndexOf('.'));
}
@@ -295,7 +279,8 @@
}
testName = StringUtils.replace(testName,
File.separatorChar, '.');
- mojo.getLog().debug("testName after parsing - " +
testName);
+ mojo.getLog()
+ .debug("testName after parsing - " + testName);
// start script inside gwtTest output dir, and name it
with test class name
File file = new File(mojo.getBuildDir() + File.separator
@@ -316,25 +301,29 @@
if (mojo.isUseHtmlUnit()) {
testExtra += " -Dgwt.args=\"-runStyle HtmlUnit:";
+
boolean first = true;
+
for (String mode : mojo.getHtmlUnitBrowsers()) {
if (!first) {
testExtra += ",";
}
+
testExtra += mode;
first = false;
}
+
testExtra += "\" ";
}
if (testExtra.length() > 0) {
writer.print(" " + testExtra + " ");
}
-
writer.print(" -cp %CLASSPATH% ");
- writer.print("-Dcatalina.base=\"" +
mojo.getTomcat().getAbsolutePath() + "\" ");
+ writer.print("-Dcatalina.base=\""
+ + mojo.getTomcat().getAbsolutePath() + "\" ");
writer.print("junit.textui.TestRunner ");
writer.print(testName);
@@ -345,6 +334,84 @@
}
}
}
+
+ /**
+ * Writes the validate.cmd script.
+ *
+ * @param mojo The Mojo calling this (contianing config parametersd)
+ * @return the script file that was written.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
+ */
+ public File writeValidationScript(AbstractGWTMojo mojo)
+ throws MojoExecutionException {
+ return this.writeCompilerInvocationScript(mojo, true);
+ }
+
+ /**
+ * Write compile script.
+ *
+ * @param mojo The Mojo calling this (contianing config parametersd)
+ * @param validateOnly Indicates whether this should write a
validation or
+ * compile script
+ * @return the script file that was written.
+ * @throws org.apache.maven.plugin.MojoExecutionException general
purpose
+ * exception.
+ */
+ protected File writeCompilerInvocationScript(AbstractGWTMojo mojo,
+ boolean validateOnly) throws MojoExecutionException {
+ File file = new File(mojo.getBuildDir(),
+ validateOnly ? "validate.cmd" : "compile.cmd");
+ PrintWriter writer = this.getPrintWriterWithClasspath(mojo, file,
+ DependencyScope.COMPILE);
+
+ String extra = (mojo.getExtraJvmArgs() != null)
+ ? mojo.getExtraJvmArgs() : "";
+ writer.print("\"" + mojo.getJavaCommand() + "\" " + extra
+ + " -cp %CLASSPATH% ");
+ writer.print(" com.google.gwt.dev.Compiler ");
+
+ if (validateOnly) {
+ writer.print(" -validateOnly ");
+ }
+
+ writer.print(" -gen ");
+ writer.print(mojo.getGen().getAbsolutePath());
+ writer.print(" -logLevel ");
+ writer.print(mojo.getLogLevel());
+ writer.print(" -style ");
+ writer.print(mojo.getStyle());
+
+ if (mojo.isEnableAssertions()) {
+ writer.print(" -ea ");
+ }
+
+ if ((mojo.isShowTreeLogger())) {
+ writer.print(" -treeLogger ");
+ }
+
+ writer.print(" -workDir ");
+ writer.print(mojo.getWorkDir().getAbsolutePath());
+ writer.print(" -extra ");
+ writer.print(mojo.getExtraDir());
+ writer.print(" -war ");
+ writer.print("\"" + mojo.getOutput().getAbsolutePath() + "\"");
+ writer.print(" -localWorkers ");
+ writer.print(mojo.getLocalWorkers());
+ writer.print(" ");
+
+ for (String target : mojo.getCompileTarget()) {
+ writer.print(target);
+ writer.print(" ");
+ }
+
+ writer.println();
+
+ writer.flush();
+ writer.close();
+
+ return file;
+ }
/**
* Util to get a PrintWriter with Windows preamble.
@@ -355,86 +422,84 @@
* @throws MojoExecutionException
*/
private PrintWriter getPrintWriterWithClasspath(
- final AbstractGWTMojo mojo, File file, final DependencyScope
scope)
- throws MojoExecutionException {
+ final AbstractGWTMojo mojo, File file, final DependencyScope scope)
+ throws MojoExecutionException {
PrintWriter writer = null;
File cp = new File("target/cp");
cp.mkdirs();
+
try {
writer = new PrintWriter(new FileWriter(file));
+
//writer.println("@echo off");
} catch (IOException e) {
throw new MojoExecutionException("Error creating script - " +
file,
- e);
+ e);
}
try {
int counter = 0;
Collection<File> classpath =
BuildClasspathUtil.buildClasspathList(mojo,
scope);
-
+
StringBuilder dirs = new StringBuilder();
- for(File f: classpath){
- if(!f.isDirectory()) {
- writer.println("copy "+f.getAbsolutePath()+"
target\\cp\\");
+ for (File f : classpath) {
+ if (!f.isDirectory()) {
+ writer.println("copy " + f.getAbsolutePath()
+ + " target\\cp\\");
} else {
- dirs = dirs.append(f.getAbsolutePath()).append(";");
+ dirs = dirs.append(f.getAbsolutePath())
+ .append(";");
}
}
- if(scope == DependencyScope.TEST){
+
+ if (scope == DependencyScope.TEST) {
dirs =
dirs.append("src\\test\\java;src\\test\\resources;");
}
- writer.print("set
CLASSPATH=\"src\\main\\java;src\\main\\resources\";"+dirs.toString()+"target\\classes;target\\cp\\*;");
- for(File f: BuildClasspathUtil.getSystemPaths(mojo)){
+
+ writer.print(
+ "set CLASSPATH=\"src\\main\\java;src\\main\\resources\";"
+ + dirs.toString() + "target\\classes;target\\cp\\*;");
+
+ for (File f : BuildClasspathUtil.getSystemPaths(mojo)) {
writer.print(f.getAbsolutePath());
writer.print(";");
}
- writer.println();
-//
-// writer.print("set CLASSPATH"+counter+"=");
-//
-// StringBuffer cpString = new StringBuffer();
-//
-// for (File f : classpath) {
-// cpString.append("\"" + f.getAbsolutePath() + "\";");
-//
-// // break the line at 4000 characters to try to avoid max
size
-// if (cpString.length() > 10) {
-// writer.println(cpString);
-// cpString = new StringBuffer();
-// writer.print("set CLASSPATH"+counter+"=");
-// counter++;
-// }
-// }
-//
-//
-// writer.println(cpString);
-//
-// writer.print("set CLASSPATH=");
-// for(int i=0; i<=counter; i++){
-// writer.print("%CLASSPATH"+i+"%");
-// }
-
+
+ writer.println();
+ //
+ // writer.print("set CLASSPATH"+counter+"=");
+ //
+ // StringBuffer cpString = new StringBuffer();
+ //
+ // for (File f : classpath) {
+ // cpString.append("\"" + f.getAbsolutePath()
+ "\";");
+ //
+ // // break the line at 4000 characters to try
to avoid max size
+ // if (cpString.length() > 10) {
+ // writer.println(cpString);
+ // cpString = new StringBuffer();
+ // writer.print("set
CLASSPATH"+counter+"=");
+ // counter++;
+ // }
+ // }
+ //
+ //
+ // writer.println(cpString);
+ //
+ // writer.print("set CLASSPATH=");
+ // for(int i=0; i<=counter; i++){
+ // writer.print("%CLASSPATH"+i+"%");
+ // }
writer.println();
} catch (DependencyResolutionRequiredException e) {
throw new MojoExecutionException("Error creating script - " +
file,
- e);
+ e);
}
writer.println();
return writer;
}
-
- /**
- * Writes the validate.cmd script.
- * @param mojo The Mojo calling this (contianing config parametersd)
- * @return the script file that was written.
- * @throws org.apache.maven.plugin.MojoExecutionException general
purpose exception.
- */
- public File writeValidationScript(AbstractGWTMojo mojo)
- throws MojoExecutionException {
- return this.writeCompilerInvocationScript(mojo, true);
- }
-}
+}