o Replaced tabs with spaces

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@778307 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-05-25 06:40:34 +00:00
parent 23c1601b77
commit 88aa26ab45
1 changed files with 188 additions and 188 deletions

376
build.xml
View File

@ -31,218 +31,218 @@ END SNIPPET: ant-bootstrap -->
<project default="all" basedir="." xmlns:artifact="urn:maven-artifact-ant"> <project default="all" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<property name="it.workdir.version" value="3.0.x" /> <property name="it.workdir.version" value="3.0.x" />
<target name="initTaskDefs"> <target name="initTaskDefs">
<xmlproperty file="pom.xml" prefix="pom.xml" /> <xmlproperty file="pom.xml" prefix="pom.xml" />
<path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1-SNAPSHOT.jar" /> <path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1-SNAPSHOT.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" /> <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
</target> </target>
<target name="isMavenHomeSet" depends="initTaskDefs"> <target name="isMavenHomeSet" depends="initTaskDefs">
<property environment="env" /> <property environment="env" />
<condition property="maven.home" value="${env.M2_HOME}"> <condition property="maven.home" value="${env.M2_HOME}">
<isset property="env.M2_HOME" /> <isset property="env.M2_HOME" />
</condition> </condition>
<fail message="You must set the M2_HOME environment variable or specify a maven.home property to this Ant script"> <fail message="You must set the M2_HOME environment variable or specify a maven.home property to this Ant script">
<condition> <condition>
<or> <or>
<not> <not>
<isset property="maven.home" /> <isset property="maven.home" />
</not> </not>
<equals arg1="${maven.home}" arg2="" trim="true" /> <equals arg1="${maven.home}" arg2="" trim="true" />
</or> </or>
</condition> </condition>
</fail> </fail>
</target> </target>
<target name="init" depends="isMavenHomeSet"> <target name="init" depends="isMavenHomeSet">
<xmlproperty prefix="pom" file="pom.xml" /> <xmlproperty prefix="pom" file="pom.xml" />
<dirname file="${maven.home}" property="maven.home.dirname" /> <dirname file="${maven.home}" property="maven.home.dirname" />
<!-- Initialize properties --> <!-- Initialize properties -->
<property name="maven.home.basename.expected" value="apache-maven-${pom.project.version}" /> <property name="maven.home.basename.expected" value="apache-maven-${pom.project.version}" />
<property name="maven.home.effective" location="${maven.home.dirname}/${maven.home.basename.expected}" /> <property name="maven.home.effective" location="${maven.home.dirname}/${maven.home.basename.expected}" />
<property name="maven.assembly" location="apache-maven/target/${maven.home.basename.expected}-bin.zip" /> <property name="maven.assembly" location="apache-maven/target/${maven.home.basename.expected}-bin.zip" />
<property name="maven.repo.local" value="${user.home}/.m2/repository" /> <property name="maven.repo.local" value="${user.home}/.m2/repository" />
<property name="maven.debug" value="-e" /> <property name="maven.debug" value="-e" />
<property name="maven.test.skip" value="false" /> <property name="maven.test.skip" value="false" />
<!-- TODO: Change this default back to false once we're done --> <!-- TODO: Change this default back to false once we're done -->
<property name="surefire.useFile" value="true" /> <property name="surefire.useFile" value="true" />
<echo>maven.home = ${maven.home.effective}</echo> <echo>maven.home = ${maven.home.effective}</echo>
<echo>maven.repo.local = ${maven.repo.local}</echo> <echo>maven.repo.local = ${maven.repo.local}</echo>
</target> </target>
<target name="clean-bootstrap" description="cleans up generated bootstrap classes"> <target name="clean-bootstrap" description="cleans up generated bootstrap classes">
<delete dir="bootstrap" /> <delete dir="bootstrap" />
</target> </target>
<target name="pull" depends="init" unless="skip.pull"> <target name="pull" depends="init" unless="skip.pull">
<property name="verbose" value="false" /> <property name="verbose" value="false" />
<!-- Pull the dependencies that Maven needs to build --> <!-- Pull the dependencies that Maven needs to build -->
<copy file="pom.xml" tofile="dependencies.xml" /> <copy file="pom.xml" tofile="dependencies.xml" />
<replace file="${basedir}/dependencies.xml" token="&lt;!--bootstrap-start-comment--&gt;" value="&lt;!--" /> <replace file="${basedir}/dependencies.xml" token="&lt;!--bootstrap-start-comment--&gt;" value="&lt;!--" />
<replace file="${basedir}/dependencies.xml" token="&lt;!--bootstrap-end-comment--&gt;" value="--&gt;" /> <replace file="${basedir}/dependencies.xml" token="&lt;!--bootstrap-end-comment--&gt;" value="--&gt;" />
<artifact:pom file="${basedir}/dependencies.xml" id="pom" /> <artifact:pom file="${basedir}/dependencies.xml" id="pom" />
<artifact:dependencies pathId="pom.pathid" filesetId="pom.fileset" verbose="${verbose}" useScope="compile"> <artifact:dependencies pathId="pom.pathid" filesetId="pom.fileset" verbose="${verbose}" useScope="compile">
<localRepository path="${maven.repo.local}" /> <localRepository path="${maven.repo.local}" />
<pom refid="pom" /> <pom refid="pom" />
</artifact:dependencies> </artifact:dependencies>
<delete file="${basedir}/dependencies.xml" /> <delete file="${basedir}/dependencies.xml" />
<!-- Pull the dependencies for Modello --> <!-- Pull the dependencies for Modello -->
<artifact:dependencies pathId="modello.pathid" filesetId="modello.fileset" verbose="${verbose}"> <artifact:dependencies pathId="modello.pathid" filesetId="modello.fileset" verbose="${verbose}">
<localRepository path="${maven.repo.local}" /> <localRepository path="${maven.repo.local}" />
<dependency groupId="org.codehaus.modello" artifactId="modello-maven-plugin" version="${pom.properties.modelloVersion}" /> <dependency groupId="org.codehaus.modello" artifactId="modello-maven-plugin" version="${pom.properties.modelloVersion}" />
</artifact:dependencies> </artifact:dependencies>
<!-- Pull the dependencies for the MetadataGenerator CLI --> <!-- Pull the dependencies for the MetadataGenerator CLI -->
<artifact:dependencies pathId="pmdg.pathid" filesetId="pmdg.fileset" verbose="${verbose}"> <artifact:dependencies pathId="pmdg.pathid" filesetId="pmdg.fileset" verbose="${verbose}">
<localRepository path="${maven.repo.local}" /> <localRepository path="${maven.repo.local}" />
<dependency groupId="org.codehaus.plexus" artifactId="plexus-component-metadata" version="${pom.properties.plexusVersion}" /> <dependency groupId="org.codehaus.plexus" artifactId="plexus-component-metadata" version="${pom.properties.plexusVersion}" />
</artifact:dependencies> </artifact:dependencies>
</target> </target>
<target name="process-classes" depends="pull" description="generates plexus component metadata."> <target name="process-classes" depends="pull" description="generates plexus component metadata.">
<mkdir dir="${basedir}/bootstrap/target" /> <mkdir dir="${basedir}/bootstrap/target" />
<mkdir dir="${basedir}/bootstrap/target/classes" /> <mkdir dir="${basedir}/bootstrap/target/classes" />
<path id="maven.classpath"> <path id="maven.classpath">
<pathelement location="bootstrap/target/classes" /> <pathelement location="bootstrap/target/classes" />
<path refid="sources" /> <path refid="sources" />
<path refid="pom.pathid" /> <path refid="pom.pathid" />
<path refid="pmdg.pathid" /> <path refid="pmdg.pathid" />
</path> </path>
<echo>Using plexus version ${pom.properties.plexusVersion}</echo> <echo>Using plexus version ${pom.properties.plexusVersion}</echo>
<java fork="fork" classname="org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" failonerror="true"> <java fork="fork" classname="org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" failonerror="true">
<classpath refid="maven.classpath" /> <classpath refid="maven.classpath" />
<!-- We need to generate component descriptors from the maven-artifact sources which use javadoc annotations. --> <!-- We need to generate component descriptors from the maven-artifact sources which use javadoc annotations. -->
<arg value="--source" /> <arg value="--source" />
<arg value="${basedir}/maven-compat/src/main/java" /> <arg value="${basedir}/maven-compat/src/main/java" />
<!-- We have separated the artifact handlers and lifecycle mappings into a separate file. --> <!-- We have separated the artifact handlers and lifecycle mappings into a separate file. -->
<arg value="--descriptors" /> <arg value="--descriptors" />
<arg value="${basedir}/maven-core/src/main/resources/META-INF/plexus" /> <arg value="${basedir}/maven-core/src/main/resources/META-INF/plexus" />
<!-- Search the classes for annotations that we've compiled. --> <!-- Search the classes for annotations that we've compiled. -->
<arg value="--classes" /> <arg value="--classes" />
<arg value="${basedir}/bootstrap/target/classes" /> <arg value="${basedir}/bootstrap/target/classes" />
<!-- We'll make one big fat components descriptor. --> <!-- We'll make one big fat components descriptor. -->
<arg value="--output" /> <arg value="--output" />
<arg value="${basedir}/bootstrap/target/classes/META-INF/plexus/components.xml" /> <arg value="${basedir}/bootstrap/target/classes/META-INF/plexus/components.xml" />
</java> </java>
</target> </target>
<target name="generate-sources" depends="pull" description="generates Java sources from Modello mdo model files"> <target name="generate-sources" depends="pull" description="generates Java sources from Modello mdo model files">
<mkdir dir="bootstrap/target" /> <mkdir dir="bootstrap/target" />
<mkdir dir="bootstrap/target/generated-sources" /> <mkdir dir="bootstrap/target/generated-sources" />
<macrodef name="modello-single-mode"> <macrodef name="modello-single-mode">
<attribute name="file" /> <attribute name="file" />
<attribute name="mode" /> <attribute name="mode" />
<attribute name="version" /> <attribute name="version" />
<sequential> <sequential>
<java fork="fork" classname="org.codehaus.modello.ModelloCli" failonerror="true"> <java fork="fork" classname="org.codehaus.modello.ModelloCli" failonerror="true">
<classpath refid="modello.pathid" /> <classpath refid="modello.pathid" />
<arg file="@{file}" /> <arg file="@{file}" />
<!-- model file --> <!-- model file -->
<arg value="@{mode}" /> <arg value="@{mode}" />
<!-- output type --> <!-- output type -->
<arg file="bootstrap/target/generated-sources" /> <arg file="bootstrap/target/generated-sources" />
<!-- output directory --> <!-- output directory -->
<arg value="@{version}" /> <arg value="@{version}" />
<!-- model version --> <!-- model version -->
<arg value="false" /> <arg value="false" />
<!-- package with version --> <!-- package with version -->
<arg value="true" /> <arg value="true" />
<!-- use Java 5 --> <!-- use Java 5 -->
<arg value="UTF-8" /> <arg value="UTF-8" />
<!-- encoding --> <!-- encoding -->
</java> </java>
</sequential> </sequential>
</macrodef> </macrodef>
<macrodef name="modello"> <macrodef name="modello">
<attribute name="file" /> <attribute name="file" />
<attribute name="version" default="1.0.0" /> <attribute name="version" default="1.0.0" />
<sequential> <sequential>
<echo taskname="modello" message="Generating sources for @{file}" /> <echo taskname="modello" message="Generating sources for @{file}" />
<modello-single-mode file="@{file}" version="@{version}" mode="java" /> <modello-single-mode file="@{file}" version="@{version}" mode="java" />
<modello-single-mode file="@{file}" version="@{version}" mode="xpp3-reader" /> <modello-single-mode file="@{file}" version="@{version}" mode="xpp3-reader" />
<modello-single-mode file="@{file}" version="@{version}" mode="xpp3-writer" /> <modello-single-mode file="@{file}" version="@{version}" mode="xpp3-writer" />
</sequential> </sequential>
</macrodef> </macrodef>
<modello file="maven-model/src/main/mdo/maven.mdo" version="4.0.0" /> <modello file="maven-model/src/main/mdo/maven.mdo" version="4.0.0" />
<modello file="maven-plugin-api/src/main/mdo/lifecycle.mdo" /> <modello file="maven-plugin-api/src/main/mdo/lifecycle.mdo" />
<modello file="maven-model-builder/src/main/mdo/profiles.mdo" /> <modello file="maven-model-builder/src/main/mdo/profiles.mdo" />
<modello file="maven-core/src/main/mdo/settings.mdo" /> <modello file="maven-core/src/main/mdo/settings.mdo" />
<modello file="maven-toolchain/src/main/mdo/toolchains.mdo" /> <modello file="maven-toolchain/src/main/mdo/toolchains.mdo" />
<modello file="maven-compat/src/main/mdo/metadata.mdo" /> <modello file="maven-compat/src/main/mdo/metadata.mdo" />
</target> </target>
<target name="compile-boot" depends="generate-sources" description="compiles the bootstrap sources"> <target name="compile-boot" depends="generate-sources" description="compiles the bootstrap sources">
<path id="sources"> <path id="sources">
<dirset dir="."> <dirset dir=".">
<include name="bootstrap/target/generated-sources" /> <include name="bootstrap/target/generated-sources" />
<include name="*/src/main/*" /> <include name="*/src/main/*" />
</dirset> </dirset>
</path> </path>
<mkdir dir="bootstrap/target/classes" /> <mkdir dir="bootstrap/target/classes" />
<javac destdir="bootstrap/target/classes" encoding="UTF-8" source="1.5" target="1.5" debug="true"> <javac destdir="bootstrap/target/classes" encoding="UTF-8" source="1.5" target="1.5" debug="true">
<src refid="sources" /> <src refid="sources" />
<classpath refid="pom.pathid" /> <classpath refid="pom.pathid" />
</javac> </javac>
<path id="maven.classpath"> <path id="maven.classpath">
<pathelement location="bootstrap/target/classes" /> <pathelement location="bootstrap/target/classes" />
<pathelement location="maven-compat/src/main/resources" /> <pathelement location="maven-compat/src/main/resources" />
<path refid="sources" /> <path refid="sources" />
<path refid="pom.pathid" /> <path refid="pom.pathid" />
</path> </path>
</target> </target>
<target name="maven-compile" depends="compile-boot,process-classes" description="compiles Maven using the bootstrap Maven, skipping automated tests"> <target name="maven-compile" depends="compile-boot,process-classes" description="compiles Maven using the bootstrap Maven, skipping automated tests">
<java fork="true" classname="org.apache.maven.cli.MavenCli" failonerror="true"> <java fork="true" classname="org.apache.maven.cli.MavenCli" failonerror="true">
<classpath refid="maven.classpath" /> <classpath refid="maven.classpath" />
<arg value="${maven.debug}" /> <arg value="${maven.debug}" />
<arg value="-B" /> <arg value="-B" />
<arg value="-X" /> <arg value="-X" />
<arg value="-e" /> <arg value="-e" />
<arg value="clean" /> <arg value="clean" />
<arg value="install" /> <arg value="install" />
<arg value="-Dmaven.test.skip=${maven.test.skip}" /> <arg value="-Dmaven.test.skip=${maven.test.skip}" />
<arg value="-Dmaven.repo.local=${maven.repo.local}" /> <arg value="-Dmaven.repo.local=${maven.repo.local}" />
<arg value="-Dsurefire.useFile=${surefire.useFile}" /> <arg value="-Dsurefire.useFile=${surefire.useFile}" />
</java> </java>
</target> </target>
<target name="maven-assembly" depends="maven-compile" description="generates the Maven installation assembly using the bootstrap Maven"> <target name="maven-assembly" depends="maven-compile" description="generates the Maven installation assembly using the bootstrap Maven">
<echo> <echo>
The new Maven distribution was created as part of the MAVEN-COMPILE step, above. The new Maven distribution was created as part of the MAVEN-COMPILE step, above.
This goal just validates the presence of that distribution. This goal just validates the presence of that distribution.
</echo> </echo>
<condition property="build.failed"> <condition property="build.failed">
<not> <not>
<available file="${maven.assembly}" /> <available file="${maven.assembly}" />
</not> </not>
</condition> </condition>
<fail if="build.failed" message="Assembly task seemed to succeed, but couldn't find assembly file: ${maven.assembly}" /> <fail if="build.failed" message="Assembly task seemed to succeed, but couldn't find assembly file: ${maven.assembly}" />
</target> </target>
<target name="extract-assembly" depends="init,maven-assembly" description="extracts the maven assembly into maven.home"> <target name="extract-assembly" depends="init,maven-assembly" description="extracts the maven assembly into maven.home">
<echo>Extracting assembly to ${maven.home.dirname} ...</echo> <echo>Extracting assembly to ${maven.home.dirname} ...</echo>
<!-- If we are starting from scratch make sure the directory is created --> <!-- If we are starting from scratch make sure the directory is created -->
<delete dir="${maven.home.effective}" /> <delete dir="${maven.home.effective}" />
<mkdir dir="${maven.home.effective}" /> <mkdir dir="${maven.home.effective}" />
<unzip src="${maven.assembly}" dest="${maven.home.dirname}" /> <unzip src="${maven.assembly}" dest="${maven.home.dirname}" />
<chmod perm="+x"> <chmod perm="+x">
<fileset dir="${maven.home.effective}/bin"> <fileset dir="${maven.home.effective}/bin">
<include name="mvn" /> <include name="mvn" />
</fileset> </fileset>
</chmod> </chmod>
</target> </target>
<target name="all" depends="clean-bootstrap,init,extract-assembly" /> <target name="all" depends="clean-bootstrap,init,extract-assembly" />
</project> </project>