546 |
18 Jan 08 |
nicklas |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
818 |
21 Nov 08 |
jari |
2 |
<!-- |
818 |
21 Nov 08 |
jari |
$Id$ |
703 |
23 May 08 |
jari |
4 |
|
818 |
21 Nov 08 |
jari |
Copyright (C) 2008 Jari Hakkinen, Nicklas Nordborg |
992 |
14 Mar 09 |
jari |
Copyright (C) 2009 Jari Hakkinen |
703 |
23 May 08 |
jari |
7 |
|
818 |
21 Nov 08 |
jari |
This file is part of the net.sf.basedb.pluginutilities package, a |
818 |
21 Nov 08 |
jari |
utility package that simplifies creation of BASE plug-ins. The |
818 |
21 Nov 08 |
jari |
package is available at http://baseplugins.thep.lu.se/ and BASE |
818 |
21 Nov 08 |
jari |
web site is http://base.thep.lu.se |
546 |
18 Jan 08 |
nicklas |
12 |
|
818 |
21 Nov 08 |
jari |
This is free software; you can redistribute it and/or modify it |
818 |
21 Nov 08 |
jari |
under the terms of the GNU General Public License as published by |
818 |
21 Nov 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
818 |
21 Nov 08 |
jari |
(at your option) any later version. |
818 |
21 Nov 08 |
jari |
17 |
|
818 |
21 Nov 08 |
jari |
The software is distributed in the hope that it will be useful, |
818 |
21 Nov 08 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
818 |
21 Nov 08 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
818 |
21 Nov 08 |
jari |
General Public License for more details. |
818 |
21 Nov 08 |
jari |
22 |
|
818 |
21 Nov 08 |
jari |
You should have received a copy of the GNU General Public License |
992 |
14 Mar 09 |
jari |
along with this software. If not, see <http://www.gnu.org/licenses/>. |
818 |
21 Nov 08 |
jari |
25 |
--> |
847 |
01 Dec 08 |
jari |
26 |
<project name="PluginUtilities" default="build" basedir="."> |
818 |
21 Nov 08 |
jari |
27 |
|
807 |
21 Oct 08 |
nicklas |
<!--create this file if you need to override values from properties below --> |
807 |
21 Oct 08 |
nicklas |
29 |
<property file="build.properties" /> |
807 |
21 Oct 08 |
nicklas |
30 |
|
546 |
18 Jan 08 |
nicklas |
<!-- variables used --> |
847 |
01 Dec 08 |
jari |
32 |
<property name="name" value="PluginUtilities" /> |
1080 |
15 May 09 |
jari |
33 |
<property name="version" value="0.3pre" /> |
546 |
18 Jan 08 |
nicklas |
34 |
<property name="src" location="src" description="Location of source files" /> |
818 |
21 Nov 08 |
jari |
35 |
<property name="build" location="build" |
818 |
21 Nov 08 |
jari |
36 |
description="Location of compiled files" /> |
818 |
21 Nov 08 |
jari |
37 |
<property name="dist" location="dist" |
818 |
21 Nov 08 |
jari |
38 |
description="Directory where distribution should be created" /> |
818 |
21 Nov 08 |
jari |
39 |
<property name="lib" location="lib" |
818 |
21 Nov 08 |
jari |
40 |
description="Directory for jars required for compilation" /> |
818 |
21 Nov 08 |
jari |
41 |
<property name="package" location="package" |
818 |
21 Nov 08 |
jari |
42 |
description="Directory for created packaged distribution files"/> |
992 |
14 Mar 09 |
jari |
43 |
<property name="javac.source" value="1.6" /> |
992 |
14 Mar 09 |
jari |
44 |
<property name="javac.target" value="1.6" /> |
1031 |
07 Apr 09 |
jari |
45 |
<property name="javac.encoding" value="UTF-8" /> |
807 |
21 Oct 08 |
nicklas |
46 |
<property name="depend.jars" |
1035 |
07 Apr 09 |
jari |
47 |
value="http://base2.thep.lu.se/base/jars/2.6.0" |
807 |
21 Oct 08 |
nicklas |
48 |
description="The location of the BASE core JARs that we depend on" |
807 |
21 Oct 08 |
nicklas |
49 |
/> |
546 |
18 Jan 08 |
nicklas |
50 |
|
546 |
18 Jan 08 |
nicklas |
<!-- set up classpath for compiling --> |
546 |
18 Jan 08 |
nicklas |
52 |
<path id="classpath"> |
546 |
18 Jan 08 |
nicklas |
53 |
<fileset dir="lib"> |
546 |
18 Jan 08 |
nicklas |
54 |
<include name="**/*.jar" /> |
546 |
18 Jan 08 |
nicklas |
55 |
</fileset> |
546 |
18 Jan 08 |
nicklas |
56 |
</path> |
546 |
18 Jan 08 |
nicklas |
57 |
|
992 |
14 Mar 09 |
jari |
58 |
<target |
992 |
14 Mar 09 |
jari |
59 |
name="build" |
992 |
14 Mar 09 |
jari |
60 |
depends="init, checkjar" |
992 |
14 Mar 09 |
jari |
61 |
description="Compiles the package" |
992 |
14 Mar 09 |
jari |
62 |
> |
992 |
14 Mar 09 |
jari |
63 |
<javac |
992 |
14 Mar 09 |
jari |
64 |
encoding="${javac.encoding}" |
992 |
14 Mar 09 |
jari |
65 |
srcdir="${src}" |
992 |
14 Mar 09 |
jari |
66 |
destdir="${build}" |
992 |
14 Mar 09 |
jari |
67 |
debug="true" |
992 |
14 Mar 09 |
jari |
68 |
deprecation="true" |
992 |
14 Mar 09 |
jari |
69 |
classpathref="classpath" |
992 |
14 Mar 09 |
jari |
70 |
> |
992 |
14 Mar 09 |
jari |
71 |
</javac> |
546 |
18 Jan 08 |
nicklas |
72 |
</target> |
992 |
14 Mar 09 |
jari |
73 |
|
992 |
14 Mar 09 |
jari |
74 |
<target |
992 |
14 Mar 09 |
jari |
75 |
name="checkjar" |
992 |
14 Mar 09 |
jari |
76 |
description="Check existence of jars BASE2Core and BASE2WSClient." |
992 |
14 Mar 09 |
jari |
77 |
> |
992 |
14 Mar 09 |
jari |
78 |
<available classname="net.sf.basedb.core.Application" |
992 |
14 Mar 09 |
jari |
79 |
classpathref="classpath" property="base2core" /> |
992 |
14 Mar 09 |
jari |
80 |
<available classname="net.sf.basedb.ws.client.SessionClient" |
992 |
14 Mar 09 |
jari |
81 |
classpathref="classpath" property="base2wsclient" /> |
992 |
14 Mar 09 |
jari |
82 |
<fail unless="base2core" message="Can't find BASE2Core.jar in ./lib. Try 'ant download-lib' to download the missing file." /> |
992 |
14 Mar 09 |
jari |
83 |
<fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib. Try 'ant download-lib' to download the missing file." /> |
992 |
14 Mar 09 |
jari |
84 |
<echo>Found BASE2Core.jar and BASE2WSClient.jar.</echo> |
992 |
14 Mar 09 |
jari |
85 |
</target> |
818 |
21 Nov 08 |
jari |
86 |
|
546 |
18 Jan 08 |
nicklas |
87 |
<target name="clean"> |
546 |
18 Jan 08 |
nicklas |
88 |
<delete failonerror="false" includeemptydirs="true"> |
546 |
18 Jan 08 |
nicklas |
89 |
<fileset dir="${build}" defaultexcludes="no" /> |
546 |
18 Jan 08 |
nicklas |
90 |
<fileset dir="${dist}" defaultexcludes="no" /> |
546 |
18 Jan 08 |
nicklas |
91 |
<fileset dir="${package}" defaultexcludes="no" /> |
546 |
18 Jan 08 |
nicklas |
92 |
</delete> |
546 |
18 Jan 08 |
nicklas |
93 |
</target> |
818 |
21 Nov 08 |
jari |
94 |
|
818 |
21 Nov 08 |
jari |
95 |
<target |
818 |
21 Nov 08 |
jari |
96 |
name="dist" |
818 |
21 Nov 08 |
jari |
97 |
depends="clean, build" |
546 |
18 Jan 08 |
nicklas |
98 |
> |
847 |
01 Dec 08 |
jari |
99 |
<property name="jar" value="${name}-${version}.jar" /> |
818 |
21 Nov 08 |
jari |
100 |
<jar |
818 |
21 Nov 08 |
jari |
101 |
jarfile="${dist}/${jar}" |
818 |
21 Nov 08 |
jari |
102 |
basedir="${build}" |
818 |
21 Nov 08 |
jari |
103 |
> |
818 |
21 Nov 08 |
jari |
104 |
</jar> |
546 |
18 Jan 08 |
nicklas |
105 |
<copy todir="${dist}"> |
818 |
21 Nov 08 |
jari |
106 |
<fileset dir="." includes="README*, license.txt" /> |
546 |
18 Jan 08 |
nicklas |
107 |
</copy> |
546 |
18 Jan 08 |
nicklas |
108 |
</target> |
818 |
21 Nov 08 |
jari |
109 |
|
992 |
14 Mar 09 |
jari |
110 |
<target name="distclean" depends="clean" > |
992 |
14 Mar 09 |
jari |
111 |
<delete failonerror="false" includeemptydirs="true"> |
992 |
14 Mar 09 |
jari |
112 |
<fileset dir="${lib}" defaultexcludes="no" /> |
992 |
14 Mar 09 |
jari |
113 |
</delete> |
992 |
14 Mar 09 |
jari |
114 |
</target> |
992 |
14 Mar 09 |
jari |
115 |
|
992 |
14 Mar 09 |
jari |
116 |
<target name="init"> |
992 |
14 Mar 09 |
jari |
117 |
<mkdir dir="${build}" /> |
992 |
14 Mar 09 |
jari |
118 |
<mkdir dir="${dist}" /> |
992 |
14 Mar 09 |
jari |
119 |
<mkdir dir="${lib}" /> |
992 |
14 Mar 09 |
jari |
120 |
</target> |
992 |
14 Mar 09 |
jari |
121 |
|
546 |
18 Jan 08 |
nicklas |
122 |
<target |
546 |
18 Jan 08 |
nicklas |
123 |
name="package" |
629 |
13 Mar 08 |
nicklas |
124 |
depends="dist" |
546 |
18 Jan 08 |
nicklas |
125 |
description="Create binary distribution package" |
546 |
18 Jan 08 |
nicklas |
126 |
> |
546 |
18 Jan 08 |
nicklas |
127 |
<property name="tar.prefix" value="${name}-${version}" /> |
546 |
18 Jan 08 |
nicklas |
128 |
<mkdir dir="${package}" /> |
546 |
18 Jan 08 |
nicklas |
129 |
<tar |
818 |
21 Nov 08 |
jari |
130 |
destfile="${package}/${tar.prefix}.tgz" |
546 |
18 Jan 08 |
nicklas |
131 |
longfile="gnu" |
546 |
18 Jan 08 |
nicklas |
132 |
compression="gzip" |
546 |
18 Jan 08 |
nicklas |
133 |
> |
546 |
18 Jan 08 |
nicklas |
134 |
<tarfileset |
546 |
18 Jan 08 |
nicklas |
135 |
dir="${dist}" |
546 |
18 Jan 08 |
nicklas |
136 |
prefix="${tar.prefix}" |
546 |
18 Jan 08 |
nicklas |
137 |
preserveLeadingSlashes="true" |
546 |
18 Jan 08 |
nicklas |
138 |
> |
546 |
18 Jan 08 |
nicklas |
139 |
</tarfileset> |
546 |
18 Jan 08 |
nicklas |
140 |
</tar> |
818 |
21 Nov 08 |
jari |
141 |
<checksum file="${package}/${tar.prefix}.tgz" /> |
546 |
18 Jan 08 |
nicklas |
142 |
</target> |
818 |
21 Nov 08 |
jari |
143 |
|
818 |
21 Nov 08 |
jari |
144 |
<target |
807 |
21 Oct 08 |
nicklas |
145 |
name="download-lib" |
818 |
21 Nov 08 |
jari |
146 |
depends="init" |
818 |
21 Nov 08 |
jari |
147 |
description="Download jars BASE2Core and BASE2WSClient." |
807 |
21 Oct 08 |
nicklas |
148 |
> |
807 |
21 Oct 08 |
nicklas |
149 |
<echo> |
818 |
21 Nov 08 |
jari |
150 |
------------------------------------------------------- |
818 |
21 Nov 08 |
jari |
151 |
NOTE! You may specify a different download location by |
807 |
21 Oct 08 |
nicklas |
152 |
creating the file './build.properties' and |
807 |
21 Oct 08 |
nicklas |
153 |
setting 'depend.jars' to the URL to download from. |
807 |
21 Oct 08 |
nicklas |
154 |
------------------------------------------------------- |
807 |
21 Oct 08 |
nicklas |
155 |
</echo> |
807 |
21 Oct 08 |
nicklas |
156 |
<download-lib file="BASE2Core.jar" /> |
807 |
21 Oct 08 |
nicklas |
157 |
<download-lib file="BASE2WSClient.jar" /> |
807 |
21 Oct 08 |
nicklas |
158 |
</target> |
818 |
21 Nov 08 |
jari |
159 |
|
807 |
21 Oct 08 |
nicklas |
160 |
<macrodef name="download-lib" description="Download BASE core JAR files"> |
807 |
21 Oct 08 |
nicklas |
161 |
<attribute name="file" /> |
807 |
21 Oct 08 |
nicklas |
162 |
<sequential> |
818 |
21 Nov 08 |
jari |
163 |
<get |
818 |
21 Nov 08 |
jari |
164 |
dest="lib/@{file}" |
818 |
21 Nov 08 |
jari |
165 |
src="${depend.jars}/@{file}" |
818 |
21 Nov 08 |
jari |
166 |
usetimestamp="true" |
807 |
21 Oct 08 |
nicklas |
167 |
verbose="true" |
807 |
21 Oct 08 |
nicklas |
168 |
ignoreerrors="true" |
807 |
21 Oct 08 |
nicklas |
169 |
/> |
807 |
21 Oct 08 |
nicklas |
170 |
</sequential> |
818 |
21 Nov 08 |
jari |
171 |
</macrodef> |
807 |
21 Oct 08 |
nicklas |
172 |
|
546 |
18 Jan 08 |
nicklas |
173 |
</project> |