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