Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 282 lines (239 sloc) 10.271 kb
ac19017 @cloudata initial commit
cloudata authored
1 <?xml version="1.0"?>
2
3 <project name="cloudata" default="compile" basedir=".">
4 <description>
5 cloudata..
6 </description>
7
8 <!-- Load all the default properties, and any the user wants -->
9 <!-- to contribute (without having to type -D or edit this file -->
10 <property file="${basedir}/build.properties" />
11
12 <property name="Name" value="cloudata"/>
13 <property name="name" value="cloudata"/>
14 <property name="version" value="1.0.0"/>
15 <property name="final.name" value="${name}-${version}"/>
16 <property name="year" value="2010"/>
17
18 <property name="src" value="${basedir}/src"/>
19 <property name="src.dir" value="${src}/java"/>
20 <property name="src.unit_test" value="${src}/unit_test"/>
21 <property name="src.examples" value="${basedir}/src/examples"/>
22 <property name="lib.dir" value="${basedir}/lib"/>
23 <property name="conf.dir" value="${basedir}/conf"/>
24 <property name="docs.dir" value="${basedir}/docs"/>
25 <property name="src.webapps" value="${basedir}/src/webapps"/>
26
27 <property name="build.dir" value="${basedir}/build"/>
28 <property name="build.webapps" value="${build.dir}/webapps"/>
29 <property name="build.examples" value="${build.dir}/examples"/>
30 <property name="build.test" value="${build.dir}/test"/>
31 <property name="build.classes" value="${build.dir}/classes"/>
32 <property name="build.src" value="${build.dir}/src"/>
33 <property name="build.docs" value="${build.dir}/docs"/>
34 <property name="build.encoding" value="ISO-8859-1"/>
35
36 <property name="deploy.dir" value="${basedir}/build"/>
37 <property name="cloudata.log.dir" location="${build.dir}/test/logs"/>
38 <property name="hadoop.log.dir" location="${build.dir}/test/logs"/>
39
40 <property name="dist.dir" value="${build.dir}/${final.name}"/>
41
42 <property name="test.junit.output.format" value="plain"/>
43 <property name="test.timeout" value="3000000"/>
44
45 <property name="javac.debug" value="yes"/>
46 <property name="javac.optimize" value="yes"/>
47 <property name="javac.deprecation" value="off"/>
48 <property name="javac.version" value="1.6"/>
49
50 <path id="cobertura.classpath">
51 <fileset dir="${cobertura.dir}">
52 <include name="cobertura.jar" />
53 <include name="lib/**/*.jar" />
54 </fileset>
55 </path>
56
57 <!-- the normal classpath -->
58 <path id="classpath">
59 <pathelement location="${build.classes}"/>
60 <fileset dir="${lib.dir}">
61 <include name="**/*.jar" />
62 </fileset>
63 <fileset dir="${hadoop.home}">
64 <include name="hadoop-*.jar" />
65 <include name="lib/**/*.jar" />
66 </fileset>
67 <pathelement location="${conf.dir}"/>
68 </path>
69
70 <taskdef classname="org.apache.jasper.JspC" name="jsp-compile" >
71 <classpath refid="classpath"/>
72 </taskdef>
73
74 <!-- ====================================================== -->
75 <!-- Stuff needed by all targets -->
76 <!-- ====================================================== -->
77 <target name="init">
78 <mkdir dir="${build.dir}"/>
79 <mkdir dir="${build.classes}"/>
80 <mkdir dir="${build.src}"/>
81 <mkdir dir="${build.test}"/>
82 <mkdir dir="${build.examples}"/>
83 <mkdir dir="${build.webapps}/master/WEB-INF"/>
84 <mkdir dir="${build.webapps}/cloudatafs/WEB-INF"/>
85 <mkdir dir="${reports.xml.dir}" />
86 <mkdir dir="${reports.html.dir}" />
87
88 <copy todir="${conf.dir}" verbose="true">
89 <fileset dir="${conf.dir}" includes="**/*.template"/>
90 </copy>
91
92 <copy todir="${build.webapps}">
93 <fileset dir="${src.webapps}">
94 <exclude name="**/*.jsp" />
95 </fileset>
96 </copy>
97 </target>
98
99 <!-- ====================================================== -->
100 <!-- Compile the JavaCC -->
101 <!-- ====================================================== -->
102 <target name="javacc" if="javacc.home">
103 <!--
104 <property name="javacc.create.src.dir" value="${src.dir}/org/cloudata/core/client/cql/javacc" />
105 <javacc target="${javacc.create.src.dir}/CqlParser.jj" outputdirectory="${javacc.create.src.dir}" javacchome="${javacc.home}" />
106 -->
107 </target>
108
109 <!-- ====================================================== -->
110 <!-- Compile the Java files -->
111 <!-- ====================================================== -->
112 <target name="compile-core" depends="init, javacc">
113 <jsp-compile
114 uriroot="${src.webapps}/master"
115 outputdir="${build.src}"
116 package="org.cloudata.core.master"
117 webxml="${build.webapps}/master/WEB-INF/web.xml">
118 </jsp-compile>
119
120 <jsp-compile
121 uriroot="${src.webapps}/cloudatafs"
122 outputdir="${build.src}"
123 package="org.cloudata.tools.cloudatafs"
124 webxml="${build.webapps}/cloudatafs/WEB-INF/web.xml">
125 </jsp-compile>
126
127 <javac
128 encoding="${build.encoding}"
129 srcdir="${src.dir};${build.src}"
130 includes="org/**/*.java"
131 destdir="${build.classes}"
132 debug="true"
133 optimize="${javac.optimize}"
134 target="${javac.version}"
135 source="${javac.version}"
136 deprecation="${javac.deprecation}">
137 <classpath refid="classpath"/>
138 </javac>
139 </target>
140
141 <target name="compile" depends="compile-core">
142 </target>
143
144 <!-- ================================================================== -->
145 <!-- Compile test code -->
146 <!-- ================================================================== -->
147 <target name="compile-test" depends="compile-core">
148 <echo message="compile cloudata unit test cases"/>
149 <javac
150 encoding="${build.encoding}"
151 srcdir="${src.unit_test}"
152 destdir="${build.test}"
153 debug="true">
154 <classpath refid="test.classpath"/>
155 </javac>
156
157 <jar jarfile="${build.dir}/${name}-${version}-test.jar" >
158 <fileset dir="${build.test}" includes="org/cloudata/**" />
159 <fileset dir="${build.test}" includes="**/*.xml" />
160 </jar>
161 </target>
162
163 <!-- ================================================================== -->
164 <!-- Compile examples code -->
165 <!-- ================================================================== -->
166 <target name="compile-examples" depends="compile-core">
167 <echo message="compile cloudata examples"/>
168 <javac
169 encoding="${build.encoding}"
170 srcdir="${src.examples}"
171 includes="*/org/**/*.java"
172 destdir="${build.examples}"
173 debug="true">
174 <classpath refid="classpath"/>
175 </javac>
176
177 <jar jarfile="${build.dir}/${name}-${version}-examples.jar" >
178 <fileset dir="${build.examples}" includes="org/cloudata/**" />
179 </jar>
180 </target>
181
182 <!-- ================================================================== -->
183 <!-- Make jar -->
184 <!-- ================================================================== -->
185 <!-- -->
186 <!-- ================================================================== -->
187 <target name="jar" depends="compile-core">
188 <jar jarfile="${build.dir}/${final.name}-core.jar" basedir="${build.classes}">
189 <fileset file="${conf.dir}/cloudata-default.xml"/>
190 <fileset file="${conf.dir}/log4j.properties"/>
191 <zipfileset dir="${build.webapps}" prefix="webapps"/>
192 </jar>
193 </target>
194
195 <!-- ================================================================== -->
196 <!-- D I S T R I B U T I O N -->
197 <!-- ================================================================== -->
198 <!-- -->
199 <!-- ================================================================== -->
200 <target name="package" depends="jar">
201 <mkdir dir="${dist.dir}"/>
202 <mkdir dir="${dist.dir}/lib"/>
203 <mkdir dir="${dist.dir}/bin"/>
204
205 <copy todir="${dist.dir}/lib" includeEmptyDirs="false">
206 <fileset dir="lib"/>
207 </copy>
208
209 <copy file="${build.dir}/${final.name}-core.jar" todir="${dist.dir}"/>
210
211 <copy todir="${dist.dir}/bin">
212 <fileset dir="bin"/>
213 </copy>
214
215 <copy todir="${dist.dir}/conf">
216 <fileset dir="${conf.dir}" excludes="**/*.template"/>
217 </copy>
218
219 <chmod perm="ugo+x" type="file">
220 <fileset dir="${dist.dir}/bin"/>
221 </chmod>
222
223 <copy todir="${dist.dir}">
224 <fileset dir=".">
225 <include name="*.txt" />
226 </fileset>
227 </copy>
228
229 <copy todir="${dist.dir}/src" includeEmptyDirs="true">
230 <fileset dir="src"/>
231 </copy>
232
233 <copy todir="${dist.dir}/" file="build.xml"/>
234
235 </target>
236
237 <!-- ================================================================== -->
238 <!-- Clean. Delete the build files, and their directories -->
239 <!-- ================================================================== -->
240 <target name="clean">
241 <delete dir="${build.dir}"/>
242 </target>
243
244 <!-- ================================================================== -->
245 <!-- Run unit tests (Test for Hudson) -->
246 <!-- ================================================================== -->
247 <path id="test.classpath">
248 <pathelement location="${build.test}" />
249 <pathelement location="${src.unit_test}"/>
250 <pathelement location="${conf.dir}"/>
251 <pathelement location="${basedir}/build"/>
252 <pathelement location="${basedir}/build/classes"/>
253 <path refid="classpath"/>
254 </path>
255
256 <target name="restart_all">
257 <exec executable="bin/all_restart.sh"/>
258 </target>
259
260 <target name="test_for_hudson" depends="clean, compile-test, restart_all" if="test.available">
261 <echo message="Running Unit Test"/>
262 <junit
263 printsummary="on" showoutput="yes"
264 haltonfailure="off" fork="on" maxmemory="512m" forkmode="perTest"
265 errorProperty="tests.failed" failureProperty="tests.failed"
266 timeout="${test.timeout}"
267 dir="${basedir}">
268
269 <classpath refid="test.classpath"/>
270 <formatter type="xml" />
271
272 <test name="org.cloudata.AllSuite"
273 haltonfailure="no"
274 todir="${reports.xml.dir}"
275 outfile="TEST-AllSuite">
276
277 <formatter type="xml"/>
278 </test>
279 </junit>
280 </target>
281 </project>
Something went wrong with that request. Please try again.