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