This addresses a problem with the recent patch, in that it is giving
the warning for JUnitShell. Since you had asked about customizing the
message anyway, I just went ahead with a solution that allows each
subclass of DevModeBase to define its own warning behavior.
Review at http://gwt-code-reviews.appspot.com/134805/show
Patch by: jat
Review by: rdayal
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7492 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/DevMode.java b/dev/core/src/com/google/gwt/dev/DevMode.java
index 57b9c32..4051228 100644
--- a/dev/core/src/com/google/gwt/dev/DevMode.java
+++ b/dev/core/src/com/google/gwt/dev/DevMode.java
@@ -486,6 +486,13 @@
}
}
+ @Override
+ protected void warnAboutNoStartupUrls() {
+ getTopLogger().log(TreeLogger.WARN,
+ "No startup URLs supplied and no plausible ones found -- use "
+ + "-startupUrl");
+ }
+
private void validateServletTags(TreeLogger logger,
ServletValidator servletValidator, ModuleDef module, File webXml) {
TreeLogger servletLogger = logger.branch(TreeLogger.DEBUG,
diff --git a/dev/core/src/com/google/gwt/dev/DevModeBase.java b/dev/core/src/com/google/gwt/dev/DevModeBase.java
index f186b77..9d02650 100644
--- a/dev/core/src/com/google/gwt/dev/DevModeBase.java
+++ b/dev/core/src/com/google/gwt/dev/DevModeBase.java
@@ -1049,8 +1049,7 @@
if (options.getStartupURLs().isEmpty()) {
// TODO(jat): we could walk public resources to find plausible URLs
// after the module(s) are loaded
- getTopLogger().log(TreeLogger.WARN, "No startup URLs supplied or found "
- + "-- supply them on the command line");
+ warnAboutNoStartupUrls();
}
setStartupUrls(getTopLogger());
@@ -1062,6 +1061,12 @@
return true;
}
+ /**
+ * Log a warning explaining that no startup URLs were specified and no
+ * plausible startup URLs were found.
+ */
+ protected abstract void warnAboutNoStartupUrls();
+
private ArtifactAcceptor createArtifactAcceptor(TreeLogger logger,
final ModuleDef module) throws UnableToCompleteException {
final StandardLinkerContext linkerContext = link(logger, module);
diff --git a/dev/core/src/com/google/gwt/dev/GWTShell.java b/dev/core/src/com/google/gwt/dev/GWTShell.java
index 4cdb0f9..9af6433 100644
--- a/dev/core/src/com/google/gwt/dev/GWTShell.java
+++ b/dev/core/src/com/google/gwt/dev/GWTShell.java
@@ -231,4 +231,11 @@
protected boolean shouldAutoGenerateResources() {
return true;
}
+
+ @Override
+ protected void warnAboutNoStartupUrls() {
+ getTopLogger().log(TreeLogger.WARN,
+ "No startup URLs were supplied -- add them to the end of the GWTShell"
+ + " command line");
+ }
}
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index 229c076..669aefd 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -960,6 +960,11 @@
return shouldAutoGenerateResources;
}
+ @Override
+ protected void warnAboutNoStartupUrls() {
+ // do nothing -- JUnitShell isn't expected to have startup URLs
+ }
+
void compileForWebMode(String moduleName, String... userAgents)
throws UnableToCompleteException {
// Never fresh during JUnit.