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