Browse Source

Bootstrap files for Windows users

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271419 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
4d8702d1f4
7 changed files with 67 additions and 14 deletions
  1. +29
    -0
      proposal/mutant/bootstrap.bat
  2. +1
    -1
      proposal/mutant/bootstrap.sh
  3. +5
    -0
      proposal/mutant/build.bat
  4. +28
    -11
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/antlib/AntLibManager.java
  5. +3
    -1
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionManager.java
  6. +1
    -0
      proposal/mutant/src/java/bootstrap/org/apache/ant/builder/Builder.java
  7. +0
    -1
      proposal/mutant/src/java/cli/org/apache/ant/cli/Commandline.java

+ 29
- 0
proposal/mutant/bootstrap.bat View File

@@ -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

+ 1
- 1
proposal/mutant/bootstrap.sh View File

@@ -4,7 +4,7 @@
# reserved.

# cleanup curretn boot area
rm -rf bin bootstrap
rm -rf bin bootstrap dist

# compile init jar
mkdir -p bin/init


+ 5
- 0
proposal/mutant/build.bat View File

@@ -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 %*

+ 28
- 11
proposal/mutant/src/java/antcore/org/apache/ant/antcore/antlib/AntLibManager.java View File

@@ -122,9 +122,12 @@ public class AntLibManager {
if (antLibrarySpec != null) {
String libraryId = antLibrarySpec.getLibraryId();
if (librarySpecs.containsKey(libraryId)) {
AntLibrarySpec currentSpec
= (AntLibrarySpec)librarySpecs.get(libraryId);
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]);
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.
*
@@ -196,15 +221,7 @@ public class AntLibManager {
File libLocation = new File(libLocationString);
if (!libLocation.exists()) {
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) {
// XXX
}


+ 3
- 1
proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionManager.java View File

@@ -129,7 +129,7 @@ public class ExecutionManager {
AntLibManager libManager
= new AntLibManager(config.isRemoteLibAllowed());

libManager.addAntLibraries(librarySpecs, standardLibsURL);
libManager.loadLibs(librarySpecs, standardLibsURL);
libManager.configLibraries(initConfig, librarySpecs, antLibraries,
config.getLibraryPathsMap());

@@ -161,6 +161,8 @@ public class ExecutionManager {
throws AntException {
Throwable buildFailureCause = null;
try {
init();
// start by validating the project we have been given.
project.validate();



+ 1
- 0
proposal/mutant/src/java/bootstrap/org/apache/ant/builder/Builder.java View File

@@ -142,6 +142,7 @@ public class Builder {
files.add(new File(TASKDEFS_ROOT, "Available.java"));
files.add(new File(TASKDEFS_ROOT, "Mkdir.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(DEPEND_ROOT, "Depend.java"));
files.add(new File(DEPEND_ROOT, "ClassFile.java"));


+ 0
- 1
proposal/mutant/src/java/cli/org/apache/ant/cli/Commandline.java View File

@@ -311,7 +311,6 @@ public class Commandline {
}

try {
executionManager.init();
executionManager.runBuild(project, targets, definedProperties);
System.exit(0);
} catch (Throwable t) {


Loading…
Cancel
Save