Project

General

Profile

Download (7.49 KB) Statistics
| Branch: | Revision:

git_sitools_idoc / flarecast / cots / ant / apache-ant-1.8.1 / fetch.xml @ master

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
33
  -Ddest=optional optional dir  $${basedir}/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
    <fail>
67
      <condition>
68
        <not>
69
          <isset property="dest"/>
70
        </not>
71
      </condition>ERROR
72
Set -Ddest=LOCATION on the command line
73
  -Ddest=user     user lib dir  ${user.home}/.ant/lib
74
  -Ddest=system   ant lib dir   ${ant.home}/lib
75
  -Ddest=optional optional dir  $${basedir}/lib/optional  (for Ant developers)
76
    </fail>
77

    
78
    <condition property="dest.dir"
79
      value="${lib.dir}">
80
      <equals arg1="${dest}" arg2="system" />
81
    </condition>
82
    <condition property="dest.dir"
83
      value="${optional.dir}">
84
      <equals arg1="${dest}" arg2="optional" />
85
    </condition>
86
    <condition property="dest.dir"
87
      value="${userlib.dir}">
88
      <equals arg1="${dest}" arg2="user" />
89
    </condition>
90
    <fail unless="dest.dir">Unknown destination : ${dest}</fail>
91
    <echo>Downloading to ${dest.dir}</echo>
92
    <property name="m2.dest.dir" value="${dest.dir}" />
93
  </target>
94

    
95

    
96
  <target name="macros" depends="pick-dest,get-m2"
97
    xmlns:artifact="antlib:org.apache.maven.artifact.ant">
98

    
99
    <macrodef name="f2">
100
      <attribute name="project" />
101
      <attribute name="archive" default="@{project}"/>
102
      <sequential>
103
        <fail>
104
        Unknown archive @{archive} -no property @{archive}.version defined.
105
          <condition>
106
            <not>
107
            <isset property="@{archive}.version"/>
108
            </not>
109
          </condition>
110
        </fail>
111
        <artifact:dependencies pathID="@{archive}.path">
112
          <dependency groupID="@{project}"
113
            artifactID="@{archive}"
114
            version="${@{archive}.version}"/>
115
        </artifact:dependencies>
116
        <!-- now we are left with the problem of getting the files
117
             into our directory -->
118
        <copy todir="${dest.dir}">
119
          <path refid="@{archive}.path" />
120
          <flattenmapper/>
121
        </copy>
122
      </sequential>
123
    </macrodef>
124
  </target>
125

    
126

    
127

    
128
  <!-- any init stuff -->
129
  <target name="init" depends="macros" />
130

    
131

    
132
  <target name="diag" depends="init">
133
    <echoproperties />
134
  </target>
135

    
136
  <target name="logging"
137
    description="load logging libraries"
138
    depends="init">
139
    <f2 project="log4j" />
140
    <f2 project="commons-logging" archive="commons-logging-api" />
141
  </target>
142

    
143
  <target name="junit"
144
    description="load junit libraries"
145
    depends="init">
146
    <f2 project="junit" />
147
  </target>
148

    
149
  <target name="xml"
150
    description="load full XML libraries (xalan, resolver)"
151
    depends="init">
152
    <f2 project="xalan" />
153
    <f2 project="xml-resolver" />
154
  </target>
155

    
156
  <!--
157
   This is not used as
158
   we like to get the more recent artifacts than are in the repo at the time of writing (2006-12-21)
159
   -->
160

    
161
  <target name="networking"
162
    description="load networking libraries (commons-net; jsch)"
163
    depends="init">
164
    <f2 project="commons-net" />
165
    <f2 project="com.jcraft" archive="jsch"/>
166
  </target>
167

    
168
  <target name="regexp"
169
    description="load regexp libraries"
170
    depends="init">
171
    <f2 project="regexp" />
172
    <f2 project="oro" />
173
  </target>
174

    
175
  <target name="antlr"
176
    description="load antlr libraries"
177
    depends="init">
178
    <f2 project="antlr" />
179
  </target>
180

    
181
  <target name="bcel"
182
    description="load bcel libraries"
183
    depends="init">
184
    <f2 project="bcel" />
185
  </target>
186

    
187
  <target name="jdepend"
188
    description="load jdepend libraries"
189
    depends="init">
190
    <f2 project="jdepend" />
191
  </target>
192

    
193
  <target name="bsf"
194
    description="load bsf libraries"
195
    depends="init">
196
    <f2 project="bsf" />
197
  </target>
198

    
199
  <target name="jruby"
200
          description="load jruby"
201
          depends="bsf">
202
    <f2 project="org.jruby" archive="jruby"/>
203
  </target>
204

    
205
  <target name="beanshell"
206
          description="load beanshell support"
207
          depends="bsf">
208
    <f2 project="org.beanshell" archive="bsh"/>
209
    <f2 project="org.beanshell" archive="bsh-core"/>
210
  </target>
211

    
212
  <target name="jython"
213
          description="load jython"
214
          depends="bsf">
215
    <f2 project="jython" archive="jython"/>
216
  </target>
217

    
218
  <target name="rhino"
219
          description="load rhino"
220
          depends="bsf">
221
    <f2 project="rhino" archive="js"/>
222
  </target>
223

    
224
  <target name="script"
225
          description="load script languages (except jython)"
226
          depends="bsf,jruby,beanshell,rhino"/>
227

    
228
  <target name="debugging"
229
    description="internal ant debugging"
230
    depends="init">
231
    <f2 project="which" />
232
  </target>
233

    
234
  <target name="javamail" depends="init"
235
          description="load javamail">
236
    <f2 project="javax.mail" archive="mail"/>
237
  </target>
238

    
239
  <target name="jspc" depends="init" description="loads Jasper">
240
    <f2 project="tomcat" archive="jasper-compiler"/>
241
    <f2 project="tomcat" archive="jasper-runtime"/>
242
    <f2 project="javax.servlet" archive="servlet-api"/>
243
  </target>
244

    
245
  <target name="all"
246
    description="load all the libraries (except jython)"
247
    depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc" />
248

    
249
</project>