As suggested by Darin Swanson. (use USER_LIBDIR, and use File.separatorChar in there) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278406 13f79535-47bb-0310-9956-ffa450edef68master
@@ -802,10 +802,7 @@ public class ComponentHelper { | |||||
boolean definitions = false; | boolean definitions = false; | ||||
boolean antTask; | boolean antTask; | ||||
String home = System.getProperty(Launcher.USER_HOMEDIR); | String home = System.getProperty(Launcher.USER_HOMEDIR); | ||||
File libDir = new File(home, | |||||
Launcher.ANT_PRIVATEDIR + | |||||
File.separator + | |||||
Launcher.ANT_PRIVATELIB); | |||||
File libDir = new File(home, Launcher.USER_LIBDIR); | |||||
//look up the name | //look up the name | ||||
AntTypeDefinition def = getDefinition(componentName); | AntTypeDefinition def = getDefinition(componentName); | ||||
if (def == null) { | if (def == null) { | ||||
@@ -285,8 +285,7 @@ public final class Diagnostics { | |||||
private static void doReportUserHomeLibraries(PrintStream out) { | private static void doReportUserHomeLibraries(PrintStream out) { | ||||
String home = System.getProperty(Launcher.USER_HOMEDIR); | String home = System.getProperty(Launcher.USER_HOMEDIR); | ||||
out.println("user.home: " + home); | out.println("user.home: " + home); | ||||
File libDir = new File(home, | |||||
Launcher.ANT_PRIVATEDIR + File.separator + Launcher.ANT_PRIVATELIB); | |||||
File libDir = new File(home, Launcher.USER_LIBDIR); | |||||
File[] libs = listJarFiles(libDir); | File[] libs = listJarFiles(libDir); | ||||
printLibraries(libs, out); | printLibraries(libs, out); | ||||
} | } | ||||
@@ -50,7 +50,8 @@ public class Launcher { | |||||
public static final String ANT_PRIVATELIB = "lib"; | public static final String ANT_PRIVATELIB = "lib"; | ||||
/** The location of a per-user library directory */ | /** The location of a per-user library directory */ | ||||
public static final String USER_LIBDIR = ANT_PRIVATEDIR + "/" + ANT_PRIVATELIB; | |||||
public static final String USER_LIBDIR = | |||||
ANT_PRIVATEDIR + File.separatorChar + ANT_PRIVATELIB; | |||||
/** The startup class that is to be run */ | /** The startup class that is to be run */ | ||||
public static final String MAIN_CLASS = "org.apache.tools.ant.Main"; | public static final String MAIN_CLASS = "org.apache.tools.ant.Main"; | ||||
@@ -206,8 +207,7 @@ public class Launcher { | |||||
URL[] systemJars = Locator.getLocationURLs(antLibDir); | URL[] systemJars = Locator.getLocationURLs(antLibDir); | ||||
File userLibDir | File userLibDir | ||||
= new File(System.getProperty(USER_HOMEDIR), | |||||
ANT_PRIVATEDIR + File.separatorChar + ANT_PRIVATELIB); | |||||
= new File(System.getProperty(USER_HOMEDIR), USER_LIBDIR); | |||||
URL[] userJars = noUserLib ? new URL[0] : Locator.getLocationURLs(userLibDir); | URL[] userJars = noUserLib ? new URL[0] : Locator.getLocationURLs(userLibDir); | ||||