Complain if we don't have a classpathref set. Fixed regex as EOL is
apparently not a non-word character. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3241 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -253,6 +253,12 @@ public abstract class InvocationTask extends Task
|
|||||||
/** Performs the actual work of the task. */
|
/** Performs the actual work of the task. */
|
||||||
public void execute () throws BuildException
|
public void execute () throws BuildException
|
||||||
{
|
{
|
||||||
|
if (_cloader == null) {
|
||||||
|
String errmsg = "This task requires a 'classpathref' attribute " +
|
||||||
|
"to be set to the project's classpath.";
|
||||||
|
throw new BuildException(errmsg);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_velocity = VelocityUtil.createEngine();
|
_velocity = VelocityUtil.createEngine();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -312,12 +318,15 @@ public abstract class InvocationTask extends Task
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
processService(source, _cloader.loadClass(name));
|
processService(source, _cloader.loadClass(name));
|
||||||
} catch (Exception e) {
|
} catch (ClassNotFoundException cnfe) {
|
||||||
System.err.println(
|
System.err.println(
|
||||||
"Failed to load " + name + ": " + e.getMessage());
|
"Failed to load " + name + ".\n" +
|
||||||
System.err.println("Make sure the classes for which you will " +
|
"Missing class: " + cnfe.getMessage());
|
||||||
"be generating interfaces are");
|
System.err.println(
|
||||||
System.err.println("in ant's classpath.");
|
"Be sure to set the 'classpathref' attribute to a classpath\n" +
|
||||||
|
"that contains your projects invocation service classes.");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,5 +385,5 @@ public abstract class InvocationTask extends Task
|
|||||||
|
|
||||||
/** A regular expression for matching the interface declaration. */
|
/** A regular expression for matching the interface declaration. */
|
||||||
protected static final Pattern NAME_PATTERN =
|
protected static final Pattern NAME_PATTERN =
|
||||||
Pattern.compile("^\\s*public\\s+interface\\s+(\\S+)\\W");
|
Pattern.compile("^\\s*public\\s+interface\\s+(\\S+)(\\W|$)");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user