Externalized some Ant-Tasks and Macros to fetch third patry libs via http from http://www.ibiblio.org/

-- Refactoring GData-Server -- Apache Hivemind integration

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@472602 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2006-11-08 19:25:49 +00:00
parent daedf1c3bb
commit fe4025e0b6
2 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,70 @@
<?xml version="1.0"?>
<!--
Copyright 2004, 2005 The Apache Software Foundation
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.
-->
<project name="dependency">
<target name="prepare">
<mkdir dir="${external.lib.dir}"/>
<ibiblio-dependency artifact="easymock" version="1.1" group="easymock" folder="easymock/1.1" use="run"/>
</target>
<target name="-display-download-warning" unless="download-warning-marker-displayed">
<echo>
**************************************************************************************************
* *
* D O W N L O A D W A R N I N G *
* *
* Dependent libraries will be downloaded. These are NOT necessarily downloaded from apache.org, *
* and may use other licences besides the Apache Software License. Dependencies will use an *
* open-source license compatible with the ASL, such as Berkeley Software Distribution (BSD) or *
* Mozilla Public License (MPL). *
* *
**************************************************************************************************
</echo>
<!-- <input
validargs="continue"
message="Enter 'continue' to continue with the build:"/>
<mkdir dir="${external.package.dir}"/>
<echo file="${download-warning-marker.file}">Download warning accepted.</echo>-->
</target>
<macrodef name="ibiblio-dependency">
<attribute name="artifact" description="The name of the JAR artfiact to download." />
<attribute name="version" description="The version number of the artifact to download." />
<attribute name="group" description="The Maven group-id containing the JAR." />
<attribute name="use" default="compile" description="Useage of the dependency: compile, test or run. Subdirectory to place the artiface in." />
<attribute name="folder" default="jars"/>
<attribute name="reposurl" default="http://www.ibiblio.org/maven2"/>
<sequential>
<mkdir dir="${gdata.external.lib.dir}" />
<antcall target="-display-download-warning" inheritAll="true"/>
<download-file dldest="${gdata.external.lib.dir}/@{artifact}-@{version}.jar" dlsrc="@{reposurl}/@{group}/@{folder}/@{artifact}-@{version}.jar" />
</sequential>
</macrodef>
<macrodef name="download-file">
<attribute name="dlsrc" description="The URL of the file to download." />
<attribute name="dldest" description="The directory and file to copy to." />
<sequential>
<get src="@{dlsrc}" dest="@{dldest}" verbose="true" usetimestamp="true" ignoreerrors="true" />
</sequential>
</macrodef>
</project>

View File

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<!--
Copyright 2004, 2005 The Apache Software Foundation
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.
-->
<project name="get-dependencies">
<property name="repository.url.maven" value="http://www.ibiblio.org/maven"/>
<import file="dependency.xml"/>
<target name="run-dependencies">
<echo>Resolving dependencies for distribution / war build</echo>
<antcall target="common-dependencies"/>
<ibiblio-dependency artifact="oro" version="2.0.6" group="oro" reposurl="${repository.url.maven}"/>
<ibiblio-dependency artifact="javassist" version="3.0" group="javassist" reposurl="${repository.url.maven}"/>
</target>
<target name="common-dependencies">
<echo>Resolving common dependencies </echo>
<ibiblio-dependency artifact="hivemind" version="1.1" group="hivemind" reposurl="${repository.url.maven}"/>
<ibiblio-dependency artifact="hivemind-lib" version="1.1" group="hivemind" reposurl="${repository.url.maven}"/>
<ibiblio-dependency artifact="hivemind-jmx" version="1.1" group="hivemind" reposurl="${repository.url.maven}"/>
<path id="common.build.path">
<fileset dir="${gdata.external.lib.dir}">
<include name="hivemind-1.1.jar"/>
<include name="hivemind-lib-1.1.jar"/>
<include name="hivemind-jmx-1.1.jar"/>
</fileset>
</path>
</target>
<target name="build-dependencies">
<antcall target="common-dependencies"/>
<path id="build.path">
<path refid="common.build.path"/>
</path>
<echo>Resolving dependencies for build process</echo>
</target>
<target name="test-dependencies">
<echo>Resolving dependencies for test cases</echo>
<!-- <antcall target="common-dependencies"/>-->
<ibiblio-dependency artifact="easymock" version="1.2_Java1.5" group="easymock" folder="easymock/1.2_Java1.5" />
<path id="test.build.path">
<fileset dir="${gdata.external.lib.dir}">
<include name="easymock-1.2_Java1.5.jar"/>
</fileset>
</path>
</target>
</project>