jvanzyl 02/04/10 23:24:37
Modified: . build-bootstrap.xml
Log:
Overhauled the bootstrap and fully documented each of the stages.
Closer to having everything shunted into a single directory.
We can now add/remove JARs required for the bootstrap/build/install
in a single location -> jars.list.
Revision Changes Path
1.67 +200 -141 jakarta-turbine-maven/build-bootstrap.xml
Index: build-bootstrap.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/build-bootstrap.xml,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- build-bootstrap.xml 10 Apr 2002 13:15:43 -0000 1.66
+++ build-bootstrap.xml 11 Apr 2002 06:24:37 -0000 1.67
@@ -1,75 +1,210 @@
<?xml version="1.0"?>
-<!--
-
-. check and make sure ${lib.repo} has been defined
-
--->
-
<project name="Maven" default="generate-build" basedir=".">
<!-- Allow any user specific values to override the defaults -->
<property file="${user.home}/build.properties" />
<property file="project.properties"/>
-
<property name="get.jars.baseUrl" value="http://jakarta.apache.org/turbine/jars"
/>
- <path id="classpath">
- <pathelement location="${lib.repo}/dom4j-1.3.jar"/>
- <pathelement location="${lib.repo}/commons-util-1.0-rc2-dev.jar"/>
- <pathelement location="${lib.repo}/commons-lang-0.1-dev.jar"/>
- <pathelement location="${lib.repo}/commons-beanutils.jar"/>
- <pathelement location="${lib.repo}/commons-collections.jar"/>
- <pathelement location="${lib.repo}/commons-io.jar"/>
- <pathelement location="${lib.repo}/commons-graph.jar"/>
- <pathelement location="${lib.repo}/log4j-1.1.3.jar"/>
- <pathelement location="${lib.repo}/stratum-1.0-b2-dev.jar"/>
- <pathelement location="${lib.repo}/velocity-1.3-dev.jar"/>
- <pathelement location="${basedir}/bootstrap"/>
- </path>
+ <!-- ================================================================== -->
+ <!-- P R O P E R T I E S C H E C K -->
+ <!-- ================================================================== -->
+ <!-- In order to bootstrap Maven you must have the following -->
+ <!-- properties defined in order for the bootstrap to work -->
+ <!-- correctly: -->
+ <!-- -->
+ <!-- ${lib.repo} : Local JAR repository -->
+ <!-- ${maven.home}: Maven installation directory -->
+ <!-- ================================================================== -->
+
+ <target
+ name="check-properties"
+ depends="check-lib-repo">
+ </target>
+
+ <target
+ name="check-lib-repo"
+ depends="check-maven-home"
+ unless="lib.repo">
+ <fail>
+ +------------------------------------------------------------------
+ | You must set ${lib.repo} in your ${user.home}/build.properties
+ |
+ | Please refer to the bootstrap document:
+ | http://jakarta.apache.org/turbine/maven/bootstrap.html
+ +------------------------------------------------------------------
+ </fail>
+ </target>
+
+ <target
+ name="check-maven-home"
+ unless="maven.home">
+ <fail>
+ +------------------------------------------------------------------
+ | You must set ${maven.home} in your ${user.home}/build.properties
+ |
+ | Please refer to the bootstrap document:
+ | http://jakarta.apache.org/turbine/maven/bootstrap.html
+ +------------------------------------------------------------------
+ </fail>
+ </target>
<!-- ================================================================== -->
<!-- D E F A U L T B O O T S T R A P -->
<!-- ================================================================== -->
+
<target
name="bootstrap"
+ depends="check-properties"
description="--> Update local jars, generate maven's build system, generate
maven, and setup the distributions.">
- <antcall target="update-jars"/>
- <antcall target="generate-build"/>
- <ant antfile="build.xml" target="maven:update-jars"/>
- <ant antfile="build.xml" target="maven:clean"/>
- <ant antfile="build.xml" target="maven:jar"/>
- <antcall target="dist"/>
- <ant dir="${maven.home}/install"/>
-
+ <antcall target="update-jars"/>
+ <antcall target="generate-build"/>
+ <ant antfile="build.xml" target="maven:clean"/>
+ <ant antfile="build.xml" target="maven:jar"/>
+ <antcall target="dist"/>
+ <ant dir="${maven.home}/install"/>
</target>
<!-- ================================================================== -->
<!-- G E N E R A T E B U I L D S Y S T E M -->
<!-- ================================================================== -->
+ <!-- Generate the Maven build system. The Maven build system is -->
+ <!-- created by processing a set of velocity templates to produce -->
+ <!-- the final set of Ant build files used by all Maven projects. -->
+ <!-- ================================================================== -->
<target
- name="compile">
+ name="generate-build"
+ depends="phase2-compile">
- <!-- Remove the elements of past generations before creating
- the new one.
- -->
+ <delete dir="${basedir}/maven"/>
+ <mkdir dir="${basedir}/maven"/>
+
+ <taskdef
+ name="create-build-system"
+ classname="org.apache.maven.BaseProjectTask">
+ <classpath>
+ <path refid="bootstrap-classpath"/>
+ <pathelement location="${basedir}/bootstrap"/>
+ </classpath>
+ </taskdef>
+
+ <create-build-system
+ controlTemplate="Control.vm"
+ outputDirectory="${basedir}"
+ templatePath="src/templates/build"
+ outputFile="bootstrap.report"
+ projectDescriptor="project.xml"
+ listFile="jars.list"
+ />
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- G E T B O O T S T R A P J A R S -->
+ <!-- ================================================================== -->
+ <!-- Get JARs the hard way when bootstrapping maven the easy way isn't -->
+ <!-- available until maven is built. -->
+ <!-- ================================================================== -->
+
+ <path id="pre-bootstrap-classpath">
+ <pathelement location="${basedir}/bootstrap"/>
+ </path>
+
+ <target
+ name="update-jars"
+ depends="phase1-compile">
+
+ <taskdef
+ name="get-list"
+ classname="org.apache.maven.GetList">
+ <classpath refid="pre-bootstrap-classpath"/>
+ </taskdef>
+
+ <get-list
+ listFile="jars.list"
+ dest="${lib.repo}"
+ baseUrl="${get.jars.baseUrl}/"
+ />
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- P H A S E 1 C O M P I L E -->
+ <!-- ================================================================== -->
+ <!-- We need to compile a few basic tasks that allow us to work from -->
+ <!-- the jars.list file. This allows us to maintain Maven's -->
+ <!-- requirements in a single location. -->
+ <!-- -->
+ <!-- 1. GetList: Allows us to download a list of JARs into a specified -->
+ <!-- directory. Used to pull down the JARs to build Maven before -->
+ <!-- we have use of the POM. -->
+ <!-- -->
+ <!-- 2. CreateClasspath: Allows us to create a class from a list of -->
+ <!-- JARs. Used in the phase2-compile which compiles the classes -->
+ <!-- required to generate the build system. -->
+ <!-- -->
+ <!-- 3. CreatePatternSet: Allows us to create a patternset that can -->
+ <!-- be used within a fileset definition. Used in the dist to -->
+ <!-- copy the JARs specified in our jars.list into the Maven -->
+ <!-- distribution. -->
+ <!-- ================================================================== -->
+
+ <target
+ name="phase1-compile">
<delete dir="${basedir}/bootstrap"/>
<mkdir dir="${basedir}/bootstrap"/>
- <!-- Create the bootstrap classpath from our list of JARs
- required to make the bootstrap go.
- -->
+ <javac
+ destdir="${basedir}/bootstrap"
+ debug="${debug}"
+ deprecation="${deprecation}"
+ optimize="${optimize}">
+ <src>
+ <path location="src/java"/>
+ </src>
+ <include name="org/apache/maven/GetList.java"/>
+ <include name="org/apache/maven/CreateClasspath.java"/>
+ <include name="org/apache/maven/CreatePatternSet.java"/>
+ </javac>
+
+ </target>
+ <!-- ================================================================== -->
+ <!-- P H A S E 2 C O M P I L E -->
+ <!-- ================================================================== -->
+ <!-- Compile the classes that are needed to generate the Maven -->
+ <!-- build system. -->
+ <!-- ================================================================== -->
+
+ <target
+ name="phase2-compile"
+ depends="phase1-compile">
+
+ <taskdef
+ name="create-classpath"
+ classname="org.apache.maven.CreateClasspath">
+ <classpath>
+ <pathelement location="${basedir}/bootstrap"/>
+ </classpath>
+ </taskdef>
+
+ <create-classpath
+ listFile="jars.list"
+ reference="bootstrap-classpath"
+ baseDir="${lib.repo}"
+ />
+
<javac
destdir="${basedir}/bootstrap"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
- <classpath refid="classpath"/>
+ <classpath refid="bootstrap-classpath"/>
<src>
<path location="src/java"/>
</src>
@@ -86,32 +221,17 @@
</target>
- <target
- name="generate-build"
- depends="compile">
-
- <!-- Remove any previously generated build systems -->
- <delete dir="${basedir}/maven"/>
- <mkdir dir="${basedir}/maven"/>
-
- <echo>
- maven.home = ${maven.home}
- </echo>
+ <!-- ================================================================== -->
+ <!-- D I S T R I B U T I O N S -->
+ <!-- ================================================================== -->
+ <!-- This target is used to produce the JAR file for the -->
+ <!-- InstallAnywhere installer and the JAR file that can be used to -->
+ <!-- manually install Maven. -->
+ <!-- ================================================================== -->
- <taskdef
- name="create-build-system"
- classname="org.apache.maven.BaseProjectTask">
- <classpath refid="classpath"/>
- </taskdef>
+ <target
+ name="dist">
- <create-build-system
- controlTemplate="Control.vm"
- outputDirectory="${basedir}"
- templatePath="src/templates/build"
- outputFile="bootstrap.report"
- projectDescriptor="project.xml"
- />
-
<delete dir="${maven.home}"/>
<mkdir dir="${maven.home}"/>
@@ -156,43 +276,28 @@
<copy todir="${maven.home}/images">
<fileset dir="src/images"/>
</copy>
-
- </target>
-
- <!-- ================================================================== -->
- <!-- C R E A T E J A R D I S T R I B U T I O N S -->
- <!-- ================================================================== -->
- <!-- This target is used to produce the JAR file for the -->
- <!-- InstallAnywhere installer and the JAR file that can be used to -->
- <!-- manually install Maven. -->
- <!-- ================================================================== -->
-
- <target
- name="dist">
<mkdir dir="${maven.home}/install"/>
- <copy todir="${maven.home}/install" file="project.xml"/>
- <copy tofile="${maven.home}/install/maven.jar"
file="target/maven-1.0-b3-dev.jar"/>
+ <copy tofile="${maven.home}/install/maven.jar" file="target/maven.jar"/>
<copy todir="${maven.home}/install" file="src/install/build.xml"/>
+
+ <taskdef
+ name="create-patternset"
+ classname="org.apache.maven.CreatePatternSet">
+ <classpath>
+ <pathelement location="target/classes"/>
+ </classpath>
+ </taskdef>
+ <create-patternset
+ listFile="jars.list"
+ reference="install-patternset"
+ />
+
<copy todir="${maven.home}/install">
<fileset dir="${lib.repo}">
- <include name="dom4j-1.3.jar"/>
- <include name="commons-util-1.0-rc2-dev.jar"/>
- <include name="commons-lang-0.1-dev.jar"/>
- <include name="commons-beanutils.jar"/>
- <include name="commons-collections.jar"/>
- <include name="commons-io.jar"/>
- <include name="commons-graph.jar"/>
- <include name="log4j-1.1.3.jar"/>
- <include name="stratum-1.0-b2-dev.jar"/>
- <include name="velocity-1.3-dev.jar"/>
- <include name="velocity-dvsl-0.43.jar"/>
- <include name="jdepend.jar"/>
- <include name="checkstyle-2.2.jar"/>
- <include name="antlr.jar"/>
- <include name="regexp-1.2.jar"/>
+ <patternset refid="install-patternset"/>
</fileset>
</copy>
@@ -225,53 +330,16 @@
</target>
<!-- ================================================================== -->
- <!-- G E T B O O T S T R A P J A R S -->
- <!-- ================================================================== -->
- <!-- Get JARs the hard way when bootstrapping maven the easy way isn't -->
- <!-- available until maven is built. -->
- <!-- ================================================================== -->
-
- <path id="pre-bootstrap-classpath">
- <pathelement location="${basedir}/bootstrap"/>
- </path>
-
- <target
- name="update-jars">
-
- <delete dir="${basedir}/bootstrap"/>
- <mkdir dir="${basedir}/bootstrap"/>
-
- <javac
- destdir="${basedir}/bootstrap"
- debug="${debug}"
- deprecation="${deprecation}"
- optimize="${optimize}">
- <src>
- <path location="src/java"/>
- </src>
- <include name="org/apache/maven/GetList.java"/>
- </javac>
-
- <taskdef
- name="get-list"
- classname="org.apache.maven.GetList">
- <classpath refid="pre-bootstrap-classpath"/>
- </taskdef>
-
- <get-list
- list="jars.list"
- dest="${lib.repo}"
- baseUrl="${get.jars.baseUrl}/"
- />
-
- </target>
-
- <!-- ================================================================== -->
<!-- P A C K A G E T O P R O J E C T M A P -->
<!-- ================================================================== -->
<!-- Create the map used to resolve package references into -->
<!-- project references. Used in the process of analysing sources to -->
<!-- determine overall project dependencies. -->
+ <!-- -->
+ <!-- In order to run this target you must have the jakarta-alexandria -->
+ <!-- module checked out in parallel with the jakarta-turbine-maven -->
+ <!-- module. The Gump descriptors are transformed first and the -->
+ <!-- resultant Maven descriptors are processed. -->
<!-- ================================================================== -->
<target
@@ -286,15 +354,6 @@
</classpath>
</taskdef>
- <!-- Create the package => project map so that we can
- turn set of class references into a set of
- project references in order to create an accurate
- project descriptor.
-
- The projects descriptors must exist first so
- we'll trigger the conversion here.
- -->
-
<ant dir="src/descriptors"/>
<package-project-map