OSDN Git Service

Redmine 0.9.3
[redminele/redminele.git] / ant / fetch.xml
1 <?xml version="1.0"?>
2
3 <!--
4    Licensed to the Apache Software Foundation (ASF) under one or more
5    contributor license agreements.  See the NOTICE file distributed with
6    this work for additional information regarding copyright ownership.
7    The ASF licenses this file to You under the Apache License, Version 2.0
8    (the "License"); you may not use this file except in compliance with
9    the License.  You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13    Unless required by applicable law or agreed to in writing, software
14    distributed under the License is distributed on an "AS IS" BASIS,
15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16    See the License for the specific language governing permissions and
17    limitations under the License.
18 -->
19 <!--
20   =======================================================================
21     Build file to fetch optional libraries for Apache Ant
22   =======================================================================
23 -->
24 <project name="fetch" default="all" basedir=".">
25
26 <description>
27   This build file downloads JAR files that optional Ant tasks use,
28   and installs them in a location that is accessible the next time Ant runs.
29
30   You can choose three locations, by going -Ddest=LOCATION on the command line
31   -Ddest=user     user lib dir  ${user.home}/.ant/lib
32   -Ddest=system   ant lib dir   ${ant.home}/lib --Default--
33   -Ddest=optional optional dir  ${ant.home}/lib/optional  (for Ant developers)
34
35   You may also need to set proxy settings. On Java1.5, Ant tries to get
36   this from the OS, unless you use the -noproxy option.
37
38   Proxies can be configured manually setting the JVM proxy values in the
39   ANT_OPTS environment variable.
40
41   For example, to set the proxy up in the tcsh shell, the command would be
42   something like:
43
44   For csh/tcsh:
45     setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
46   For bash:
47     export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
48   For Windows, set the environment variable in the appropriate dialog box
49   and open a new console. or, by hand
50     set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
51 </description>
52
53   <!-- Give user a chance to override without editing this file
54        (and without typing -D each time it compiles it) -->
55   <property file="${user.home}/.ant/ant.properties"/>
56   <property name="lib.dir" location="lib" />
57   <property name="optional.dir" location="${lib.dir}/optional" />
58   <property name="userlib.dir" location="${user.home}/.ant/lib" />
59
60   <!-- load in our properties table -->
61   <property file="${lib.dir}/libraries.properties"/>
62
63   <import file="get-m2.xml" />
64
65   <target name="pick-dest">
66     <property name="dest" value="system" />
67     <condition property="dest.dir"
68       value="${lib.dir}">
69       <equals arg1="${dest}" arg2="system" />
70     </condition>
71     <condition property="dest.dir"
72       value="${optional.dir}">
73       <equals arg1="${dest}" arg2="optional" />
74     </condition>
75     <condition property="dest.dir"
76       value="${userlib.dir}">
77       <equals arg1="${dest}" arg2="user" />
78     </condition>
79     <fail unless="dest.dir">Unknown destination : ${dest}</fail>
80     <echo>Downloading to ${dest.dir}</echo>
81     <property name="m2.dest.dir" value="${dest.dir}" />
82   </target>
83
84
85   <target name="macros" depends="pick-dest,get-m2"
86     xmlns:artifact="antlib:org.apache.maven.artifact.ant">
87
88     <macrodef name="f2">
89       <attribute name="project" />
90       <attribute name="archive" default="@{project}"/>
91       <sequential>
92         <fail>
93         Unknown archive @{archive} -no property @{archive}.version defined.
94           <condition>
95             <not>
96             <isset property="@{archive}.version"/>
97             </not>
98           </condition>
99         </fail>
100         <artifact:dependencies pathID="@{archive}.path">
101           <dependency groupID="@{project}"
102             artifactID="@{archive}"
103             version="${@{archive}.version}"/>
104         </artifact:dependencies>
105         <!-- now we are left with the problem of getting the files
106              into our directory -->
107         <copypath destdir="${dest.dir}" pathref="@{archive}.path">
108           <flattenmapper/>
109         </copypath>
110       </sequential>
111     </macrodef>
112   </target>
113
114
115
116   <!-- any init stuff -->
117   <target name="init" depends="macros" />
118
119
120   <target name="diag" depends="init">
121     <echoproperties />
122   </target>
123
124   <target name="logging"
125     description="load logging libraries"
126     depends="init">
127     <f2 project="log4j" />
128     <f2 project="commons-logging" archive="commons-logging-api" />
129   </target>
130
131   <target name="junit"
132     description="load junit libraries"
133     depends="init">
134     <f2 project="junit" />
135   </target>
136
137   <target name="xml"
138     description="load full XML libraries (xalan, resolver)"
139     depends="init">
140     <f2 project="xalan" />
141     <f2 project="xml-resolver" />
142   </target>
143
144   <!--
145    This is not used as
146    we like to get the more recent artifacts than are in the repo at the time of writing (2006-12-21)
147    -->
148
149   <target name="xerces"
150       description="load an updated version of Xerces"
151       depends="init">
152     <f2 project="xerces" archive="xercesImpl"/>
153     <f2 project="xerces" archive="xml-apis" />
154   </target>
155
156   <target name="networking"
157     description="load networking libraries (commons-net; jsch)"
158     depends="init">
159     <f2 project="commons-net" />
160     <f2 project="com.jcraft" archive="jsch"/>
161   </target>
162
163   <target name="regexp"
164     description="load regexp libraries"
165     depends="init">
166     <f2 project="regexp" />
167     <f2 project="oro" />
168   </target>
169
170   <target name="antlr"
171     description="load antlr libraries"
172     depends="init">
173     <f2 project="antlr" />
174   </target>
175
176   <target name="bcel"
177     description="load bcel libraries"
178     depends="init">
179     <f2 project="bcel" />
180   </target>
181
182   <target name="jdepend"
183     description="load jdepend libraries"
184     depends="init">
185     <f2 project="jdepend" />
186   </target>
187
188   <target name="bsf"
189     description="load bsf libraries"
190     depends="init">
191     <f2 project="bsf" />
192   </target>
193
194   <target name="jruby"
195           description="load jruby"
196           depends="bsf">
197     <f2 project="org.jruby" archive="jruby"/>
198   </target>
199
200   <target name="beanshell"
201           description="load beanshell support"
202           depends="bsf">
203     <f2 project="org.beanshell" archive="bsh"/>
204     <f2 project="org.beanshell" archive="bsh-core"/>
205   </target>
206
207   <target name="jython"
208           description="load jython"
209           depends="bsf">
210     <f2 project="jython" archive="jython"/>
211   </target>
212
213   <target name="rhino"
214           description="load rhino"
215           depends="bsf">
216     <f2 project="rhino" archive="js"/>
217   </target>
218
219   <target name="script"
220           description="load script languages"
221           depends="bsf,jruby,jython,beanshell,rhino"/>
222
223   <target name="debugging"
224     description="internal ant debugging"
225     depends="init">
226     <f2 project="which" />
227   </target>
228
229   <target name="all"
230     description="load all the libraries"
231     depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script" />
232
233 </project>