| <?xml version="1.0"?> |
| |
| <!-- |
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in |
| compliance with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software distributed under the License is |
| distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| implied. See the License for the specific language governing permissions and limitations under the License. |
| |
| This work is copyright by the author(s) and is part of a greater work collectively copyright by the |
| Groovy community. See the NOTICE.txt file distributed with this work for additional information. |
| |
| Author : Paul King |
| $Revision$ ($LastChangedBy$) |
| $Date$ |
| --> |
| |
| <project name="build-maven" default="" basedir="../.." xmlns:artifact="urn:maven-artifact-ant"> |
| |
| <import file="build-setup.xml"/> |
| |
| <macrodef name="maven.dependencies"> |
| <attribute name="useScope"/> |
| <attribute name="filesetId"/> |
| <attribute name="pomRefId"/> |
| <sequential> |
| <artifact:dependencies useScope="@{useScope}" filesetId="@{filesetId}"> |
| <remoteRepository refid="ibiblio.remote.repository"/> |
| <remoteRepository refid="repo1.remote.repository"/> |
| <pom refid="@{pomRefId}"/> |
| </artifact:dependencies> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="fetch.maven"> |
| <attribute name="scope"/> |
| <attribute name="module"/> |
| <sequential> |
| <maven.dependencies useScope="@{scope}" filesetId="fs.@{scope}.@{module}" pomRefId="@{module}.pom"/> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="maven.pom"> |
| <attribute name="file"/> |
| <attribute name="id"/> |
| <sequential> |
| <artifact:pom file="@{file}" id="@{id}"/> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="fetch.maven.all.scopes"> |
| <attribute name="module"/> |
| <sequential> |
| <fetch.maven scope="compile" module="@{module}"/> |
| <fetch.maven scope="runtime" module="@{module}"/> |
| <fetch.maven scope="test" module="@{module}"/> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="fetch.maven.all.modules"> |
| <sequential> |
| <fetch.maven.all.scopes module="groovy"/> |
| <fetch.maven scope="runtime" module="groovy-tools"/> |
| <fetch.maven scope="runtime" module="groovy-examples"/> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="maven.remote.repository"> |
| <attribute name="id"/> |
| <attribute name="url"/> |
| <sequential> |
| <artifact:remoteRepository id="@{id}" url="@{url}"/> |
| </sequential> |
| </macrodef> |
| |
| <target name="-mavenInit" depends="-mavenTaskdef,-mavenPomDefinitions,-mavenRepositoryDefinitions"/> |
| |
| <target name="-mavenTaskdef"> |
| <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"> |
| <classpath> |
| <fileset dir="${bootstrapDirectory}" includes="maven-ant-tasks-*.jar"/> |
| </classpath> |
| </typedef> |
| </target> |
| |
| <target name="-mavenPomDefinitions"> |
| <maven.pom file="pom.xml" id="groovy.pom"/> |
| |
| <xslt in="pom.xml" out="${targetDirectory}/groovy-all.pom" style="config/maven/groovy-all.xsl"/> |
| <maven.pom file="${targetDirectory}/groovy-all.pom" id="groovy-all.pom"/> |
| |
| <xslt in="pom.xml" out="${targetDirectory}/groovy-all-minimal.pom" style="config/maven/groovy-all-minimal.xsl"/> |
| <maven.pom file="${targetDirectory}/groovy-all-minimal.pom" id="groovy-all-minimal.pom"/> |
| |
| <maven.pom file="config/maven/groovy-tools.pom" id="groovy-tools.pom"/> |
| <maven.pom file="config/maven/groovy-examples.pom" id="groovy-examples.pom"/> |
| </target> |
| |
| <target name="-mavenRepositoryDefinitions"> |
| <maven.remote.repository id="repo1.remote.repository" url="http://repo1.maven.org/maven2/"/> |
| <maven.remote.repository id="ibiblio.remote.repository" url="http://ibiblio.org/maven2/"/> |
| </target> |
| |
| <target name="-mavenFetchAllModules" depends="-mavenInit"> |
| <fetch.maven.all.modules/> |
| </target> |
| |
| <target name="-fetchDependencies" depends="-mavenFetchAllModules,-copyLibraries"/> |
| |
| <target name="-copyLibraries"> |
| <delete dir="${compileLibDirectory}"/> |
| <delete dir="${testLibDirectory}"/> |
| <delete dir="${runtimeLibDirectory}"/> |
| <delete dir="${toolsLibDirectory}"/> |
| <delete dir="${examplesLibDirectory}"/> |
| |
| <mkdir dir="${compileLibDirectory}"/> |
| <mkdir dir="${testLibDirectory}"/> |
| <mkdir dir="${runtimeLibDirectory}"/> |
| <mkdir dir="${toolsLibDirectory}"/> |
| <mkdir dir="${examplesLibDirectory}"/> |
| |
| <copy todir="${compileLibDirectory}"> |
| <mapper type="flatten"/> |
| <fileset refid="fs.compile.groovy"/> |
| </copy> |
| <path id="compilePath"> |
| <fileset dir="${compileLibDirectory}" includes="**/*.jar"/> |
| </path> |
| <copy todir="${testLibDirectory}"> |
| <mapper type="flatten"/> |
| <fileset refid="fs.test.groovy"/> |
| </copy> |
| <path id="testPath"> |
| <fileset dir="${testLibDirectory}" includes="**/*.jar"/> |
| </path> |
| <copy todir="${runtimeLibDirectory}"> |
| <mapper type="flatten"/> |
| <fileset refid="fs.runtime.groovy"/> |
| </copy> |
| <path id="runtimePath"> |
| <fileset dir="${runtimeLibDirectory}" includes="**/*.jar"/> |
| </path> |
| <copy todir="${toolsLibDirectory}"> |
| <mapper type="flatten"/> |
| <fileset refid="fs.runtime.groovy-tools"/> |
| </copy> |
| <path id="toolsPath"> |
| <fileset dir="${toolsLibDirectory}" includes="**/*.jar"/> |
| </path> |
| <copy todir="${examplesLibDirectory}"> |
| <mapper type="flatten"/> |
| <fileset refid="fs.runtime.groovy-examples"/> |
| </copy> |
| <path id="examplesPath"> |
| <fileset dir="${examplesLibDirectory}" includes="**/*.jar"/> |
| </path> |
| </target> |
| |
| <target name="-mavenDeployInit" depends="-mavenInit"> |
| <artifact:install-provider artifactId="wagon-webdav" version="1.0-beta-2"/> |
| </target> |
| |
| <macrodef name="mavenDeploy"> |
| <attribute name="version"/> |
| <attribute name="artifact"/> |
| <sequential> |
| <artifact:deploy file="${targetDistDirectory}/@{artifact}-@{version}.jar"> |
| <pom refid="@{artifact}.pom"/> |
| </artifact:deploy> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="mavenInstallRepo"> |
| <attribute name="version"/> |
| <attribute name="artifact"/> |
| <sequential> |
| <artifact:install file="${targetDistDirectory}/@{artifact}-@{version}.jar"> |
| <pom refid="@{artifact}.pom"/> |
| </artifact:install> |
| </sequential> |
| </macrodef> |
| |
| </project> |