1199 |
06 Mar 10 |
jari |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
1199 |
06 Mar 10 |
jari |
2 |
|
1199 |
06 Mar 10 |
jari |
<!-- $Id$ --> |
1199 |
06 Mar 10 |
jari |
4 |
|
1199 |
06 Mar 10 |
jari |
5 |
<!-- |
1199 |
06 Mar 10 |
jari |
Copyright (C) 2010 Jari Häkkinen |
1199 |
06 Mar 10 |
jari |
7 |
|
1199 |
06 Mar 10 |
jari |
This file is part of Agilent plug-in package for BASE. |
1199 |
06 Mar 10 |
jari |
Available at http://baseplugins.thep.lu.se/ |
1199 |
06 Mar 10 |
jari |
BASE main site: http://base.thep.lu.se/ |
1199 |
06 Mar 10 |
jari |
11 |
|
1199 |
06 Mar 10 |
jari |
This is a free software; you can redistribute it and/or modify it |
1199 |
06 Mar 10 |
jari |
under the terms of the GNU General Public License as published by |
1199 |
06 Mar 10 |
jari |
the Free Software Foundation; either version 3 of the License, or |
1199 |
06 Mar 10 |
jari |
(at your option) any later version. |
1199 |
06 Mar 10 |
jari |
16 |
|
1199 |
06 Mar 10 |
jari |
This software is distributed in the hope that it will be useful, but |
1199 |
06 Mar 10 |
jari |
WITHOUT ANY WARRANTY; without even the implied warranty of |
1199 |
06 Mar 10 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1199 |
06 Mar 10 |
jari |
General Public License for more details. |
1199 |
06 Mar 10 |
jari |
21 |
|
1199 |
06 Mar 10 |
jari |
You should have received a copy of the GNU General Public License |
1199 |
06 Mar 10 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1199 |
06 Mar 10 |
jari |
24 |
--> |
1199 |
06 Mar 10 |
jari |
25 |
|
1199 |
06 Mar 10 |
jari |
26 |
<project |
1199 |
06 Mar 10 |
jari |
27 |
name="AgilentPlugins" |
1199 |
06 Mar 10 |
jari |
28 |
default="dist" |
1199 |
06 Mar 10 |
jari |
29 |
basedir="."> |
1199 |
06 Mar 10 |
jari |
30 |
|
1199 |
06 Mar 10 |
jari |
31 |
<description> |
1199 |
06 Mar 10 |
jari |
32 |
Build file for the Agilent plug-in package for BASE. The main |
1199 |
06 Mar 10 |
jari |
33 |
targets are ('dist' is default): |
1199 |
06 Mar 10 |
jari |
34 |
|
1199 |
06 Mar 10 |
jari |
35 |
Clean up: |
1199 |
06 Mar 10 |
jari |
36 |
clean Remove generated files |
1199 |
06 Mar 10 |
jari |
37 |
distclean Remove all generated and downloaded files |
1199 |
06 Mar 10 |
jari |
38 |
|
1199 |
06 Mar 10 |
jari |
39 |
Compiling: |
1199 |
06 Mar 10 |
jari |
40 |
build Build all Java code |
1199 |
06 Mar 10 |
jari |
41 |
dist Build all Java code for distribution (put in 'dist' |
1199 |
06 Mar 10 |
jari |
42 |
subdirectory) |
1199 |
06 Mar 10 |
jari |
43 |
download-lib Download required external dependecy files |
1199 |
06 Mar 10 |
jari |
44 |
|
1199 |
06 Mar 10 |
jari |
45 |
Packaging: |
1199 |
06 Mar 10 |
jari |
46 |
package: Create *.tar.gz file containing required files. |
1199 |
06 Mar 10 |
jari |
47 |
</description> |
1199 |
06 Mar 10 |
jari |
48 |
|
1199 |
06 Mar 10 |
jari |
<!--create this file if you need to override values from properties below --> |
1199 |
06 Mar 10 |
jari |
50 |
<property file="build.properties" /> |
1199 |
06 Mar 10 |
jari |
51 |
|
1199 |
06 Mar 10 |
jari |
<!-- variables used --> |
1199 |
06 Mar 10 |
jari |
53 |
<property name="depend.jars" |
1199 |
06 Mar 10 |
jari |
54 |
value="http://base2.thep.lu.se/base/jars/2.14.0" |
1199 |
06 Mar 10 |
jari |
55 |
description="The location of the BASE core JARs that we depend on" /> |
1199 |
06 Mar 10 |
jari |
56 |
<property name="name" value="agilent-plugins" /> |
1215 |
26 Mar 10 |
jari |
57 |
<property name="version" value="1.1" /> |
1199 |
06 Mar 10 |
jari |
<!-- directories --> |
1199 |
06 Mar 10 |
jari |
59 |
<property name="build" location="build" |
1199 |
06 Mar 10 |
jari |
60 |
description="Location of compiled files" /> |
1199 |
06 Mar 10 |
jari |
61 |
<property name="dist" location="dist" |
1199 |
06 Mar 10 |
jari |
62 |
description="Directory where distribution should be created" /> |
1199 |
06 Mar 10 |
jari |
63 |
<property name="lib" location="lib" |
1199 |
06 Mar 10 |
jari |
64 |
description="Directory where support jars are located" /> |
1199 |
06 Mar 10 |
jari |
65 |
<property name="package" location="package" |
1199 |
06 Mar 10 |
jari |
66 |
description="Directory for packaged distribution files"/> |
1199 |
06 Mar 10 |
jari |
67 |
<property name="src" location="src" |
1199 |
06 Mar 10 |
jari |
68 |
description="Location of source files" /> |
1199 |
06 Mar 10 |
jari |
<!-- Java stuff --> |
1199 |
06 Mar 10 |
jari |
70 |
<property name="javac.arg" value="-Xlint:unchecked" /> |
1199 |
06 Mar 10 |
jari |
71 |
<property name="javac.source" value="1.6" /> |
1199 |
06 Mar 10 |
jari |
72 |
<property name="javac.target" value="1.6" /> |
1199 |
06 Mar 10 |
jari |
73 |
<property name="javac.encoding" value="UTF-8" /> |
1199 |
06 Mar 10 |
jari |
74 |
|
1199 |
06 Mar 10 |
jari |
<!-- set up classpath for compiling --> |
1199 |
06 Mar 10 |
jari |
76 |
<mkdir dir="${lib}" /> |
1199 |
06 Mar 10 |
jari |
77 |
<path id="classpath"> |
1199 |
06 Mar 10 |
jari |
78 |
<fileset dir="${lib}"> |
1199 |
06 Mar 10 |
jari |
79 |
<include name="**/*.jar" /> |
1199 |
06 Mar 10 |
jari |
80 |
</fileset> |
1199 |
06 Mar 10 |
jari |
81 |
</path> |
1199 |
06 Mar 10 |
jari |
82 |
|
1199 |
06 Mar 10 |
jari |
<!-- macro definitions --> |
1199 |
06 Mar 10 |
jari |
84 |
<macrodef name="download-lib" description="Download BASE core JAR files"> |
1199 |
06 Mar 10 |
jari |
85 |
<attribute name="file" /> |
1199 |
06 Mar 10 |
jari |
86 |
<sequential> |
1199 |
06 Mar 10 |
jari |
87 |
<get |
1199 |
06 Mar 10 |
jari |
88 |
dest="${lib}/compile/@{file}" |
1199 |
06 Mar 10 |
jari |
89 |
src="${depend.jars}/@{file}" |
1199 |
06 Mar 10 |
jari |
90 |
usetimestamp="true" |
1199 |
06 Mar 10 |
jari |
91 |
verbose="true" |
1199 |
06 Mar 10 |
jari |
92 |
ignoreerrors="true" |
1199 |
06 Mar 10 |
jari |
93 |
/> |
1199 |
06 Mar 10 |
jari |
94 |
</sequential> |
1199 |
06 Mar 10 |
jari |
95 |
</macrodef> |
1199 |
06 Mar 10 |
jari |
96 |
|
1199 |
06 Mar 10 |
jari |
<!-- targets --> |
1199 |
06 Mar 10 |
jari |
98 |
<target name="build" |
1199 |
06 Mar 10 |
jari |
99 |
depends="checkjar" |
1199 |
06 Mar 10 |
jari |
100 |
description="Compiles the plugin and put in jar"> |
1199 |
06 Mar 10 |
jari |
101 |
<property name="jar" value="${name}.jar" /> |
1199 |
06 Mar 10 |
jari |
102 |
<mkdir dir="${build}" /> |
1199 |
06 Mar 10 |
jari |
103 |
<javac encoding="${javac.encoding}" |
1199 |
06 Mar 10 |
jari |
104 |
srcdir="${src}" |
1199 |
06 Mar 10 |
jari |
105 |
destdir="${build}" |
1199 |
06 Mar 10 |
jari |
106 |
debug="true" |
1199 |
06 Mar 10 |
jari |
107 |
classpathref="classpath" |
1199 |
06 Mar 10 |
jari |
108 |
source="${javac.source}" |
1199 |
06 Mar 10 |
jari |
109 |
target="${javac.target}" > |
1199 |
06 Mar 10 |
jari |
110 |
<compilerarg value="${javac.arg}" /> |
1199 |
06 Mar 10 |
jari |
111 |
</javac> |
1199 |
06 Mar 10 |
jari |
112 |
<copy todir="${build}"> |
1199 |
06 Mar 10 |
jari |
113 |
<fileset dir="." includes="META-INF/*"/> |
1199 |
06 Mar 10 |
jari |
114 |
</copy> |
1199 |
06 Mar 10 |
jari |
115 |
<replace token="%%plugins.jar%%" |
1199 |
06 Mar 10 |
jari |
116 |
value="${jar}" file="${build}/META-INF/base-plugins.xml" /> |
1199 |
06 Mar 10 |
jari |
117 |
</target> |
1199 |
06 Mar 10 |
jari |
118 |
|
1199 |
06 Mar 10 |
jari |
119 |
<target name="checkjar" |
1199 |
06 Mar 10 |
jari |
120 |
description="Checks that the BASE2Core.jar exists." > |
1199 |
06 Mar 10 |
jari |
121 |
<available classname="net.sf.basedb.core.Application" |
1199 |
06 Mar 10 |
jari |
122 |
classpathref="classpath" property="base2core" /> |
1199 |
06 Mar 10 |
jari |
123 |
<fail unless="base2core" message="Can't find BASE2Core.jar in ./${lib}/compile. Try 'ant download-lib' to download the missing file." /> |
1199 |
06 Mar 10 |
jari |
124 |
<echo>Found BASE2Core.jar</echo> |
1199 |
06 Mar 10 |
jari |
125 |
</target> |
1199 |
06 Mar 10 |
jari |
126 |
|
1199 |
06 Mar 10 |
jari |
127 |
<target name="clean"> |
1199 |
06 Mar 10 |
jari |
128 |
<delete failonerror="false" includeemptydirs="true"> |
1199 |
06 Mar 10 |
jari |
129 |
<fileset dir="${build}" defaultexcludes="no" /> |
1199 |
06 Mar 10 |
jari |
130 |
<fileset dir="${dist}" defaultexcludes="no" /> |
1199 |
06 Mar 10 |
jari |
131 |
<fileset dir="${package}" defaultexcludes="no" /> |
1199 |
06 Mar 10 |
jari |
132 |
</delete> |
1199 |
06 Mar 10 |
jari |
133 |
</target> |
1199 |
06 Mar 10 |
jari |
134 |
|
1199 |
06 Mar 10 |
jari |
135 |
<target name="dist" depends="clean,build"> |
1199 |
06 Mar 10 |
jari |
136 |
<mkdir dir="${dist}" /> |
1199 |
06 Mar 10 |
jari |
137 |
<jar jarfile="${dist}/${jar}" basedir="${build}" /> |
1199 |
06 Mar 10 |
jari |
138 |
<copy todir="${dist}"> |
1199 |
06 Mar 10 |
jari |
139 |
<fileset dir="." includes="README*,License,INSTALL" /> |
1199 |
06 Mar 10 |
jari |
140 |
<fileset dir="." includes="config/*" /> |
1199 |
06 Mar 10 |
jari |
141 |
</copy> |
1199 |
06 Mar 10 |
jari |
142 |
</target> |
1199 |
06 Mar 10 |
jari |
143 |
|
1199 |
06 Mar 10 |
jari |
144 |
<target name="distclean" depends="clean"> |
1199 |
06 Mar 10 |
jari |
145 |
<delete failonerror="false" includeemptydirs="true"> |
1199 |
06 Mar 10 |
jari |
146 |
<fileset dir="${lib}" defaultexcludes="no" /> |
1199 |
06 Mar 10 |
jari |
147 |
</delete> |
1199 |
06 Mar 10 |
jari |
148 |
</target> |
1199 |
06 Mar 10 |
jari |
149 |
|
1199 |
06 Mar 10 |
jari |
150 |
<target name="download-lib" |
1199 |
06 Mar 10 |
jari |
151 |
depends="download-message" |
1199 |
06 Mar 10 |
jari |
152 |
description="Download BASE2Core.jar, BASE2CorePlugins.jar, |
1199 |
06 Mar 10 |
jari |
153 |
and BASE2WSClient.jar."> |
1199 |
06 Mar 10 |
jari |
154 |
<mkdir dir="${lib}/compile" /> |
1199 |
06 Mar 10 |
jari |
155 |
<download-lib file="BASE2Core.jar" /> |
1199 |
06 Mar 10 |
jari |
156 |
<!-- |
1199 |
06 Mar 10 |
jari |
<download-lib file="BASE2CorePlugins.jar" /> |
1199 |
06 Mar 10 |
jari |
<download-lib file="BASE2WSClient.jar" /> |
1199 |
06 Mar 10 |
jari |
<download-lib file="BASE2Webclient.jar" /> |
1199 |
06 Mar 10 |
jari |
160 |
--> |
1199 |
06 Mar 10 |
jari |
161 |
</target> |
1199 |
06 Mar 10 |
jari |
162 |
|
1199 |
06 Mar 10 |
jari |
163 |
<target name="download-message"> |
1199 |
06 Mar 10 |
jari |
164 |
<echo> |
1199 |
06 Mar 10 |
jari |
165 |
---------------------------------------------------------------- |
1199 |
06 Mar 10 |
jari |
166 |
NOTE! You may specify a different download locations by |
1199 |
06 Mar 10 |
jari |
167 |
creating the file './build.properties' and set variable |
1199 |
06 Mar 10 |
jari |
168 |
|
1199 |
06 Mar 10 |
jari |
169 |
'depend.BASEjars': the URL to BASE core jar files |
1199 |
06 Mar 10 |
jari |
170 |
---------------------------------------------------------------- |
1199 |
06 Mar 10 |
jari |
171 |
</echo> |
1199 |
06 Mar 10 |
jari |
172 |
</target> |
1199 |
06 Mar 10 |
jari |
173 |
|
1199 |
06 Mar 10 |
jari |
174 |
<target name="package" |
1199 |
06 Mar 10 |
jari |
175 |
depends="version,dist" |
1199 |
06 Mar 10 |
jari |
176 |
description="Create binary distribution package"> |
1199 |
06 Mar 10 |
jari |
177 |
<property name="tar.prefix" value="${name}-${version}" /> |
1199 |
06 Mar 10 |
jari |
178 |
<mkdir dir="${package}" /> |
1199 |
06 Mar 10 |
jari |
179 |
<tar destfile="${package}/${tar.prefix}.tar.gz" |
1199 |
06 Mar 10 |
jari |
180 |
longfile="gnu" compression="gzip"> |
1199 |
06 Mar 10 |
jari |
181 |
<tarfileset dir="${dist}" mode="755" prefix="${tar.prefix}" |
1199 |
06 Mar 10 |
jari |
182 |
preserveLeadingSlashes="true"> |
1199 |
06 Mar 10 |
jari |
183 |
<include name="**/*.sh" /> |
1199 |
06 Mar 10 |
jari |
184 |
</tarfileset> |
1199 |
06 Mar 10 |
jari |
185 |
<tarfileset dir="${dist}" prefix="${tar.prefix}" |
1199 |
06 Mar 10 |
jari |
186 |
preserveLeadingSlashes="true"> |
1199 |
06 Mar 10 |
jari |
187 |
<exclude name="**/*.sh" /> |
1199 |
06 Mar 10 |
jari |
188 |
</tarfileset> |
1199 |
06 Mar 10 |
jari |
189 |
</tar> |
1199 |
06 Mar 10 |
jari |
190 |
<checksum file="${package}/${tar.prefix}.tar.gz" /> |
1199 |
06 Mar 10 |
jari |
191 |
</target> |
1199 |
06 Mar 10 |
jari |
192 |
|
1199 |
06 Mar 10 |
jari |
193 |
<target name="version"> |
1199 |
06 Mar 10 |
jari |
194 |
</target> |
1199 |
06 Mar 10 |
jari |
195 |
|
1199 |
06 Mar 10 |
jari |
196 |
</project> |