This allows running ant without loading the jars from ${user.home}/.ant/lib.
This is useful for building ant.
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276880 13f79535-47bb-0310-9956-ffa450edef68
master
| @@ -53,6 +53,10 @@ Other changes: | |||||
| * Added searchpath attribute to <exec> for searching path variable(s) | * Added searchpath attribute to <exec> for searching path variable(s) | ||||
| when resolveexecutable = true. | when resolveexecutable = true. | ||||
| * Added -nouserlib option to allow running ant without automatically loading | |||||
| up ${user.dir}/.lib/ant. This is useful when compiling ant, and antlibs. | |||||
| Modified the build.sh and build.bat to use the option. | |||||
| Changes from Ant 1.6.2 to current Ant 1.6 CVS version | Changes from Ant 1.6.2 to current Ant 1.6 CVS version | ||||
| ===================================================== | ===================================================== | ||||
| @@ -17,7 +17,7 @@ call bootstrap\bin\ant.bat -lib lib/optional %1 %2 %3 %4 %5 %6 %7 %8 %9 | |||||
| goto cleanup | goto cleanup | ||||
| :install_ant | :install_ant | ||||
| call bootstrap\bin\ant.bat -lib lib/optional -Dant.install="%REAL_ANT_HOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9 | |||||
| call bootstrap\bin\ant.bat -nouserlib -lib lib/optional -Dant.install="%REAL_ANT_HOME%" %1 %2 %3 %4 %5 %6 %7 %8 %9 | |||||
| rem clean up | rem clean up | ||||
| :cleanup | :cleanup | ||||
| @@ -41,5 +41,5 @@ else | |||||
| ANT_INSTALL="-emacs" | ANT_INSTALL="-emacs" | ||||
| fi | fi | ||||
| bootstrap/bin/ant -lib lib/optional "$ANT_INSTALL" $* | |||||
| bootstrap/bin/ant -nouserlib -lib lib/optional "$ANT_INSTALL" $* | |||||
| @@ -834,6 +834,8 @@ public class Main implements AntMain { | |||||
| msg.append(" -s <file> the filesystem and use it" + lSep); | msg.append(" -s <file> the filesystem and use it" + lSep); | ||||
| msg.append(" -nice number A niceness value for the main thread:" + lSep + | msg.append(" -nice number A niceness value for the main thread:" + lSep + | ||||
| " 1 (lowest) to 10 (highest); 5 is the default" + lSep); | " 1 (lowest) to 10 (highest); 5 is the default" + lSep); | ||||
| msg.append(" -nouserlib Run ant within using the jar files from ${user.home}/" | |||||
| + ".ant/lib"); | |||||
| System.out.println(msg.toString()); | System.out.println(msg.toString()); | ||||
| } | } | ||||
| @@ -122,6 +122,7 @@ public class Launcher { | |||||
| String cpString = null; | String cpString = null; | ||||
| List argList = new ArrayList(); | List argList = new ArrayList(); | ||||
| String[] newArgs; | String[] newArgs; | ||||
| boolean noUserLib = false; | |||||
| for (int i = 0; i < args.length; ++i) { | for (int i = 0; i < args.length; ++i) { | ||||
| if (args[i].equals("-lib")) { | if (args[i].equals("-lib")) { | ||||
| @@ -140,6 +141,8 @@ public class Launcher { | |||||
| + "not be repeated"); | + "not be repeated"); | ||||
| } | } | ||||
| cpString = args[++i]; | cpString = args[++i]; | ||||
| } else if (args[i].equals("--nouserlib") || args[i].equals("-nouserlib")) { | |||||
| noUserLib = true; | |||||
| } else { | } else { | ||||
| argList.add(args[i]); | argList.add(args[i]); | ||||
| } | } | ||||
| @@ -182,8 +185,8 @@ public class Launcher { | |||||
| File userLibDir | File userLibDir | ||||
| = new File(System.getProperty("user.home"), USER_LIBDIR); | = new File(System.getProperty("user.home"), USER_LIBDIR); | ||||
| URL[] userJars = Locator.getLocationURLs(userLibDir); | |||||
| URL[] userJars = noUserLib ? new URL[0] : Locator.getLocationURLs(userLibDir); | |||||
| int numJars = libJars.length + userJars.length + systemJars.length; | int numJars = libJars.length + userJars.length + systemJars.length; | ||||
| if (toolsJar != null) { | if (toolsJar != null) { | ||||