| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You 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. |
| --> |
| <project xmlns:ivy="antlib:org.apache.ivy.ant" > |
| <property file="${basedir}/local.build.properties" /> |
| <property file="${ivy.repository.dir}/build.properties"/> |
| |
| <property name="ivy.install.version" value="2.2.0" /> |
| <condition property="ivy.home" value="${env.IVY_HOME}"> |
| <isset property="env.IVY_HOME" /> |
| </condition> |
| <property name="ivy.home" value="${user.home}/.ant" /> |
| <property name="ivy.jar.dir" value="${ivy.home}/lib" /> |
| <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" /> |
| |
| <property name="project.build.dir" location="build"/> |
| |
| <target name="download-ivy" unless="offline"> |
| |
| <mkdir dir="${ivy.jar.dir}"/> |
| <!-- download Ivy from web site so that it can be used even without any special installation --> |
| <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" |
| dest="${ivy.jar.file}" usetimestamp="true"/> |
| </target> |
| |
| <target name="init-ivy" depends="download-ivy"> |
| <!-- try to load ivy here from ivy home, in case the user has not already dropped |
| it into ant's lib dir (note that the latter copy will always take precedence). |
| We will not fail as long as local lib dir exists (it may be empty) and |
| ivy is in at least one of ant's lib dir or the local lib dir. --> |
| <path id="ivy.lib.path"> |
| <fileset dir="${ivy.jar.dir}" includes="*.jar"/> |
| |
| </path> |
| <taskdef resource="org/apache/ivy/ant/antlib.xml" |
| uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/> |
| </target> |
| |
| <target name="configure" depends="init-ivy"> |
| <ivy:settings id="ivy.instance" file="${ivy.repository.dir}/ivysettings.xml" /> |
| </target> |
| |
| <target name="resolve" depends="configure, clean-lib" description="--> retrieve dependencies with ivy"> |
| <ivy:resolve /> |
| </target> |
| |
| <target name="report" depends="resolve" description="--> generates a report of dependencies"> |
| <ivy:report todir="${build.dir}"/> |
| </target> |
| |
| <target name="clean-local" depends="configure" description="cleans the local repository for the current module"> |
| <delete dir="${ivy.local.default.root}/${ant.project.name}"/> |
| </target> |
| |
| <target name="clean-lib" description="--> clean the project libraries directory (dependencies)"> |
| <delete includeemptydirs="true" dir="${project.lib.dir}"/> |
| </target> |
| |
| <target name="clean-build" description="--> clean the project built files"> |
| <delete includeemptydirs="true" dir="${project.build.dir}"/> |
| </target> |
| |
| <target name="clean-dist" description="--> clean the project distribution files"> |
| <delete includeemptydirs="true" dir="${dist.dir}"/> |
| </target> |
| |
| <target name="clean" depends="clean-build, clean-lib" description="--> clean the project"/> |
| </project> |