diff options
| author | Robert Gemmell <robbie@apache.org> | 2012-05-11 15:36:49 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2012-05-11 15:36:49 +0000 |
| commit | ed95fde2dc61790686a98106ad1fbd8ff15a510a (patch) | |
| tree | f226507c5002ec0da3660f1ffc52d9c42867b915 /qpid/java/common.xml | |
| parent | 627984e1ae185bfeae12ad8c1d5f5e2024f7f414 (diff) | |
| download | qpid-python-ed95fde2dc61790686a98106ad1fbd8ff15a510a.tar.gz | |
QPID-3994: use Ivy to download the main component dependencies during the build, and the optional bdb-je dependency on request, enabling removal of the main component dependencies from the repository and the 'source release' artifacts.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1337211 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common.xml')
| -rw-r--r-- | qpid/java/common.xml | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/qpid/java/common.xml b/qpid/java/common.xml index 2059e0aeb9..fbb17d7412 100644 --- a/qpid/java/common.xml +++ b/qpid/java/common.xml @@ -18,7 +18,7 @@ - under the License. - --> -<project name="common"> +<project xmlns:ivy="antlib:org.apache.ivy.ant" name="common"> <dirname property="project.root" file="${ant.file.common}"/> @@ -82,6 +82,7 @@ </fileset> </path> + <!-- properties for generating the maven artifacts --> <property name="maven.local.repo" value="${build.scratch}/maven-local-repo"/> <property name="maven.settings.xml" value="${project.root}/maven-settings.xml"/> <property name="maven.unique.version" value="false"/> @@ -90,6 +91,40 @@ <isfalse value="${maven.snapshot}"/> </condition> + <!-- properties for uploading our Maven artifacts to Nexus using Ivy --> + <property name="ivy.organisation" value="org/apache"/> + <property name="nexus.organisation" value="org.apache"/> + <property name="nexus.host" value="repository.apache.org"/> + <property name="nexus.upload.url" value="https://${nexus.host}/service/local/staging/deploy/maven2"/> + + <!-- properties for downloading ivy, and then our dependencies --> + <property name="ivy.jar.dir" value="${project.root}/lib/ivy" /> + <property name="ivy.install.version" value="2.2.0" /> + <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" /> + <property name="ivy.repo.url" value="http://repo1.maven.org/maven2/org/apache/ivy/ivy"/> + <property name="ivy.jar.url" value="${ivy.repo.url}/${ivy.install.version}/ivy-${ivy.install.version}.jar"/> + + <available property="ivy.jar.file.exists" file="${ivy.jar.file}"/> + <property name="retrieve.dependencies" value="true" /> + <property name="optional.dependencies" value="false" /> + + <condition property="dont.download.ivy"> + <!-- Set prop to stop Ivy download if asked not to retrieve + the dependencies, or the ivy jar is already present --> + <or> + <isfalse value="${retrieve.dependencies}"/> + <and> + <isset property="ivy.jar.file.exists"/> + <istrue value="${ivy.jar.file.exists}"/> + </and> + </or> + </condition> + + <condition property="ivy.dont.retrieve"> + <isfalse value="${retrieve.dependencies}"/> + </condition> + + <macrodef name="indirect"> <attribute name="name"/> <attribute name="variable"/> @@ -141,7 +176,7 @@ <attribute name="path"/> <element name="args"/> <sequential> - <java jar="${project.root}/lib/jython-2.5.0.jar" fork="true" failonerror="true"> + <java jar="${project.root}/lib/required/jython-standalone-2.5.2.jar" fork="true" failonerror="true"> <arg value="-Dpython.path=@{path}"/> <args/> </java> @@ -221,6 +256,39 @@ <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${findbugs.dir}/findbugs-ant.jar"/> </target> + + <!-- targets for downloading ivy and retrieving dependencies --> + <target name="retrieve-dependencies" depends="load-ivy, configure-ivy" unless="${ivy.dont.retrieve}"> + <echo message="Resolving and retrieving dependencies..."/> + <ivy:resolve type="jar,bundle" file="${project.root}/ivy.retrieve.xml" conf="required"/> + <ivy:retrieve type="jar,bundle" conf="required" sync="true" + pattern="${project.root}/lib/required/[artifact]-[revision].[ext]" /> + </target> + + <target name="configure-ivy" unless="${ivy.configured}"> + <ivy:configure file="${project.root}/ivysettings.retrieve.xml" override="true"/> + <property name="ivy.configured" value="true" /> + </target> + + <target name="load-ivy" depends="download-ivy" unless="${ivy.dont.retrieve}"> + <!-- Try to load Ivy from local ivy dir, in case the user has not already dropped it into + Ant's lib dir (note that the latter copy will always take precedence). Won't + fail so long as Ivy is in at least one of the locations. --> + <mkdir dir="${ivy.jar.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="download-ivy" unless="${dont.download.ivy}"> + <mkdir dir="${ivy.jar.dir}"/> + <echo message="Downloading ivy..."/> + <get src="${ivy.jar.url}" dest="${ivy.jar.file}" usetimestamp="true"/> + </target> + + <target name="help" description="display detailed build documentation"> <echo> ant build |
