636 |
19 Mar 08 |
nicklas |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
1391 |
15 Sep 11 |
nicklas |
2 |
<!-- |
1391 |
15 Sep 11 |
nicklas |
Copyright (C) 2011 Nicklas Nordborg |
1391 |
15 Sep 11 |
nicklas |
4 |
|
1391 |
15 Sep 11 |
nicklas |
This file is part of the Example Code Package for BASE. |
1391 |
15 Sep 11 |
nicklas |
Available at http://baseplugins.thep.lu.se/ |
1391 |
15 Sep 11 |
nicklas |
BASE main site: http://base.thep.lu.se/ |
1391 |
15 Sep 11 |
nicklas |
8 |
|
1391 |
15 Sep 11 |
nicklas |
This is free software; you can redistribute it and/or |
1391 |
15 Sep 11 |
nicklas |
modify it under the terms of the GNU General Public License |
1391 |
15 Sep 11 |
nicklas |
as published by the Free Software Foundation; either version 3 |
1391 |
15 Sep 11 |
nicklas |
of the License, or (at your option) any later version. |
1391 |
15 Sep 11 |
nicklas |
13 |
|
1391 |
15 Sep 11 |
nicklas |
The software is distributed in the hope that it will be useful, |
1391 |
15 Sep 11 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1391 |
15 Sep 11 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1391 |
15 Sep 11 |
nicklas |
GNU General Public License for more details. |
1391 |
15 Sep 11 |
nicklas |
18 |
|
1391 |
15 Sep 11 |
nicklas |
You should have received a copy of the GNU General Public License |
1391 |
15 Sep 11 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1391 |
15 Sep 11 |
nicklas |
21 |
--> |
636 |
19 Mar 08 |
nicklas |
22 |
<project |
1391 |
15 Sep 11 |
nicklas |
23 |
name="ExampleCode" |
638 |
20 Mar 08 |
nicklas |
24 |
default="build" |
636 |
19 Mar 08 |
nicklas |
25 |
basedir="."> |
636 |
19 Mar 08 |
nicklas |
26 |
|
691 |
12 May 08 |
nicklas |
<!--create this file if you need to override values from properties below --> |
691 |
12 May 08 |
nicklas |
28 |
<property file="build.properties" /> |
691 |
12 May 08 |
nicklas |
29 |
|
636 |
19 Mar 08 |
nicklas |
<!-- variables used --> |
1346 |
18 Apr 11 |
nicklas |
31 |
<property name="name" value="base-examples" /> |
4336 |
02 Feb 17 |
nicklas |
32 |
<property name="version" value="1.9-dev" /> |
636 |
19 Mar 08 |
nicklas |
33 |
<property name="src" location="src" description="Location of source files" /> |
636 |
19 Mar 08 |
nicklas |
34 |
<property name="build" location="build" description="Location of compiled files" /> |
636 |
19 Mar 08 |
nicklas |
35 |
<property name="dist" location="dist" description="Directory where distribution should be created" /> |
638 |
20 Mar 08 |
nicklas |
36 |
<property name="jar.name" value="${name}.jar" description="Name of JAR file with the extensions." /> |
638 |
20 Mar 08 |
nicklas |
37 |
<property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." /> |
638 |
20 Mar 08 |
nicklas |
38 |
<property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." /> |
636 |
19 Mar 08 |
nicklas |
39 |
<property name="javac.arg" value="-Xlint:unchecked" /> |
4236 |
15 Nov 16 |
nicklas |
40 |
<property name="javac.source" value="1.8" /> |
4236 |
15 Nov 16 |
nicklas |
41 |
<property name="javac.target" value="1.8" /> |
1024 |
07 Apr 09 |
nicklas |
42 |
<property name="javac.encoding" value="UTF-8" /> |
1346 |
18 Apr 11 |
nicklas |
43 |
<property name="depend.base-version" |
4237 |
15 Nov 16 |
nicklas |
44 |
value="3.10.0" |
1346 |
18 Apr 11 |
nicklas |
45 |
description="The BASE version that this project depends on." |
1346 |
18 Apr 11 |
nicklas |
46 |
/> |
691 |
12 May 08 |
nicklas |
47 |
<property name="depend.jars" |
6295 |
11 Jun 21 |
nicklas |
48 |
value="https://base.thep.lu.se/chrome/site/files/base/jars/${depend.base-version}" |
1346 |
18 Apr 11 |
nicklas |
49 |
description="The location of the BASE core JARs that this project depends on." |
691 |
12 May 08 |
nicklas |
50 |
/> |
636 |
19 Mar 08 |
nicklas |
51 |
|
636 |
19 Mar 08 |
nicklas |
<!-- set up classpath for compiling --> |
636 |
19 Mar 08 |
nicklas |
53 |
<path id="classpath"> |
636 |
19 Mar 08 |
nicklas |
54 |
<fileset dir="lib"> |
636 |
19 Mar 08 |
nicklas |
55 |
<include name="**/*.jar" /> |
636 |
19 Mar 08 |
nicklas |
56 |
</fileset> |
636 |
19 Mar 08 |
nicklas |
57 |
</path> |
636 |
19 Mar 08 |
nicklas |
58 |
|
636 |
19 Mar 08 |
nicklas |
59 |
<target name="init"> |
636 |
19 Mar 08 |
nicklas |
60 |
<mkdir dir="${build}" /> |
636 |
19 Mar 08 |
nicklas |
61 |
<mkdir dir="${dist}" /> |
636 |
19 Mar 08 |
nicklas |
62 |
</target> |
636 |
19 Mar 08 |
nicklas |
63 |
|
636 |
19 Mar 08 |
nicklas |
64 |
<target name="clean"> |
636 |
19 Mar 08 |
nicklas |
65 |
<delete failonerror="false" includeemptydirs="true"> |
636 |
19 Mar 08 |
nicklas |
66 |
<fileset dir="${build}" defaultexcludes="no" /> |
636 |
19 Mar 08 |
nicklas |
67 |
<fileset dir="${dist}" defaultexcludes="no" /> |
638 |
20 Mar 08 |
nicklas |
68 |
<fileset file="${jar.name}" /> |
638 |
20 Mar 08 |
nicklas |
69 |
<fileset file="${tar.name}" /> |
636 |
19 Mar 08 |
nicklas |
70 |
</delete> |
636 |
19 Mar 08 |
nicklas |
71 |
</target> |
636 |
19 Mar 08 |
nicklas |
72 |
|
636 |
19 Mar 08 |
nicklas |
73 |
<target |
636 |
19 Mar 08 |
nicklas |
74 |
name="dist" |
636 |
19 Mar 08 |
nicklas |
75 |
depends="clean,build" |
636 |
19 Mar 08 |
nicklas |
76 |
> |
636 |
19 Mar 08 |
nicklas |
77 |
<copy todir="${dist}"> |
637 |
19 Mar 08 |
nicklas |
78 |
<fileset dir="." includes="README,LICENSE,RELEASE,build.xml" /> |
637 |
19 Mar 08 |
nicklas |
79 |
<fileset dir="." includes="src/**,resources/**,META-INF/**" /> |
1094 |
28 May 09 |
nicklas |
80 |
<fileset dir="." includes="lib/compile/*" /> |
692 |
13 May 08 |
nicklas |
81 |
<fileset file="${jar.name}" /> |
636 |
19 Mar 08 |
nicklas |
82 |
</copy> |
636 |
19 Mar 08 |
nicklas |
83 |
</target> |
636 |
19 Mar 08 |
nicklas |
84 |
|
636 |
19 Mar 08 |
nicklas |
85 |
<target |
636 |
19 Mar 08 |
nicklas |
86 |
name="package" |
636 |
19 Mar 08 |
nicklas |
87 |
depends="dist" |
636 |
19 Mar 08 |
nicklas |
88 |
description="Create binary distribution package" |
636 |
19 Mar 08 |
nicklas |
89 |
> |
636 |
19 Mar 08 |
nicklas |
90 |
<tar |
638 |
20 Mar 08 |
nicklas |
91 |
destfile="${tar.name}" |
636 |
19 Mar 08 |
nicklas |
92 |
longfile="gnu" |
636 |
19 Mar 08 |
nicklas |
93 |
compression="gzip" |
636 |
19 Mar 08 |
nicklas |
94 |
> |
636 |
19 Mar 08 |
nicklas |
95 |
<tarfileset |
636 |
19 Mar 08 |
nicklas |
96 |
dir="${dist}" |
636 |
19 Mar 08 |
nicklas |
97 |
mode="755" |
636 |
19 Mar 08 |
nicklas |
98 |
prefix="${tar.prefix}" |
636 |
19 Mar 08 |
nicklas |
99 |
preserveLeadingSlashes="true" |
636 |
19 Mar 08 |
nicklas |
100 |
> |
636 |
19 Mar 08 |
nicklas |
101 |
<include name="**/*.sh" /> |
636 |
19 Mar 08 |
nicklas |
102 |
</tarfileset> |
636 |
19 Mar 08 |
nicklas |
103 |
<tarfileset |
636 |
19 Mar 08 |
nicklas |
104 |
dir="${dist}" |
636 |
19 Mar 08 |
nicklas |
105 |
prefix="${tar.prefix}" |
636 |
19 Mar 08 |
nicklas |
106 |
preserveLeadingSlashes="true" |
636 |
19 Mar 08 |
nicklas |
107 |
> |
636 |
19 Mar 08 |
nicklas |
108 |
<exclude name="**/*.sh" /> |
636 |
19 Mar 08 |
nicklas |
109 |
</tarfileset> |
636 |
19 Mar 08 |
nicklas |
110 |
</tar> |
636 |
19 Mar 08 |
nicklas |
111 |
</target> |
636 |
19 Mar 08 |
nicklas |
112 |
|
636 |
19 Mar 08 |
nicklas |
113 |
<target |
636 |
19 Mar 08 |
nicklas |
114 |
name="build" |
636 |
19 Mar 08 |
nicklas |
115 |
depends="init,checkjar" |
636 |
19 Mar 08 |
nicklas |
116 |
description="Compiles the plugin and put in jar" |
636 |
19 Mar 08 |
nicklas |
117 |
> |
636 |
19 Mar 08 |
nicklas |
118 |
<mkdir dir="${build}" /> |
636 |
19 Mar 08 |
nicklas |
119 |
<javac |
636 |
19 Mar 08 |
nicklas |
120 |
encoding="${javac.encoding}" |
636 |
19 Mar 08 |
nicklas |
121 |
srcdir="${src}" |
636 |
19 Mar 08 |
nicklas |
122 |
destdir="${build}" |
636 |
19 Mar 08 |
nicklas |
123 |
debug="true" |
1268 |
10 Nov 10 |
nicklas |
124 |
includeantruntime="false" |
636 |
19 Mar 08 |
nicklas |
125 |
classpathref="classpath" |
636 |
19 Mar 08 |
nicklas |
126 |
source="${javac.source}" |
636 |
19 Mar 08 |
nicklas |
127 |
target="${javac.target}" |
636 |
19 Mar 08 |
nicklas |
128 |
> |
636 |
19 Mar 08 |
nicklas |
129 |
<compilerarg value="${javac.arg}" /> |
636 |
19 Mar 08 |
nicklas |
130 |
</javac> |
636 |
19 Mar 08 |
nicklas |
131 |
<copy todir="${build}"> |
636 |
19 Mar 08 |
nicklas |
132 |
<fileset dir="." includes="META-INF/*" /> |
636 |
19 Mar 08 |
nicklas |
133 |
<fileset dir="." includes="resources/**" /> |
636 |
19 Mar 08 |
nicklas |
134 |
</copy> |
636 |
19 Mar 08 |
nicklas |
135 |
<jar |
638 |
20 Mar 08 |
nicklas |
136 |
jarfile="${jar.name}" |
636 |
19 Mar 08 |
nicklas |
137 |
basedir="${build}" |
636 |
19 Mar 08 |
nicklas |
138 |
> |
636 |
19 Mar 08 |
nicklas |
139 |
</jar> |
636 |
19 Mar 08 |
nicklas |
140 |
</target> |
636 |
19 Mar 08 |
nicklas |
141 |
|
636 |
19 Mar 08 |
nicklas |
142 |
<target |
636 |
19 Mar 08 |
nicklas |
143 |
name="checkjar" |
1346 |
18 Apr 11 |
nicklas |
144 |
description="Checks that the base-core-${depend.base-version}.jar and base-webclient-${depend.base-version}.jar exists." |
636 |
19 Mar 08 |
nicklas |
145 |
> |
636 |
19 Mar 08 |
nicklas |
146 |
<available classname="net.sf.basedb.core.Application" |
1350 |
27 Apr 11 |
nicklas |
147 |
classpathref="classpath" property="baseCore" /> |
636 |
19 Mar 08 |
nicklas |
148 |
<available classname="net.sf.basedb.clients.web.Base" |
1350 |
27 Apr 11 |
nicklas |
149 |
classpathref="classpath" property="baseWeb" /> |
1350 |
27 Apr 11 |
nicklas |
150 |
<fail unless="baseCore" message="Can't find base-core-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
1350 |
27 Apr 11 |
nicklas |
151 |
<fail unless="baseWeb" message="Can't find base-webclient-${depend.base-version}.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
1346 |
18 Apr 11 |
nicklas |
152 |
<echo>Found all requried BASE core JAR files.</echo> |
636 |
19 Mar 08 |
nicklas |
153 |
</target> |
691 |
12 May 08 |
nicklas |
154 |
|
691 |
12 May 08 |
nicklas |
155 |
<target |
1346 |
18 Apr 11 |
nicklas |
156 |
name="install" |
1346 |
18 Apr 11 |
nicklas |
157 |
depends="build" |
1346 |
18 Apr 11 |
nicklas |
158 |
> |
1346 |
18 Apr 11 |
nicklas |
159 |
<fail unless="base.plugins" message="base.plugins is not set to the path of BASE plug-ins directory." /> |
1346 |
18 Apr 11 |
nicklas |
160 |
<copy todir="${base.plugins}"> |
1346 |
18 Apr 11 |
nicklas |
161 |
<fileset file="${jar.name}" /> |
1346 |
18 Apr 11 |
nicklas |
162 |
</copy> |
1346 |
18 Apr 11 |
nicklas |
163 |
<echo>Copied '${jar.name}' to '${base.plugins}'.</echo> |
1346 |
18 Apr 11 |
nicklas |
164 |
</target> |
1346 |
18 Apr 11 |
nicklas |
165 |
|
1346 |
18 Apr 11 |
nicklas |
166 |
<target name="update-version"> |
1346 |
18 Apr 11 |
nicklas |
167 |
<echo>Setting version to: ${version}</echo> |
1346 |
18 Apr 11 |
nicklas |
168 |
|
1346 |
18 Apr 11 |
nicklas |
169 |
<echo>extensions.xml</echo> |
1346 |
18 Apr 11 |
nicklas |
170 |
<replaceregexp |
1346 |
18 Apr 11 |
nicklas |
171 |
file="META-INF/extensions.xml" |
1346 |
18 Apr 11 |
nicklas |
172 |
match="<version>.*</version>" |
1346 |
18 Apr 11 |
nicklas |
173 |
replace="<version>${version}</version>" |
1346 |
18 Apr 11 |
nicklas |
174 |
encoding="UTF-8" |
1346 |
18 Apr 11 |
nicklas |
175 |
/> |
1352 |
28 Apr 11 |
nicklas |
176 |
<replaceregexp |
1352 |
28 Apr 11 |
nicklas |
177 |
file="META-INF/extensions.xml" |
1352 |
28 Apr 11 |
nicklas |
178 |
match="<min-base-version>.*</min-base-version>" |
1352 |
28 Apr 11 |
nicklas |
179 |
replace="<min-base-version>${depend.base-version}</min-base-version>" |
1352 |
28 Apr 11 |
nicklas |
180 |
encoding="UTF-8" |
1352 |
28 Apr 11 |
nicklas |
181 |
/> |
1346 |
18 Apr 11 |
nicklas |
182 |
<echo>Don't forget to commit the changes to the subversion repository!</echo> |
1346 |
18 Apr 11 |
nicklas |
183 |
</target> |
1346 |
18 Apr 11 |
nicklas |
184 |
|
1346 |
18 Apr 11 |
nicklas |
185 |
|
1346 |
18 Apr 11 |
nicklas |
186 |
<target |
691 |
12 May 08 |
nicklas |
187 |
name="download-lib" |
1350 |
27 Apr 11 |
nicklas |
188 |
description="Download base-core-${depend.base-version}.jar and base-webclient-${depend.base-version}.jar." |
691 |
12 May 08 |
nicklas |
189 |
> |
691 |
12 May 08 |
nicklas |
190 |
<echo> |
691 |
12 May 08 |
nicklas |
191 |
------------------------------------------------------- |
691 |
12 May 08 |
nicklas |
192 |
NOTE! You may specifiy a different download location by |
691 |
12 May 08 |
nicklas |
193 |
creating the file './build.properties' and |
691 |
12 May 08 |
nicklas |
194 |
setting 'depend.jars' to the URL to download from. |
691 |
12 May 08 |
nicklas |
195 |
------------------------------------------------------- |
691 |
12 May 08 |
nicklas |
196 |
</echo> |
1346 |
18 Apr 11 |
nicklas |
197 |
<download-lib file="base-core-${depend.base-version}.jar" /> |
1346 |
18 Apr 11 |
nicklas |
198 |
<download-lib file="base-webclient-${depend.base-version}.jar" /> |
691 |
12 May 08 |
nicklas |
199 |
</target> |
691 |
12 May 08 |
nicklas |
200 |
|
691 |
12 May 08 |
nicklas |
201 |
<macrodef name="download-lib" description="Download BASE core JAR files"> |
691 |
12 May 08 |
nicklas |
202 |
<attribute name="file" /> |
691 |
12 May 08 |
nicklas |
203 |
<sequential> |
691 |
12 May 08 |
nicklas |
204 |
<get |
691 |
12 May 08 |
nicklas |
205 |
dest="lib/compile/@{file}" |
691 |
12 May 08 |
nicklas |
206 |
src="${depend.jars}/@{file}" |
691 |
12 May 08 |
nicklas |
207 |
usetimestamp="true" |
691 |
12 May 08 |
nicklas |
208 |
verbose="true" |
691 |
12 May 08 |
nicklas |
209 |
ignoreerrors="true" |
691 |
12 May 08 |
nicklas |
210 |
/> |
691 |
12 May 08 |
nicklas |
211 |
</sequential> |
691 |
12 May 08 |
nicklas |
212 |
</macrodef> |
636 |
19 Mar 08 |
nicklas |
213 |
</project> |