-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
ant-definitions.xml
179 lines (173 loc) · 7.19 KB
/
ant-definitions.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<project name="tigase-defs">
<macrodef name="compile">
<attribute name="srcdir"/>
<attribute name="excldir" default=""/>
<attribute name="deprecation" default="off"/>
<attribute name="xlint" default="-Xlint:-all"/>
<sequential>
<mkdir dir="${build}"/>
<javac
srcdir="@{srcdir}"
excludes="@{excldir}"
destdir="${build}"
debug="on"
deprecation="@{deprecation}">
<compilerarg line="@{xlint}"/>
<classpath>
<fileset dir="${libs}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</sequential>
</macrodef>
<macrodef name="jarfile">
<attribute name="excludes" default=""/>
<attribute name="filename"/>
<attribute name="manifest" default="MANIFEST.MF"/>
<sequential>
<copy
file="manifest.temp"
tofile="@{manifest}"/>
<replaceregexp
file="@{manifest}"
match="^(Specification-Version: ).*$"
replace="\1${ver}"
byline="true"/>
<replaceregexp
file="@{manifest}"
match="^(Implementation-Version: ).*$"
replace="\1${version}"
byline="true"/>
<replaceregexp
file="@{manifest}"
match="^(Package-Version: ).*$"
replace="\1build${build-no}"
byline="true"/>
<replaceregexp
file="@{manifest}"
match="^(Tigase-Version: ).*$"
replace="\1${version}"
byline="true"/>
<mkdir dir="${jars}"/>
<jar jarfile="${jars}/@{filename}.jar"
manifest="@{manifest}"
basedir="${build}"
excludes="@{excludes}"/>
</sequential>
</macrodef>
<macrodef name="docs">
<attribute name="packages" default=""/>
<attribute name="excludepackages" default=""/>
<attribute name="destdir" default="docs"/>
<sequential>
<mkdir dir="@{destdir}/api"/>
<javadoc
sourcepath="${src}"
packagenames="@{packages}"
excludepackagenames="@{excludepackages}"
destdir="@{destdir}/api"
windowtitle="${javadoc-windowtitle}"
overview="package.html"
failonerror="yes"
use="true"
author="true"
version="true"
verbose="false"
protected="true"
bottom="${javadoc-copyright}">
<link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/"
packagelistLoc="package-list"/>
<classpath>
<fileset dir="${libs}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javadoc>
</sequential>
</macrodef>
<macrodef name="distbin">
<attribute name="packagename"/>
<attribute name="docsdir" default="docs"/>
<sequential>
<delete file="@{packagename}-${version}.zip"/>
<delete file="@{packagename}-${version}.tar.gz"/>
<delete dir="dist"/>
<mkdir dir="${dist}/@{packagename}-${version}/${jars}"/>
<mkdir dir="${dist}/@{packagename}-${version}/bin"/>
<copy
file="${jars}/@{packagename}.jar"
tofile="${dist}/@{packagename}-${version}/${jars}/@{packagename}.jar"/>
<exec executable="sed" output="${dist}/@{packagename}-${version}/README">
<arg value="-e"/>
<arg value="s/<[^>]*>//g"/>
<arg value="-e"/>
<arg value="s/<[^>]*>//g"/>
<arg value="package.html"/>
</exec>
<copy
file="package.html"
tofile="${dist}/@{packagename}-${version}/README.html"/>
<copy
file="etc/tigase.conf"
tofile="${dist}/@{packagename}-${version}/etc/tigase.conf"/>
<mkdir dir="${dist}/@{packagename}-${version}/libs"/>
<copy todir="${dist}/@{packagename}-${version}/libs">
<fileset dir="libs" includes="*"/>
</copy>
<copy
file="scripts/tigase.sh"
tofile="${dist}/@{packagename}-${version}/bin/tigase.sh"/>
<copy
file="scripts/config.sh"
tofile="${dist}/@{packagename}-${version}/bin/config.sh"/>
<copy
file="scripts/repo.sh"
tofile="${dist}/@{packagename}-${version}/bin/repo.sh"/>
<move todir="${dist}/@{packagename}-${version}/docs">
<fileset dir="@{docsdir}"/>
</move>
<copy todir="${dist}/@{packagename}-${version}">
<fileset dir="." includes="CHANGES*"/>
</copy>
<zip zipfile="@{packagename}-${version}.zip" basedir="${dist}"/>
<tar tarfile="@{packagename}-${version}.tar" basedir="${dist}"/>
<gzip
zipfile="@{packagename}-${version}.tar.gz"
src="@{packagename}-${version}.tar"/>
<delete file="@{packagename}-${version}.tar"/>
</sequential>
</macrodef>
<macrodef name="distsrc">
<attribute name="packagename"/>
<attribute name="cvsroot"/>
<attribute name="cvspackage"/>
<sequential>
<delete dir="@{packagename}-${version}.src"/>
<delete file="@{packagename}-${version}.src.tar.gz"/>
<delete file="@{packagename}-${version}.src.zip"/>
<exec executable="svn">
<arg line="export --non-interactive @{cvsroot} @{packagename}"/>
</exec>
<!-- <cvs cvsRoot="@{cvsroot}" -->
<!-- package="@{cvspackage}" -->
<!-- command="export" -->
<!-- date="today"/> -->
<mkdir dir="@{packagename}-${version}.src/@{packagename}-${version}.src"/>
<move todir="@{packagename}-${version}.src/@{packagename}-${version}.src">
<fileset dir="@{packagename}"/>
</move>
<zip
zipfile="@{packagename}-${version}.src.zip"
basedir="@{packagename}-${version}.src"/>
<tar
tarfile="@{packagename}-${version}.src.tar"
basedir="@{packagename}-${version}.src"/>
<gzip
zipfile="@{packagename}-${version}.src.tar.gz"
src="@{packagename}-${version}.src.tar"/>
<delete file="@{packagename}-${version}.src.tar"/>
<delete dir="@{packagename}-${version}.src"/>
</sequential>
</macrodef>
</project>