1245 |
21 Oct 10 |
nicklas |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
1245 |
21 Oct 10 |
nicklas |
2 |
<!-- |
1245 |
21 Oct 10 |
nicklas |
$Id $ |
1245 |
21 Oct 10 |
nicklas |
4 |
|
1245 |
21 Oct 10 |
nicklas |
Copyright (C) 2010 Nicklas Nordborg |
1245 |
21 Oct 10 |
nicklas |
6 |
|
1245 |
21 Oct 10 |
nicklas |
This file is part of Bittorent download service for BASE. |
1245 |
21 Oct 10 |
nicklas |
Available at http://baseplugins.thep.lu.se/ |
1245 |
21 Oct 10 |
nicklas |
9 |
|
1245 |
21 Oct 10 |
nicklas |
BASE is free software; you can redistribute it and/or |
1245 |
21 Oct 10 |
nicklas |
modify it under the terms of the GNU General Public License |
1245 |
21 Oct 10 |
nicklas |
as published by the Free Software Foundation; either version 2 |
1245 |
21 Oct 10 |
nicklas |
of the License, or (at your option) any later version. |
1245 |
21 Oct 10 |
nicklas |
14 |
|
1245 |
21 Oct 10 |
nicklas |
BASE is distributed in the hope that it will be useful, |
1245 |
21 Oct 10 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1245 |
21 Oct 10 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1245 |
21 Oct 10 |
nicklas |
GNU General Public License for more details. |
1245 |
21 Oct 10 |
nicklas |
19 |
|
1245 |
21 Oct 10 |
nicklas |
You should have received a copy of the GNU General Public License |
1245 |
21 Oct 10 |
nicklas |
along with this program; if not, write to the Free Software |
1245 |
21 Oct 10 |
nicklas |
Foundation, Inc., 59 Temple Place - Suite 330, |
1245 |
21 Oct 10 |
nicklas |
Boston, MA 02111-1307, USA. |
1245 |
21 Oct 10 |
nicklas |
24 |
--> |
1245 |
21 Oct 10 |
nicklas |
25 |
<project |
1245 |
21 Oct 10 |
nicklas |
26 |
name="BittorentService" |
1245 |
21 Oct 10 |
nicklas |
27 |
default="jar" |
1245 |
21 Oct 10 |
nicklas |
28 |
basedir="."> |
1245 |
21 Oct 10 |
nicklas |
29 |
|
1245 |
21 Oct 10 |
nicklas |
<!--create this file if you need to override values from properties below --> |
1245 |
21 Oct 10 |
nicklas |
31 |
<property file="build.properties" /> |
1245 |
21 Oct 10 |
nicklas |
32 |
|
1245 |
21 Oct 10 |
nicklas |
<!-- variables used --> |
1245 |
21 Oct 10 |
nicklas |
34 |
<property name="name" value="base-torrent" /> |
1636 |
03 May 12 |
nicklas |
35 |
<property name="version" value="0.2-dev" /> |
1245 |
21 Oct 10 |
nicklas |
36 |
<property name="src" location="src" description="Location of source files" /> |
1245 |
21 Oct 10 |
nicklas |
37 |
<property name="build" location="build" description="Location of compiled files" /> |
1245 |
21 Oct 10 |
nicklas |
38 |
<property name="jar.name" value="${name}.jar" |
1245 |
21 Oct 10 |
nicklas |
39 |
description="Name of JAR file with the extensions." /> |
1245 |
21 Oct 10 |
nicklas |
40 |
<property name="tar.prefix" value="${name}-${version}" |
1245 |
21 Oct 10 |
nicklas |
41 |
description="Prefix of .tar.gz file for download." /> |
1245 |
21 Oct 10 |
nicklas |
42 |
<property name="tar.name" value="${tar.prefix}.tar.gz" |
1245 |
21 Oct 10 |
nicklas |
43 |
description="Full name of .tar.gz file for download." /> |
1245 |
21 Oct 10 |
nicklas |
44 |
<property name="javac.arg" value="-Xlint:unchecked" /> |
1636 |
03 May 12 |
nicklas |
45 |
<property name="javac.source" value="1.6" /> |
1636 |
03 May 12 |
nicklas |
46 |
<property name="javac.target" value="1.6" /> |
1245 |
21 Oct 10 |
nicklas |
47 |
<property name="javac.encoding" value="UTF-8" /> |
1636 |
03 May 12 |
nicklas |
48 |
<property name="depend.base-version" |
1636 |
03 May 12 |
nicklas |
49 |
value="3.1.0" |
1636 |
03 May 12 |
nicklas |
50 |
description="The BASE version that this project depends on." |
1636 |
03 May 12 |
nicklas |
51 |
/> |
1636 |
03 May 12 |
nicklas |
52 |
<property name="depend.jars" |
1636 |
03 May 12 |
nicklas |
53 |
value="http://base2.thep.lu.se/base/jars/${depend.base-version}" |
1636 |
03 May 12 |
nicklas |
54 |
description="The location of the BASE core JARs that this project depends on." |
1636 |
03 May 12 |
nicklas |
55 |
/> |
1245 |
21 Oct 10 |
nicklas |
56 |
|
1245 |
21 Oct 10 |
nicklas |
<!-- set up classpath for compiling --> |
1251 |
22 Oct 10 |
nicklas |
58 |
<path id="external.classpath"> |
1245 |
21 Oct 10 |
nicklas |
59 |
<fileset dir="lib"> |
1245 |
21 Oct 10 |
nicklas |
60 |
<include name="**/*.jar" /> |
1245 |
21 Oct 10 |
nicklas |
61 |
</fileset> |
1245 |
21 Oct 10 |
nicklas |
62 |
</path> |
1245 |
21 Oct 10 |
nicklas |
63 |
|
1251 |
22 Oct 10 |
nicklas |
64 |
<path id="classpath"> |
1251 |
22 Oct 10 |
nicklas |
65 |
<path refid="external.classpath" /> |
1251 |
22 Oct 10 |
nicklas |
66 |
<pathelement location="${build}/external/hpbtc" /> |
1251 |
22 Oct 10 |
nicklas |
67 |
</path> |
1251 |
22 Oct 10 |
nicklas |
68 |
|
1245 |
21 Oct 10 |
nicklas |
69 |
<target name="init"> |
1245 |
21 Oct 10 |
nicklas |
70 |
<mkdir dir="${build}" /> |
1245 |
21 Oct 10 |
nicklas |
71 |
</target> |
1245 |
21 Oct 10 |
nicklas |
72 |
|
1245 |
21 Oct 10 |
nicklas |
73 |
<target name="clean"> |
1245 |
21 Oct 10 |
nicklas |
74 |
<delete failonerror="false" includeemptydirs="true"> |
1245 |
21 Oct 10 |
nicklas |
75 |
<fileset dir="${build}" defaultexcludes="no" /> |
1245 |
21 Oct 10 |
nicklas |
76 |
<fileset file="${jar.name}" /> |
1245 |
21 Oct 10 |
nicklas |
77 |
<fileset file="lib/torrent/hpbtc.jar" /> |
1245 |
21 Oct 10 |
nicklas |
78 |
<fileset file="${tar.name}" /> |
1245 |
21 Oct 10 |
nicklas |
79 |
</delete> |
1245 |
21 Oct 10 |
nicklas |
80 |
</target> |
1245 |
21 Oct 10 |
nicklas |
81 |
|
1245 |
21 Oct 10 |
nicklas |
82 |
<target |
1245 |
21 Oct 10 |
nicklas |
83 |
name="package" |
1245 |
21 Oct 10 |
nicklas |
84 |
depends="clean,jar" |
1245 |
21 Oct 10 |
nicklas |
85 |
description="Clean and create binary distribution package" |
1245 |
21 Oct 10 |
nicklas |
86 |
> |
1245 |
21 Oct 10 |
nicklas |
87 |
<tar |
1245 |
21 Oct 10 |
nicklas |
88 |
destfile="${tar.name}" |
1245 |
21 Oct 10 |
nicklas |
89 |
longfile="gnu" |
1245 |
21 Oct 10 |
nicklas |
90 |
compression="gzip" |
1245 |
21 Oct 10 |
nicklas |
91 |
> |
1245 |
21 Oct 10 |
nicklas |
92 |
<tarfileset |
1245 |
21 Oct 10 |
nicklas |
93 |
dir="." |
1245 |
21 Oct 10 |
nicklas |
94 |
prefix="${tar.prefix}" |
1245 |
21 Oct 10 |
nicklas |
95 |
preserveLeadingSlashes="true" |
1251 |
22 Oct 10 |
nicklas |
96 |
includes="${jar.name},README,LICENSE*,torrent.properties,lib/torrent/*" |
1245 |
21 Oct 10 |
nicklas |
97 |
/> |
1245 |
21 Oct 10 |
nicklas |
98 |
</tar> |
1245 |
21 Oct 10 |
nicklas |
99 |
</target> |
1245 |
21 Oct 10 |
nicklas |
100 |
|
1245 |
21 Oct 10 |
nicklas |
101 |
<target |
1636 |
03 May 12 |
nicklas |
102 |
name="install" |
1636 |
03 May 12 |
nicklas |
103 |
depends="jar" |
1636 |
03 May 12 |
nicklas |
104 |
> |
1636 |
03 May 12 |
nicklas |
105 |
<fail unless="base.plugins" message="base.plugins is not set to the path of BASE plug-ins directory." /> |
1636 |
03 May 12 |
nicklas |
106 |
<copy todir="${base.plugins}"> |
1636 |
03 May 12 |
nicklas |
107 |
<fileset file="${jar.name}" /> |
1636 |
03 May 12 |
nicklas |
108 |
</copy> |
1636 |
03 May 12 |
nicklas |
109 |
<echo>Copied '${jar.name}' to '${base.plugins}'.</echo> |
1636 |
03 May 12 |
nicklas |
110 |
</target> |
1636 |
03 May 12 |
nicklas |
111 |
|
1636 |
03 May 12 |
nicklas |
112 |
|
1636 |
03 May 12 |
nicklas |
113 |
<target |
1245 |
21 Oct 10 |
nicklas |
114 |
name="jar" |
1636 |
03 May 12 |
nicklas |
115 |
depends="build" |
1245 |
21 Oct 10 |
nicklas |
116 |
description="Creates the extension JAR file" |
1245 |
21 Oct 10 |
nicklas |
117 |
> |
1245 |
21 Oct 10 |
nicklas |
118 |
<jar |
1245 |
21 Oct 10 |
nicklas |
119 |
jarfile="${jar.name}" |
1245 |
21 Oct 10 |
nicklas |
120 |
manifest="META-INF/MANIFEST.MF" |
1245 |
21 Oct 10 |
nicklas |
121 |
> |
1245 |
21 Oct 10 |
nicklas |
122 |
<fileset dir="${build}/main" /> |
1636 |
03 May 12 |
nicklas |
123 |
<fileset dir="${build}//external/hpbtc" /> |
1245 |
21 Oct 10 |
nicklas |
124 |
<fileset dir="." includes="META-INF/**" /> |
1245 |
21 Oct 10 |
nicklas |
125 |
<fileset dir="." includes="resources/**" /> |
1245 |
21 Oct 10 |
nicklas |
126 |
</jar> |
1245 |
21 Oct 10 |
nicklas |
127 |
</target> |
1245 |
21 Oct 10 |
nicklas |
128 |
|
1245 |
21 Oct 10 |
nicklas |
129 |
<target |
1245 |
21 Oct 10 |
nicklas |
130 |
name="build" |
1245 |
21 Oct 10 |
nicklas |
131 |
depends="init,checkjar,build.external" |
1636 |
03 May 12 |
nicklas |
132 |
description="Compiles the plugin" |
1245 |
21 Oct 10 |
nicklas |
133 |
> |
1245 |
21 Oct 10 |
nicklas |
134 |
<mkdir dir="${build}/main" /> |
1245 |
21 Oct 10 |
nicklas |
135 |
<javac |
1245 |
21 Oct 10 |
nicklas |
136 |
srcdir="${src}/main" |
1245 |
21 Oct 10 |
nicklas |
137 |
destdir="${build}/main" |
1245 |
21 Oct 10 |
nicklas |
138 |
debug="true" |
1245 |
21 Oct 10 |
nicklas |
139 |
classpathref="classpath" |
1245 |
21 Oct 10 |
nicklas |
140 |
encoding="${javac.encoding}" |
1245 |
21 Oct 10 |
nicklas |
141 |
source="${javac.source}" |
1245 |
21 Oct 10 |
nicklas |
142 |
target="${javac.target}" |
1245 |
21 Oct 10 |
nicklas |
143 |
includeantruntime="false" |
1245 |
21 Oct 10 |
nicklas |
144 |
> |
1245 |
21 Oct 10 |
nicklas |
145 |
<compilerarg value="${javac.arg}" /> |
1245 |
21 Oct 10 |
nicklas |
146 |
</javac> |
1245 |
21 Oct 10 |
nicklas |
147 |
</target> |
1245 |
21 Oct 10 |
nicklas |
148 |
|
1245 |
21 Oct 10 |
nicklas |
149 |
<target |
1245 |
21 Oct 10 |
nicklas |
150 |
name="build.external" |
1245 |
21 Oct 10 |
nicklas |
151 |
> |
1245 |
21 Oct 10 |
nicklas |
152 |
<mkdir dir="${build}/external/hpbtc" /> |
1245 |
21 Oct 10 |
nicklas |
153 |
<javac |
1245 |
21 Oct 10 |
nicklas |
154 |
srcdir="${src}/external/hpbtc" |
1245 |
21 Oct 10 |
nicklas |
155 |
destdir="${build}/external/hpbtc" |
1245 |
21 Oct 10 |
nicklas |
156 |
debug="true" |
1251 |
22 Oct 10 |
nicklas |
157 |
classpathref="external.classpath" |
1245 |
21 Oct 10 |
nicklas |
158 |
encoding="${javac.encoding}" |
1245 |
21 Oct 10 |
nicklas |
159 |
source="${javac.source}" |
1245 |
21 Oct 10 |
nicklas |
160 |
target="${javac.target}" |
1245 |
21 Oct 10 |
nicklas |
161 |
includeantruntime="false" |
1245 |
21 Oct 10 |
nicklas |
162 |
> |
1246 |
21 Oct 10 |
nicklas |
<!--compilerarg value="${javac.arg}" / --> |
1245 |
21 Oct 10 |
nicklas |
164 |
</javac> |
1245 |
21 Oct 10 |
nicklas |
165 |
</target> |
1245 |
21 Oct 10 |
nicklas |
166 |
|
1245 |
21 Oct 10 |
nicklas |
167 |
<target |
1245 |
21 Oct 10 |
nicklas |
168 |
name="checkjar" |
1245 |
21 Oct 10 |
nicklas |
169 |
description="Checks that the BASE2Core.jar and BASE2Webclient.jar exists." |
1245 |
21 Oct 10 |
nicklas |
170 |
> |
1245 |
21 Oct 10 |
nicklas |
171 |
<available classname="net.sf.basedb.core.Application" |
1636 |
03 May 12 |
nicklas |
172 |
classpathref="classpath" property="base-core" /> |
1245 |
21 Oct 10 |
nicklas |
173 |
<available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" |
1636 |
03 May 12 |
nicklas |
174 |
classpathref="classpath" property="base-web" /> |
1636 |
03 May 12 |
nicklas |
175 |
<fail unless="base-core" message="Can't find base-core-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
1636 |
03 May 12 |
nicklas |
176 |
<fail unless="base-web" message="Can't find base-webservices-client-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
1636 |
03 May 12 |
nicklas |
177 |
<echo>Found all requried BASE core JAR files.</echo> |
1245 |
21 Oct 10 |
nicklas |
178 |
</target> |
1245 |
21 Oct 10 |
nicklas |
179 |
|
1245 |
21 Oct 10 |
nicklas |
180 |
<target |
1245 |
21 Oct 10 |
nicklas |
181 |
name="download-lib" |
1636 |
03 May 12 |
nicklas |
182 |
description="Download required BASE core jar files" |
1245 |
21 Oct 10 |
nicklas |
183 |
> |
1245 |
21 Oct 10 |
nicklas |
184 |
<echo> |
1245 |
21 Oct 10 |
nicklas |
185 |
------------------------------------------------------- |
1245 |
21 Oct 10 |
nicklas |
186 |
NOTE! You may specifiy a different download location by |
1245 |
21 Oct 10 |
nicklas |
187 |
creating the file './build.properties' and |
1245 |
21 Oct 10 |
nicklas |
188 |
setting 'depend.jars' to the URL to download from. |
1245 |
21 Oct 10 |
nicklas |
189 |
------------------------------------------------------- |
1245 |
21 Oct 10 |
nicklas |
190 |
</echo> |
1636 |
03 May 12 |
nicklas |
191 |
<download-lib file="base-core-${depend.base-version}.jar" /> |
1636 |
03 May 12 |
nicklas |
192 |
<download-lib file="base-webclient-${depend.base-version}.jar" /> |
1245 |
21 Oct 10 |
nicklas |
193 |
</target> |
1245 |
21 Oct 10 |
nicklas |
194 |
|
1245 |
21 Oct 10 |
nicklas |
195 |
<macrodef name="download-lib" description="Download BASE core JAR files"> |
1245 |
21 Oct 10 |
nicklas |
196 |
<attribute name="file" /> |
1245 |
21 Oct 10 |
nicklas |
197 |
<sequential> |
1245 |
21 Oct 10 |
nicklas |
198 |
<get |
1245 |
21 Oct 10 |
nicklas |
199 |
dest="lib/compile/@{file}" |
1245 |
21 Oct 10 |
nicklas |
200 |
src="${depend.jars}/@{file}" |
1245 |
21 Oct 10 |
nicklas |
201 |
usetimestamp="true" |
1245 |
21 Oct 10 |
nicklas |
202 |
verbose="true" |
1245 |
21 Oct 10 |
nicklas |
203 |
ignoreerrors="true" |
1245 |
21 Oct 10 |
nicklas |
204 |
/> |
1245 |
21 Oct 10 |
nicklas |
205 |
</sequential> |
1245 |
21 Oct 10 |
nicklas |
206 |
</macrodef> |
1636 |
03 May 12 |
nicklas |
207 |
|
1636 |
03 May 12 |
nicklas |
208 |
<target name="update-version"> |
1636 |
03 May 12 |
nicklas |
209 |
<echo>Setting version to: ${version}</echo> |
1636 |
03 May 12 |
nicklas |
210 |
|
1636 |
03 May 12 |
nicklas |
211 |
<echo>extensions.xml</echo> |
1636 |
03 May 12 |
nicklas |
212 |
<replaceregexp |
1636 |
03 May 12 |
nicklas |
213 |
file="META-INF/extensions.xml" |
1636 |
03 May 12 |
nicklas |
214 |
match="<version>.*</version>" |
1636 |
03 May 12 |
nicklas |
215 |
replace="<version>${version}</version>" |
1636 |
03 May 12 |
nicklas |
216 |
encoding="UTF-8" |
1636 |
03 May 12 |
nicklas |
217 |
/> |
1636 |
03 May 12 |
nicklas |
218 |
<replaceregexp |
1636 |
03 May 12 |
nicklas |
219 |
file="META-INF/extensions.xml" |
1636 |
03 May 12 |
nicklas |
220 |
match="<min-base-version>.*</min-base-version>" |
1636 |
03 May 12 |
nicklas |
221 |
replace="<min-base-version>${depend.base-version}</min-base-version>" |
1636 |
03 May 12 |
nicklas |
222 |
encoding="UTF-8" |
1636 |
03 May 12 |
nicklas |
223 |
/> |
1636 |
03 May 12 |
nicklas |
224 |
|
1636 |
03 May 12 |
nicklas |
225 |
<echo>Don't forget to commit the changes to the subversion repository!</echo> |
1636 |
03 May 12 |
nicklas |
226 |
</target> |
1636 |
03 May 12 |
nicklas |
227 |
|
1636 |
03 May 12 |
nicklas |
228 |
|
1245 |
21 Oct 10 |
nicklas |
229 |
</project> |