Browse Source

Keep gumpalump happy

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272661 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
e503d4fa0e
3 changed files with 10 additions and 12 deletions
  1. +1
    -5
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/modelparser/ProjectHandler.java
  2. +6
    -4
      proposal/mutant/src/java/init/org/apache/ant/init/InitConfig.java
  3. +3
    -3
      proposal/mutant/src/java/start/org/apache/ant/start/Main.java

+ 1
- 5
proposal/mutant/src/java/antcore/org/apache/ant/antcore/modelparser/ProjectHandler.java View File

@@ -173,17 +173,13 @@ public class ProjectHandler extends ModelElementHandler {
} catch (ModelException e) {
throw new SAXParseException(e.getMessage(), getLocator(), e);
}
} else if (localName != null) {
} else {
// everything else is a task
BuildElementHandler buildElementHandler = new BuildElementHandler();
buildElementHandler.start(getParseContext(), getXMLReader(),
this, getLocator(), attributes, getElementSource(),
qualifiedName);
project.addTask(buildElementHandler.getBuildElement());
} else {
// ignore namespaced elements
throw new SAXParseException("namespace support is not "
+ "currently recognized (" + qualifiedName + ")", getLocator());
}
}



+ 6
- 4
proposal/mutant/src/java/init/org/apache/ant/init/InitConfig.java View File

@@ -116,11 +116,12 @@ public class InitConfig {
/**
* Constructor for the Initialization configuration
*
* @param libraryClass - a class loaded from the Ant library area.
* @exception InitException if the configuration cannot be initialized
*/
public InitConfig() throws InitException {
public InitConfig(Class libraryClass) throws InitException {
try {
URL antLibURL = getAntLibURL();
URL antLibURL = getAntLibURL(libraryClass);
setLibraryURL(antLibURL);

URL antHome = new URL(antLibURL, "..");
@@ -331,12 +332,13 @@ public class InitConfig {
/**
* Get a URL to the Ant Library directory.
*
* @param libraryClass - a class loaded from the Ant library area.
* @return the URL for the Ant library directory
* @throws MalformedURLException if there is a problem constructing the
* library URL
*/
private URL getAntLibURL() throws MalformedURLException {
URL initClassURL = ClassLocator.getClassLocationURL(getClass());
private URL getAntLibURL(Class libraryClass) throws MalformedURLException {
URL initClassURL = ClassLocator.getClassLocationURL(libraryClass);

String initURLString = initClassURL.toString();
int index = initURLString.lastIndexOf("/");


+ 3
- 3
proposal/mutant/src/java/start/org/apache/ant/start/Main.java View File

@@ -135,7 +135,7 @@ public class Main {
public void start(String frontend, String defaultClass, String[] args)
throws InitException {
try {
InitConfig config = new InitConfig();
InitConfig config = new InitConfig(getClass());
URL frontendJar = new URL(config.getLibraryURL(),
"frontend/" + frontend + ".jar");
@@ -149,8 +149,8 @@ public class Main {
if (frontendJar.getProtocol().equals("file")) {
File jarFile = new File(frontendJar.getFile());
if (!jarFile.exists()) {
throw new InitException("Could not jar for frontend \""
+ frontend + "\"");
throw new InitException("Could not find jar for frontend \""
+ frontend + "\" - expected at " + frontendJar);
}
}
String mainClass = getMainClass(frontendJar);


Loading…
Cancel
Save