git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271419 13f79535-47bb-0310-9956-ffa450edef68master
@@ -0,0 +1,29 @@ | |||||
@echo off | |||||
REM Copyright (c) 2000-2001 The Apache Software Foundation. All rights | |||||
REM reserved. | |||||
REM cleanup curretn boot area | |||||
if exist bin rmdir /s/q bin | |||||
if exist bootstrap rmdir /s/q bootstrap | |||||
if exist dist rmdir /s/q dist | |||||
REM compile init jar | |||||
mkdir bin\init | |||||
javac -d bin\init src\java\init\org\apache\ant\init\*.java | |||||
REM compile bootstrap classes | |||||
mkdir bin\bootstrap | |||||
javac -classpath bin\init -d bin\bootstrap src\java\bootstrap\org\apache\ant\bootstrap\*.java | |||||
REM compiler builder classes | |||||
mkdir bin\builder | |||||
javac -classpath bin\init;bin\bootstrap -d bin\builder src\java\bootstrap\org\apache\ant\builder\*.java | |||||
REM run bootstrap | |||||
java -classpath bin\init;bin\bootstrap org.apache.ant.bootstrap.Bootstrap | |||||
REM run full build using bootstrapped version | |||||
java -classpath bootstrap\lib\start.jar;bootstrap\lib\init.jar org.apache.ant.start.Main %* | |||||
REM Use the full build as the build used by the build script | |||||
xcopy /s dist bootstrap |
@@ -4,7 +4,7 @@ | |||||
# reserved. | # reserved. | ||||
# cleanup curretn boot area | # cleanup curretn boot area | ||||
rm -rf bin bootstrap | |||||
rm -rf bin bootstrap dist | |||||
# compile init jar | # compile init jar | ||||
mkdir -p bin/init | mkdir -p bin/init | ||||
@@ -0,0 +1,5 @@ | |||||
@echo off | |||||
REM Copyright (c) 2000-2001 The Apache Software Foundation. All rights | |||||
REM reserved. | |||||
java -classpath bootstrap\lib\start.jar;bootstrap\lib\init.jar org.apache.ant.start.Main %* |
@@ -122,9 +122,12 @@ public class AntLibManager { | |||||
if (antLibrarySpec != null) { | if (antLibrarySpec != null) { | ||||
String libraryId = antLibrarySpec.getLibraryId(); | String libraryId = antLibrarySpec.getLibraryId(); | ||||
if (librarySpecs.containsKey(libraryId)) { | if (librarySpecs.containsKey(libraryId)) { | ||||
AntLibrarySpec currentSpec | |||||
= (AntLibrarySpec)librarySpecs.get(libraryId); | |||||
throw new ExecutionException("Found more than one " | throw new ExecutionException("Found more than one " | ||||
+ "copy of library with id = " + libraryId + | |||||
" (" + libURLs[i] + ")"); | |||||
+ "copy of library with id = " + libraryId | |||||
+ " (" + libURLs[i] + ") + existing library at (" | |||||
+ currentSpec.getLibraryURL() + ")"); | |||||
} | } | ||||
antLibrarySpec.setLibraryURL(libURLs[i]); | antLibrarySpec.setLibraryURL(libURLs[i]); | ||||
librarySpecs.put(libraryId, antLibrarySpec); | librarySpecs.put(libraryId, antLibrarySpec); | ||||
@@ -180,6 +183,28 @@ public class AntLibManager { | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Load either a set of libraries or a single library. | |||||
* | |||||
* @param libLocationURL URL where libraries can be found | |||||
* @param librarySpecs A collection of library specs which will be | |||||
* populated with the libraries found | |||||
* @exception ExecutionException if the libraries cannot be loaded | |||||
* @exception MalformedURLException if the library's location cannot be | |||||
* formed | |||||
*/ | |||||
public void loadLibs(Map librarySpecs, URL libLocationURL) | |||||
throws ExecutionException, MalformedURLException { | |||||
if (!libLocationURL.getProtocol().equals("file") | |||||
&& !remoteAllowed) { | |||||
throw new ExecutionException("The config library " | |||||
+ "location \"" + libLocationURL | |||||
+ "\" cannot be used because config does " | |||||
+ "not allow remote libraries"); | |||||
} | |||||
addAntLibraries(librarySpecs, libLocationURL); | |||||
} | |||||
/** | /** | ||||
* Load either a set of libraries or a single library. | * Load either a set of libraries or a single library. | ||||
* | * | ||||
@@ -196,15 +221,7 @@ public class AntLibManager { | |||||
File libLocation = new File(libLocationString); | File libLocation = new File(libLocationString); | ||||
if (!libLocation.exists()) { | if (!libLocation.exists()) { | ||||
try { | try { | ||||
URL libLocationURL = new URL(libLocationString); | |||||
if (!libLocationURL.getProtocol().equals("file") | |||||
&& !remoteAllowed) { | |||||
throw new ExecutionException("The config library " | |||||
+ "location \"" + libLocationString | |||||
+ "\" cannot be used because config does " | |||||
+ "not allow remote libraries"); | |||||
} | |||||
addAntLibraries(librarySpecs, libLocationURL); | |||||
loadLibs(librarySpecs, new URL(libLocationString)); | |||||
} catch (MalformedURLException e) { | } catch (MalformedURLException e) { | ||||
// XXX | // XXX | ||||
} | } | ||||
@@ -129,7 +129,7 @@ public class ExecutionManager { | |||||
AntLibManager libManager | AntLibManager libManager | ||||
= new AntLibManager(config.isRemoteLibAllowed()); | = new AntLibManager(config.isRemoteLibAllowed()); | ||||
libManager.addAntLibraries(librarySpecs, standardLibsURL); | |||||
libManager.loadLibs(librarySpecs, standardLibsURL); | |||||
libManager.configLibraries(initConfig, librarySpecs, antLibraries, | libManager.configLibraries(initConfig, librarySpecs, antLibraries, | ||||
config.getLibraryPathsMap()); | config.getLibraryPathsMap()); | ||||
@@ -161,6 +161,8 @@ public class ExecutionManager { | |||||
throws AntException { | throws AntException { | ||||
Throwable buildFailureCause = null; | Throwable buildFailureCause = null; | ||||
try { | try { | ||||
init(); | |||||
// start by validating the project we have been given. | // start by validating the project we have been given. | ||||
project.validate(); | project.validate(); | ||||
@@ -142,6 +142,7 @@ public class Builder { | |||||
files.add(new File(TASKDEFS_ROOT, "Available.java")); | files.add(new File(TASKDEFS_ROOT, "Available.java")); | ||||
files.add(new File(TASKDEFS_ROOT, "Mkdir.java")); | files.add(new File(TASKDEFS_ROOT, "Mkdir.java")); | ||||
files.add(new File(TASKDEFS_ROOT, "Copy.java")); | files.add(new File(TASKDEFS_ROOT, "Copy.java")); | ||||
files.add(new File(TASKDEFS_ROOT, "Echo.java")); | |||||
files.add(new File(TASKDEFS_ROOT, "MatchingTask.java")); | files.add(new File(TASKDEFS_ROOT, "MatchingTask.java")); | ||||
files.add(new File(DEPEND_ROOT, "Depend.java")); | files.add(new File(DEPEND_ROOT, "Depend.java")); | ||||
files.add(new File(DEPEND_ROOT, "ClassFile.java")); | files.add(new File(DEPEND_ROOT, "ClassFile.java")); | ||||
@@ -311,7 +311,6 @@ public class Commandline { | |||||
} | } | ||||
try { | try { | ||||
executionManager.init(); | |||||
executionManager.runBuild(project, targets, definedProperties); | executionManager.runBuild(project, targets, definedProperties); | ||||
System.exit(0); | System.exit(0); | ||||
} catch (Throwable t) { | } catch (Throwable t) { | ||||