3398 |
15 Jun 15 |
nicklas |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
3398 |
15 Jun 15 |
nicklas |
2 |
<project |
3398 |
15 Jun 15 |
nicklas |
3 |
name="Thumbnails" |
3398 |
15 Jun 15 |
nicklas |
4 |
default="build" |
3398 |
15 Jun 15 |
nicklas |
5 |
basedir="."> |
3398 |
15 Jun 15 |
nicklas |
6 |
|
3398 |
15 Jun 15 |
nicklas |
<!--create this file if you need to override values from properties below --> |
3398 |
15 Jun 15 |
nicklas |
8 |
<property file="build.properties" /> |
3398 |
15 Jun 15 |
nicklas |
9 |
|
3398 |
15 Jun 15 |
nicklas |
<!-- variables used --> |
3398 |
15 Jun 15 |
nicklas |
11 |
<property name="name" value="thumbnails" /> |
6085 |
26 Nov 20 |
nicklas |
12 |
<property name="version" value="1.3-dev" /> |
3398 |
15 Jun 15 |
nicklas |
13 |
<property name="src" location="src" description="Location of source files" /> |
3398 |
15 Jun 15 |
nicklas |
14 |
<property name="build" location="build" description="Location of compiled files" /> |
3398 |
15 Jun 15 |
nicklas |
15 |
<property name="dist" location="dist" description="Directory where distribution should be created" /> |
3398 |
15 Jun 15 |
nicklas |
16 |
<property name="jar.name" value="${name}.jar" description="Name of JAR file with the extensions." /> |
3398 |
15 Jun 15 |
nicklas |
17 |
<property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." /> |
3398 |
15 Jun 15 |
nicklas |
18 |
<property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." /> |
3398 |
15 Jun 15 |
nicklas |
19 |
<property name="javac.arg" value="-Xlint:unchecked" /> |
6042 |
11 Nov 20 |
nicklas |
20 |
<property name="javac.release" value="11" /> |
3398 |
15 Jun 15 |
nicklas |
21 |
<property name="javac.encoding" value="UTF-8" /> |
3398 |
15 Jun 15 |
nicklas |
22 |
<property name="depend.base-version" |
6042 |
11 Nov 20 |
nicklas |
23 |
value="3.17.0" |
3398 |
15 Jun 15 |
nicklas |
24 |
description="The BASE version that this project depends on." |
3398 |
15 Jun 15 |
nicklas |
25 |
/> |
3398 |
15 Jun 15 |
nicklas |
26 |
<property name="depend.jars" |
6301 |
11 Jun 21 |
nicklas |
27 |
value="https://base.thep.lu.se/chrome/site/files/base/jars/${depend.base-version}" |
3398 |
15 Jun 15 |
nicklas |
28 |
description="The location of the BASE core JARs that this project depends on." |
3398 |
15 Jun 15 |
nicklas |
29 |
/> |
3398 |
15 Jun 15 |
nicklas |
30 |
|
3398 |
15 Jun 15 |
nicklas |
<!-- set up classpath for compiling --> |
3398 |
15 Jun 15 |
nicklas |
32 |
<path id="classpath"> |
3398 |
15 Jun 15 |
nicklas |
33 |
<fileset dir="lib"> |
3398 |
15 Jun 15 |
nicklas |
34 |
<include name="**/*.jar" /> |
3398 |
15 Jun 15 |
nicklas |
35 |
</fileset> |
3398 |
15 Jun 15 |
nicklas |
36 |
<fileset dir="META-INF/lib"> |
3398 |
15 Jun 15 |
nicklas |
37 |
<include name="**/*.jar" /> |
3398 |
15 Jun 15 |
nicklas |
38 |
</fileset> |
3398 |
15 Jun 15 |
nicklas |
39 |
</path> |
3398 |
15 Jun 15 |
nicklas |
40 |
|
3398 |
15 Jun 15 |
nicklas |
41 |
<target name="init"> |
3398 |
15 Jun 15 |
nicklas |
42 |
<mkdir dir="${build}" /> |
3398 |
15 Jun 15 |
nicklas |
43 |
<mkdir dir="${dist}" /> |
3398 |
15 Jun 15 |
nicklas |
44 |
</target> |
3398 |
15 Jun 15 |
nicklas |
45 |
|
3398 |
15 Jun 15 |
nicklas |
46 |
<target name="clean"> |
3398 |
15 Jun 15 |
nicklas |
47 |
<delete failonerror="false" includeemptydirs="true"> |
3398 |
15 Jun 15 |
nicklas |
48 |
<fileset dir="${build}" defaultexcludes="no" /> |
3398 |
15 Jun 15 |
nicklas |
49 |
<fileset dir="${dist}" defaultexcludes="no" /> |
3428 |
26 Jun 15 |
nicklas |
50 |
<fileset dir="lib" includes="base-*.jar" /> |
3398 |
15 Jun 15 |
nicklas |
51 |
<fileset file="${jar.name}" /> |
3398 |
15 Jun 15 |
nicklas |
52 |
<fileset file="${tar.name}" /> |
3398 |
15 Jun 15 |
nicklas |
53 |
</delete> |
3398 |
15 Jun 15 |
nicklas |
54 |
</target> |
3398 |
15 Jun 15 |
nicklas |
55 |
|
3398 |
15 Jun 15 |
nicklas |
56 |
<target |
3398 |
15 Jun 15 |
nicklas |
57 |
name="dist" |
3428 |
26 Jun 15 |
nicklas |
58 |
depends="clean,download-lib,build" |
3398 |
15 Jun 15 |
nicklas |
59 |
> |
3398 |
15 Jun 15 |
nicklas |
60 |
<copy todir="${dist}"> |
3398 |
15 Jun 15 |
nicklas |
61 |
<fileset dir="." includes="README,LICENSE" /> |
3398 |
15 Jun 15 |
nicklas |
62 |
<fileset file="${jar.name}" /> |
3398 |
15 Jun 15 |
nicklas |
63 |
</copy> |
3398 |
15 Jun 15 |
nicklas |
64 |
</target> |
3398 |
15 Jun 15 |
nicklas |
65 |
|
3398 |
15 Jun 15 |
nicklas |
66 |
<target |
3398 |
15 Jun 15 |
nicklas |
67 |
name="package" |
3398 |
15 Jun 15 |
nicklas |
68 |
depends="dist" |
3398 |
15 Jun 15 |
nicklas |
69 |
description="Create binary distribution package" |
3398 |
15 Jun 15 |
nicklas |
70 |
> |
3398 |
15 Jun 15 |
nicklas |
71 |
<tar |
3398 |
15 Jun 15 |
nicklas |
72 |
destfile="${tar.name}" |
3398 |
15 Jun 15 |
nicklas |
73 |
longfile="gnu" |
3398 |
15 Jun 15 |
nicklas |
74 |
compression="gzip" |
3398 |
15 Jun 15 |
nicklas |
75 |
> |
3398 |
15 Jun 15 |
nicklas |
76 |
<tarfileset |
3398 |
15 Jun 15 |
nicklas |
77 |
dir="${dist}" |
3398 |
15 Jun 15 |
nicklas |
78 |
mode="755" |
3398 |
15 Jun 15 |
nicklas |
79 |
prefix="${tar.prefix}" |
3398 |
15 Jun 15 |
nicklas |
80 |
preserveLeadingSlashes="true" |
3398 |
15 Jun 15 |
nicklas |
81 |
> |
3398 |
15 Jun 15 |
nicklas |
82 |
<include name="**/*.sh" /> |
3398 |
15 Jun 15 |
nicklas |
83 |
</tarfileset> |
3398 |
15 Jun 15 |
nicklas |
84 |
<tarfileset |
3398 |
15 Jun 15 |
nicklas |
85 |
dir="${dist}" |
3398 |
15 Jun 15 |
nicklas |
86 |
prefix="${tar.prefix}" |
3398 |
15 Jun 15 |
nicklas |
87 |
preserveLeadingSlashes="true" |
3398 |
15 Jun 15 |
nicklas |
88 |
> |
3398 |
15 Jun 15 |
nicklas |
89 |
<exclude name="**/*.sh" /> |
3398 |
15 Jun 15 |
nicklas |
90 |
</tarfileset> |
3398 |
15 Jun 15 |
nicklas |
91 |
</tar> |
3398 |
15 Jun 15 |
nicklas |
92 |
</target> |
3398 |
15 Jun 15 |
nicklas |
93 |
|
3398 |
15 Jun 15 |
nicklas |
94 |
<target |
3398 |
15 Jun 15 |
nicklas |
95 |
name="install" |
3398 |
15 Jun 15 |
nicklas |
96 |
depends="build" |
3398 |
15 Jun 15 |
nicklas |
97 |
> |
3398 |
15 Jun 15 |
nicklas |
98 |
<fail unless="base.plugins" message="base.plugins is not set to the path of BASE plug-ins directory." /> |
3398 |
15 Jun 15 |
nicklas |
99 |
<copy todir="${base.plugins}"> |
3398 |
15 Jun 15 |
nicklas |
100 |
<fileset file="${jar.name}" /> |
3398 |
15 Jun 15 |
nicklas |
101 |
</copy> |
3398 |
15 Jun 15 |
nicklas |
102 |
<echo>Copied '${jar.name}' to '${base.plugins}'.</echo> |
3398 |
15 Jun 15 |
nicklas |
103 |
</target> |
3398 |
15 Jun 15 |
nicklas |
104 |
|
3398 |
15 Jun 15 |
nicklas |
105 |
<target |
3398 |
15 Jun 15 |
nicklas |
106 |
name="build" |
3398 |
15 Jun 15 |
nicklas |
107 |
depends="init,checkjar" |
3398 |
15 Jun 15 |
nicklas |
108 |
description="Compiles the plugin and put in jar" |
3398 |
15 Jun 15 |
nicklas |
109 |
> |
3398 |
15 Jun 15 |
nicklas |
110 |
<mkdir dir="${build}" /> |
3398 |
15 Jun 15 |
nicklas |
111 |
<javac |
3398 |
15 Jun 15 |
nicklas |
112 |
encoding="${javac.encoding}" |
3398 |
15 Jun 15 |
nicklas |
113 |
srcdir="${src}" |
3398 |
15 Jun 15 |
nicklas |
114 |
destdir="${build}" |
3398 |
15 Jun 15 |
nicklas |
115 |
debug="true" |
3398 |
15 Jun 15 |
nicklas |
116 |
includeantruntime="false" |
3398 |
15 Jun 15 |
nicklas |
117 |
classpathref="classpath" |
6042 |
11 Nov 20 |
nicklas |
118 |
release="${javac.release}" |
3398 |
15 Jun 15 |
nicklas |
119 |
> |
3398 |
15 Jun 15 |
nicklas |
120 |
<compilerarg value="${javac.arg}" /> |
3398 |
15 Jun 15 |
nicklas |
121 |
</javac> |
3398 |
15 Jun 15 |
nicklas |
122 |
<jar |
3398 |
15 Jun 15 |
nicklas |
123 |
jarfile="${jar.name}" |
3398 |
15 Jun 15 |
nicklas |
124 |
manifest="META-INF/MANIFEST.MF" |
3398 |
15 Jun 15 |
nicklas |
125 |
> |
3398 |
15 Jun 15 |
nicklas |
126 |
<fileset dir="${build}" /> |
3398 |
15 Jun 15 |
nicklas |
127 |
<fileset dir="." includes="META-INF/**" /> |
3398 |
15 Jun 15 |
nicklas |
128 |
<fileset dir="." includes="resources/**" /> |
3398 |
15 Jun 15 |
nicklas |
129 |
</jar> |
3398 |
15 Jun 15 |
nicklas |
130 |
</target> |
3398 |
15 Jun 15 |
nicklas |
131 |
|
3398 |
15 Jun 15 |
nicklas |
132 |
<target |
3398 |
15 Jun 15 |
nicklas |
133 |
name="checkjar" |
3398 |
15 Jun 15 |
nicklas |
134 |
description="Checks that the base-core-${depend.base-version}.jar exists." |
3398 |
15 Jun 15 |
nicklas |
135 |
> |
3398 |
15 Jun 15 |
nicklas |
136 |
<available classname="net.sf.basedb.core.Application" |
3398 |
15 Jun 15 |
nicklas |
137 |
classpathref="classpath" property="base-core" /> |
3398 |
15 Jun 15 |
nicklas |
138 |
<available classname="net.sf.basedb.clients.web.Base" |
3398 |
15 Jun 15 |
nicklas |
139 |
classpathref="classpath" property="base-web" /> |
3398 |
15 Jun 15 |
nicklas |
140 |
|
3398 |
15 Jun 15 |
nicklas |
141 |
<fail unless="base-core" message="Can't find base-core-${depend.base-version}.jar in ./lib. Try 'ant download-lib' to download the missing file." /> |
3398 |
15 Jun 15 |
nicklas |
142 |
<fail unless="base-web" message="Can't find base-webclient-${depend.base-version}.jar in ./lib. Try 'ant download-lib' to download the missing file." /> |
3398 |
15 Jun 15 |
nicklas |
143 |
<echo>Found base-core-${depend.base-version}.jar.</echo> |
3398 |
15 Jun 15 |
nicklas |
144 |
<echo>Found base-webclient-${depend.base-version}.jar.</echo> |
3398 |
15 Jun 15 |
nicklas |
145 |
</target> |
3398 |
15 Jun 15 |
nicklas |
146 |
|
3398 |
15 Jun 15 |
nicklas |
147 |
<target |
3398 |
15 Jun 15 |
nicklas |
148 |
name="download-lib" |
3398 |
15 Jun 15 |
nicklas |
149 |
description="Download base-core-${depend.base-version}.jar." |
3398 |
15 Jun 15 |
nicklas |
150 |
> |
3398 |
15 Jun 15 |
nicklas |
151 |
<echo> |
3398 |
15 Jun 15 |
nicklas |
152 |
------------------------------------------------------- |
3398 |
15 Jun 15 |
nicklas |
153 |
NOTE! You may specifiy a different download location by |
3398 |
15 Jun 15 |
nicklas |
154 |
creating the file './build.properties' and |
3398 |
15 Jun 15 |
nicklas |
155 |
setting 'depend.jars' to the URL to download from. |
3398 |
15 Jun 15 |
nicklas |
156 |
------------------------------------------------------- |
3398 |
15 Jun 15 |
nicklas |
157 |
</echo> |
3398 |
15 Jun 15 |
nicklas |
158 |
<download-lib file="base-core-${depend.base-version}.jar" /> |
3398 |
15 Jun 15 |
nicklas |
159 |
<download-lib file="base-webclient-${depend.base-version}.jar" /> |
3398 |
15 Jun 15 |
nicklas |
160 |
</target> |
3398 |
15 Jun 15 |
nicklas |
161 |
|
3398 |
15 Jun 15 |
nicklas |
162 |
<macrodef name="download-lib" description="Download BASE core JAR files"> |
3398 |
15 Jun 15 |
nicklas |
163 |
<attribute name="file" /> |
3398 |
15 Jun 15 |
nicklas |
164 |
<sequential> |
3398 |
15 Jun 15 |
nicklas |
165 |
<get |
3398 |
15 Jun 15 |
nicklas |
166 |
dest="lib/@{file}" |
3398 |
15 Jun 15 |
nicklas |
167 |
src="${depend.jars}/@{file}" |
3398 |
15 Jun 15 |
nicklas |
168 |
usetimestamp="true" |
3398 |
15 Jun 15 |
nicklas |
169 |
verbose="true" |
3398 |
15 Jun 15 |
nicklas |
170 |
ignoreerrors="true" |
3398 |
15 Jun 15 |
nicklas |
171 |
/> |
3398 |
15 Jun 15 |
nicklas |
172 |
</sequential> |
3398 |
15 Jun 15 |
nicklas |
173 |
</macrodef> |
3398 |
15 Jun 15 |
nicklas |
174 |
|
3398 |
15 Jun 15 |
nicklas |
175 |
<target name="update-version"> |
3398 |
15 Jun 15 |
nicklas |
176 |
<echo>Setting version to: ${version}</echo> |
3398 |
15 Jun 15 |
nicklas |
177 |
|
3398 |
15 Jun 15 |
nicklas |
178 |
<echo>Thumbnails.java</echo> |
3398 |
15 Jun 15 |
nicklas |
179 |
<replaceregexp |
3398 |
15 Jun 15 |
nicklas |
180 |
file="${src}/net/sf/basedb/thumbnails/Thumbnails.java" |
3398 |
15 Jun 15 |
nicklas |
181 |
match="public static final String VERSION = ".*";" |
3398 |
15 Jun 15 |
nicklas |
182 |
replace="public static final String VERSION = "${version}";" |
3398 |
15 Jun 15 |
nicklas |
183 |
encoding="UTF-8" |
3398 |
15 Jun 15 |
nicklas |
184 |
/> |
3398 |
15 Jun 15 |
nicklas |
185 |
|
3398 |
15 Jun 15 |
nicklas |
186 |
<echo>extensions.xml</echo> |
3398 |
15 Jun 15 |
nicklas |
187 |
<replaceregexp |
3398 |
15 Jun 15 |
nicklas |
188 |
file="META-INF/extensions.xml" |
3398 |
15 Jun 15 |
nicklas |
189 |
match="<version>.*</version>" |
3398 |
15 Jun 15 |
nicklas |
190 |
replace="<version>${version}</version>" |
3398 |
15 Jun 15 |
nicklas |
191 |
encoding="UTF-8" |
3398 |
15 Jun 15 |
nicklas |
192 |
/> |
3398 |
15 Jun 15 |
nicklas |
193 |
<replaceregexp |
3398 |
15 Jun 15 |
nicklas |
194 |
file="META-INF/extensions.xml" |
3398 |
15 Jun 15 |
nicklas |
195 |
match="<min-base-version>.*</min-base-version>" |
3398 |
15 Jun 15 |
nicklas |
196 |
replace="<min-base-version>${depend.base-version}</min-base-version>" |
3398 |
15 Jun 15 |
nicklas |
197 |
encoding="UTF-8" |
3398 |
15 Jun 15 |
nicklas |
198 |
/> |
3398 |
15 Jun 15 |
nicklas |
199 |
|
6042 |
11 Nov 20 |
nicklas |
200 |
<echo>.classpath</echo> |
6042 |
11 Nov 20 |
nicklas |
201 |
<replaceregexp |
6042 |
11 Nov 20 |
nicklas |
202 |
file=".classpath" |
6042 |
11 Nov 20 |
nicklas |
203 |
match="base-(\w+)-[0-9.]+jar" |
6042 |
11 Nov 20 |
nicklas |
204 |
replace="base-\1-${depend.base-version}.jar" |
6042 |
11 Nov 20 |
nicklas |
205 |
encoding="UTF-8" |
6042 |
11 Nov 20 |
nicklas |
206 |
byline="true" |
6042 |
11 Nov 20 |
nicklas |
207 |
/> |
6042 |
11 Nov 20 |
nicklas |
208 |
|
3398 |
15 Jun 15 |
nicklas |
209 |
<echo>Don't forget to commit the changes to the subversion repository!</echo> |
3398 |
15 Jun 15 |
nicklas |
210 |
</target> |
3398 |
15 Jun 15 |
nicklas |
211 |
|
3398 |
15 Jun 15 |
nicklas |
212 |
</project> |