Browse Source

Launcher should not depend upon parent package

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@466643 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 18 years ago
parent
commit
105b2252ce
2 changed files with 5 additions and 6 deletions
  1. +2
    -1
      src/main/org/apache/tools/ant/MagicNames.java
  2. +3
    -5
      src/main/org/apache/tools/ant/launch/Launcher.java

+ 2
- 1
src/main/org/apache/tools/ant/MagicNames.java View File

@@ -16,6 +16,7 @@
*
*/
package org.apache.tools.ant;
import org.apache.tools.ant.launch.Launcher;

/**
* Magic names used within Ant.
@@ -115,7 +116,7 @@ public final class MagicNames {
* Property used to store the location of ant.
* @since Ant 1.7
*/
public static final String ANT_HOME = "ant.home";
public static final String ANT_HOME = Launcher.ANTHOME_PROPERTY;

/**
* Property used to store the location of the ant library (typically the ant.jar file.)


+ 3
- 5
src/main/org/apache/tools/ant/launch/Launcher.java View File

@@ -26,7 +26,6 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;

import org.apache.tools.ant.MagicNames;


/**
@@ -39,9 +38,8 @@ public class Launcher {
/**
* The Ant Home (installation) Directory property.
* {@value}
* @deprecated since 1.7
*/
public static final String ANTHOME_PROPERTY = MagicNames.ANT_HOME;
public static final String ANTHOME_PROPERTY = "ant.home";

/**
* The Ant Library Directory property.
@@ -157,7 +155,7 @@ public class Launcher {
*/
private int run(String[] args)
throws LaunchException, MalformedURLException {
String antHomeProperty = System.getProperty(MagicNames.ANT_HOME);
String antHomeProperty = System.getProperty(ANTHOME_PROPERTY);
File antHome = null;

File sourceJar = Locator.getClassSource(getClass());
@@ -170,7 +168,7 @@ public class Launcher {

if (antHome == null || !antHome.exists()) {
antHome = jarDir.getParentFile();
System.setProperty(MagicNames.ANT_HOME, antHome.getAbsolutePath());
System.setProperty(ANTHOME_PROPERTY, antHome.getAbsolutePath());
}

if (!antHome.exists()) {


Loading…
Cancel
Save