-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathasl-tasklib-install.xml
executable file
·122 lines (115 loc) · 6.54 KB
/
asl-tasklib-install.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0" encoding="UTF-8"?>
<!--
********************************************************************************
* Ant Script Library - task library installer
* Targets that install jar libraries for optional tasks
* Module property prefix: "tasklib-install"
********************************************************************************
* Copyright 2009 Joe Schmetzer
*
* 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="asl-tasklib-install" xmlns:ivy="antlib:org.apache.ivy.ant">
<dirname property="tasklib-install.basedir" file="${ant.file.asl-tasklib-install}"/>
<import file="${tasklib-install.basedir}/asl-repo-ivy.xml"/>
<!-- ***********************************************************************
* macrodef: asl-install-tool-ivy
************************************************************************ -->
<macrodef name="asl-install-tool-ivy"
description="Installs jars for optional tasks">
<attribute name="libdir"/>
<attribute name="organisation"/>
<attribute name="module"/>
<attribute name="revision"/>
<sequential>
<mkdir dir="@{libdir}"/>
<ivy:retrieve pattern="@{libdir}/[artifact].[ext]"
organisation="@{organisation}"
module="@{module}"
revision="@{revision}"
type="jar"
inline="true" />
</sequential>
</macrodef>
<!-- ***********************************************************************
* target: install-all
************************************************************************ -->
<target name="install-all" depends="install-cobertura, install-pmd, install-checkstyle, install-findbugs"
description="Installs all the optional libraries"/>
<!-- ***********************************************************************
* target: install-pmd
************************************************************************ -->
<target name="install-pmd"
description="Installs the libraries required by the pmd task">
<property name="pmd-install-dir" location="${tasklib-install.basedir}/lib/pmd"/>
<property name="pmd-version" value="4.2.5"/>
<property name="pmd-src-url" value="http://sourceforge.net/projects/pmd/files/pmd/${pmd-version}/pmd-bin-${pmd-version}.zip/download"/>
<property name="pmd-tmp-dir" location="${java.io.tmpdir}/pmd" />
<property name="pmd-tmp-file" location="${pmd-tmp-dir}/pmd-${pmd-version}.zip" />
<mkdir dir="${pmd-tmp-dir}"/>
<get dest="${pmd-tmp-file}" src="${pmd-src-url}" verbose="true"/>
<unzip dest="${pmd-tmp-dir}" src="${pmd-tmp-file}"/>
<move todir="${pmd-install-dir}">
<fileset dir="${pmd-tmp-dir}/pmd-${pmd-version}"/>
</move>
<move file="${pmd-install-dir}/lib/pmd-${pmd-version}.jar"
tofile="${pmd-install-dir}/lib/pmd.jar"/>
<delete dir="${pmd-tmp-dir}" failonerror="false"/>
</target>
<!-- ***********************************************************************
* target: install-cobertura
************************************************************************ -->
<target name="install-cobertura" depends="-repo-configure-ivy"
description="Installs the libraries required by the cobertura task">
<asl-install-tool-ivy libdir="${tasklib-install.basedir}/lib/cobertura"
organisation="net.sourceforge.cobertura" module="cobertura" revision="1.9.4.1"/>
</target>
<!-- ***********************************************************************
* target: install-checkstyle
************************************************************************ -->
<target name="install-checkstyle" depends="-repo-configure-ivy"
description="Installs the libraries required by the checkstyle task">
<asl-install-tool-ivy libdir="${tasklib-install.basedir}/lib/checkstyle"
organisation="checkstyle" module="checkstyle" revision="5.0"/>
</target>
<!-- ***********************************************************************
* target: install-findbugs
************************************************************************ -->
<target name="install-findbugs"
description="Installs the libraries required by the pmd task">
<property name="findbugs-install-dir" location="${tasklib-install.basedir}/lib/findbugs"/>
<property name="findbugs-version" value="1.3.9"/>
<property name="findbugs-src-url" value="http://prdownloads.sourceforge.net/findbugs/findbugs-${findbugs-version}.zip?download"/>
<property name="findbugs-tmp-dir" location="${java.io.tmpdir}/findbugs" />
<property name="findbugs-tmp-file" location="${findbugs-tmp-dir}/findbugs-${findbugs-version}.zip" />
<mkdir dir="${findbugs-tmp-dir}"/>
<get dest="${findbugs-tmp-file}" src="${findbugs-src-url}" verbose="true"/>
<unzip dest="${findbugs-tmp-dir}" src="${findbugs-tmp-file}"/>
<move todir="${findbugs-install-dir}">
<fileset dir="${findbugs-tmp-dir}/findbugs-${findbugs-version}"/>
</move>
<delete dir="${findbugs-tmp-dir}" failonerror="false"/>
</target>
<!-- ***********************************************************************
* target: install-sonar
************************************************************************ -->
<target name="install-sonar"
description="Installs the libraries required by the sonar task">
<property name="sonar-install-dir" location="${tasklib-install.basedir}/lib/sonar"/>
<property name="sonar-version" value="1.2"/>
<property name="sonar-jar-url" value="http://repository.codehaus.org/org/codehaus/sonar-plugins/sonar-ant-task/${sonar-version}/sonar-ant-task-${sonar-version}.jar"/>
<mkdir dir="${sonar-install-dir}"/>
<get dest="${sonar-install-dir}/sonar-ant-task.jar" src="${sonar-jar-url}" verbose="true"/>
</target>
</project>