Skip to content
This repository
Newer
Older
100644 312 lines (261 sloc) 10.857 kb
f44db53d »
2009-10-04 headers, logging cleanup
1 <!--
2 ~ Copyright 2009 T Jake Luciani
3 ~
4 ~ Licensed to the Apache Software Foundation (ASF) under one
5 ~ or more contributor license agreements. See the NOTICE file
6 ~ distributed with this work for additional information
7 ~ regarding copyright ownership. The ASF licenses this file
8 ~ to you under the Apache License, Version 2.0 (the
9 ~ "License"); you may not use this file except in compliance
10 ~ with the License. You may obtain a copy of the License at
11 ~
12 ~ http://www.apache.org/licenses/LICENSE-2.0
13 ~
14 ~ Unless required by applicable law or agreed to in writing,
15 ~ software distributed under the License is distributed on an
16 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 ~ KIND, either express or implied. See the License for the
18 ~ specific language governing permissions and limitations
19 ~ under the License.
20 -->
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
21 <project name="solandra" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
22
23 <description>Solandra</description>
24
25 <property name="src" location="src" />
26 <property name="test" location="test" />
27 <property name="config" location="config" />
28 <property name="build" location="build" />
29 <property name="build.classes" location="${build}/classes" />
30 <property name="build.test.classes" location="${build}/test-classes" />
31 <property name="lib" location="lib" />
32 <property name="cassandra.base" location="${basedir}" />
33
34 <property name="app" location="solandra-app" />
35 <property name="resources" location="resources" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
36
38481b8f »
2011-02-23 Term meta data is now stored in thrift objects
37 <property name="autogen.thrift.dir" location="${basedir}/thrift" />
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
38
39 <!-- ivy properties -->
7a2c6ec7 »
2011-02-16 update ivy and ivy config
40 <property name="ivy.version" value="2.2.0" />
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
41 <property name="ivy.dir" location="${build}/ivy" />
42 <property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar" />
43 <property name="ivy.lib.dir" location="${lib}" />
44 <property name="ivy_repo_url" value="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" />
45 <property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" />
46
47 <target name="init">
48 <tstamp />
49 <mkdir dir="${build}" />
50 <mkdir dir="${build}/output" />
51 <mkdir dir="${build.classes}" />
52 <mkdir dir="${build.test.classes}" />
53 <mkdir dir="${ivy.dir}" />
54 <mkdir dir="${ivy.lib.dir}" />
55 <mkdir dir="${app}" />
56 <!--
d6bece8e »
2010-05-08 Added ivy for dependencies, lucene 2.9.1 to match solr 1.3 deps
57 Allow Ivy to be disabled with "-Dnoivy=".
58 It is kind of a hack to pretend that we already found it,
59 but Ant doesn't provide an easy way of blocking dependencies
60 from executing or checking multiple conditions.
61 -->
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
62 <condition property="ivy.found">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
63 <isset property="noivy" />
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
64 </condition>
65 <condition property="offline">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
66 <isset property="noivy" />
b49398a8 »
2011-02-16 fixed build to use cassandra-dir
67 </condition>
68 <condition property="cassandra.found">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
69 <isset property="cassandra" />
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
70 </condition>
71 </target>
72
73
74 <target name="ivy-download" description="To download ivy" unless="offline">
75 <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true" />
76 </target>
77
78 <target name="ivy-probe-antlib">
79 <condition property="ivy.found">
80 <typefound uri="antlib:org.apache.ivy.ant" name="cleancache" />
81 </condition>
82 </target>
83
84 <target name="ivy-init-antlib" depends="ivy-download,ivy-probe-antlib" unless="ivy.found">
85 <typedef uri="antlib:org.apache.ivy.ant" onerror="fail" loaderRef="ivyLoader">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
86 <classpath>
87 <pathelement location="${ivy.jar}" />
88 </classpath>
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
89 </typedef>
90 <fail>
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
91 <condition>
92 <not>
93 <typefound uri="antlib:org.apache.ivy.ant" name="cleancache" />
94 </not>
95 </condition>
d6bece8e »
2010-05-08 Added ivy for dependencies, lucene 2.9.1 to match solr 1.3 deps
96 You need Apache Ivy 2.0 or later from http://ant.apache.org/
97 It could not be loaded from ${ivy_repo_url}
98 </fail>
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
99 </target>
100
101 <target name="resolve" depends="ivy-init-antlib" description="retrieve dependencies with ivy" unless="noivy">
102 <ivy:retrieve />
103 </target>
104
105 <path id="autoivy.classpath">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
106 <fileset dir="${ivy.lib.dir}">
107 <include name="**/*.jar" />
108 <exclude name="**/*cassandra*.jar" if="cassandra.found" />
109 </fileset>
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
110 </path>
111
112 <!-- =========================== -->
113
114 <path id="solandra.classpath">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
115 <pathelement location="${build.classes}" />
116 <pathelement location="${build.test.classes}" />
117 <pathelement location="${resources}" />
118 <pathelement location="${resources}/solr" />
823925db »
2011-06-20 Use solrs LRU cache
119 <pathelement location="${resources}/cassandra" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
120 <fileset dir="${lib}">
121 <include name="**/*.jar" />
122 <exclude name="**/*cassandra*.jar" if="cassandra.found" />
123 </fileset>
124 <fileset dir="${cassandra}" erroronmissingdir="false">
125 <include name="lib/*.jar" />
126 <include name="build/*.jar" />
127 </fileset>
128 <path refid="autoivy.classpath" />
129 <pathelement location="${cassandra}/build/classes" />
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
130 </path>
131
132
133 <target name="compile" depends="init,resolve">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
134 <javac debug="true" destdir="${build.classes}">
135 <src path="${src}" />
136 <src path="${autogen.thrift.dir}/gen-java" />
137 <classpath refid="solandra.classpath" />
138 </javac>
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
139 </target>
140
141 <target name="compile.tests" depends="compile">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
142 <javac debug="true" destdir="${build.test.classes}">
143 <src path="${test}" />
144 <classpath refid="solandra.classpath" />
145 </javac>
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
146 </target>
147
148
149 <target name="test" depends="compile.tests">
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
150 <echo message="running tests" />
151 <mkdir dir="${build}/output" />
152 <junit fork="on" failureproperty="testfailed">
153
154 <classpath>
155 <path refid="solandra.classpath" />
156 <pathelement location="${basedir}/solandra-app/" />
157 </classpath>
158
159 <formatter type="xml" usefile="true" />
160 <formatter type="brief" usefile="false" />
161
162 <batchtest todir="${build}/output">
163 <fileset dir="${build.test.classes}" includes="**/SolandraTests.class" />
164 </batchtest>
165
166 <jvmarg value="-Xmx1G" />
3bfb0df7 »
2011-06-15 cleanup resources
167 <jvmarg value="-Dlog4j.configuration=file:///${basedir}/resources/cassandra/log4j-tools.properties" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
168 <jvmarg value="-Dlog4j.defaultInitOverride=true" />
169
170 </junit>
171 <fail if="testfailed" message="Some test(s) failed." />
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
172 </target>
85f96d87 »
2011-05-13 fix race condition in CassandraIndexManager
173
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
174 <target name="test-long" depends="compile.tests">
175 <echo message="running tests" />
176 <mkdir dir="${build}/output" />
177 <junit fork="on" failureproperty="testfailed">
178
179 <classpath>
180 <path refid="solandra.classpath" />
181 <pathelement location="${basedir}/solandra-app/" />
182 </classpath>
183
184 <formatter type="xml" usefile="true" />
185 <formatter type="brief" usefile="false" />
186
187 <batchtest todir="${build}/output">
188 <fileset dir="${build.test.classes}" includes="**/IndexManagerTests.class" />
189 </batchtest>
190
191 <jvmarg value="-Xmx1G" />
192 <jvmarg value="-Dlog4j.configuration=file:///${basedir}/resources/log4j.properties" />
193 <jvmarg value="-Dlog4j.defaultInitOverride=true" />
194
195 </junit>
196 <fail if="testfailed" message="Some test(s) failed." />
197 </target>
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
198
199 <target name="solandra.jar" depends="compile,compile.tests">
200 <jar jarfile="solandra.jar" basedir="${build.classes}" />
201 <jar jarfile="solandra-tests.jar" basedir="${build.test.classes}" />
202 </target>
203
204 <target name="clean">
205 <delete dir="${build}" />
206 <delete dir="${lib}" />
207 <delete dir="${app}" />
aeecebfd »
2011-02-23 merge from julieZhang
208 <delete dir="${autogen}" />
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
209 <delete file="solandra.jar" />
210 <delete file="solandra-tests.jar" />
211 <delete file="solandra.war" />
212 </target>
213
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
214 <!-- ============================= -->
215 <target name="war" depends="solandra.jar">
216 <war destfile="solandra.war" webxml="${resources}/solr/web.xml">
217 <lib dir="${lib}">
3bfb0df7 »
2011-06-15 cleanup resources
218 <exclude name="jetty*.jar" />
219 <exclude name="servlet-api*.jar" />
220 <exclude name="easymock.jar" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
221 </lib>
222 <lib dir="${cassandra.base}/lib">
3bfb0df7 »
2011-06-15 cleanup resources
223 <include name="**/*.jar" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
224 </lib>
225 <lib dir="${cassandra.base}/build">
3bfb0df7 »
2011-06-15 cleanup resources
226 <include name="**/*.jar" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
227 </lib>
228 <classes dir="${resources}">
3bfb0df7 »
2011-06-15 cleanup resources
229 <include name="*.properties" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
230 </classes>
231 <lib file="solandra.jar" />
232 </war>
233 </target>
234 <target name="dist" depends="solandra.jar">
235 <delete dir="${app}" />
236 <mkdir dir="${app}" />
125952a3 »
2011-06-09 cleanup dist dir, add jetty.xml
237 <mkdir dir="${app}/conf" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
238 <mkdir dir="${app}/lib" />
239 <mkdir dir="${app}/bin" />
240 <copy todir="${app}/lib">
3bfb0df7 »
2011-06-15 cleanup resources
241 <fileset dir="${lib}" includes="*.jar" />
242 <fileset dir="${basedir}" includes="solandra.jar" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
243 </copy>
244 <copy todir="${app}/conf" overwrite="false">
3bfb0df7 »
2011-06-15 cleanup resources
245 <fileset dir="${resources}/solr" includes="solrconfig.xml,schema.xml,*.txt,jetty.xml,jetty-logging.xml" />
246 <fileset dir="${resources}" includes="solandra.properties" />
8c74f380 »
2011-06-23 allow solandra to co-exist with a cassandra package install
247 <fileset dir="${resources}/cassandra" includes="solandra-env.sh,solandra.properties,cassandra.yaml,log4j-tools.properties,log4j-server.properties" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
248 </copy>
249 <copy todir="${app}/bin" overwrite="false">
8c74f380 »
2011-06-23 allow solandra to co-exist with a cassandra package install
250 <fileset dir="${resources}/cassandra" includes="solandra,cassandra-cli,nodetool,solandra.in.sh,solandra.bat" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
251 </copy>
252 <chmod dir="${app}/bin" perm="755" includes="solandra,cassandra-cli,nodetool" />
3bfb0df7 »
2011-06-15 cleanup resources
253 <echo>Solandra successfully built</echo>
254 <echo>You can excute the following command to start the server.</echo>
255 <echo>cd ${app}; bin/solandra</echo>
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
256 </target>
aeecebfd »
2011-02-23 merge from julieZhang
257
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
258 <target name="set.cassandra">
259 <fail unless="cassandra.found">path to cassandra not found use -Dcassandra=...</fail>
260 </target>
b49398a8 »
2011-02-16 fixed build to use cassandra-dir
261
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
262 <!-- Construct the path to the cassandra distribution. Taken from the command
44abb725 »
2011-02-16 fixed cassandra-dist target
263 line if set like this
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
264
265 ant cassandra-dist -Dcassandra=apache-cassandra-0.7.1
266
44abb725 »
2011-02-16 fixed cassandra-dist target
267 -->
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
268
be09da73 »
2011-02-17 added cml copy to bin dir
269
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
270 <!-- Copy our required runtime file the cassandra extracted directory -->
271 <target name="cassandra-dist" depends="init,set.cassandra,solandra.jar">
272
273 <!-- copy over all the new jar files -->
274
275 <copy todir="${cassandra}/lib">
c87b8655 »
2011-06-10 fixed cassandra-dist task with right classname and spelling of velocity
276 <fileset dir="${lib}" includes="jetty*.jar,servlet*.jar,jsp*.jar, solr*.jar, lucene*.jar, commons*.jar, velocity*.jar, snappy*.jar" />
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
277 <fileset dir="${basedir}" includes="solandra.jar" />
278 </copy>
279
280 <!-- copy the solr data -->
281
282 <copy todir="${cassandra}/conf" overwrite="false">
283 <fileset dir="${resources}/solr" includes="solrconfig.xml,schema.xml,*.txt" />
284 <fileset dir="${resources}" includes="solandra.properties" />
285 </copy>
286
287
288 <copy overwrite="true" file="${cassandra}/bin/cassandra" tofile="${cassandra}/bin/solandra" />
289
290 <replace file="${cassandra}/bin/solandra" failOnNoReplacements="true">
291 <replacetoken>classname="org.apache.cassandra.thrift.CassandraDaemon"</replacetoken>
c87b8655 »
2011-06-10 fixed cassandra-dist task with right classname and spelling of velocity
292 <replacevalue>classname="solandra.SolandraServer"</replacevalue>
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
293 </replace>
294
295 <chmod dir="${cassandra}/bin" perm="755" includes="solandra" />
296
297 <echo>Libraries successfully copied into cassandra distribution</echo>
298 <echo>Start the cassandra server with ${cassandra}/bin/solandra command</echo>
299
300 </target>
301
aeecebfd »
2011-02-23 merge from julieZhang
302 <!-- Generate thrift code.-->
303 <target name="gen-thrift-java" description="Generate Thrift Java artifacts">
38481b8f »
2011-02-23 Term meta data is now stored in thrift objects
304 <echo>Generating Thrift Java code from ${basedir}/thrift/lucandra.thrift ....</echo>
f9fa215e »
2011-06-09 moved CassandraStarter to SolandraServer - changed build task to crea…
305 <exec executable="thrift" dir="${basedir}/thrift" failonerror="true">
306 <arg line="--gen java:hashcode" />
307 <arg line="-o ${autogen.thrift.dir}" />
308 <arg line="lucandra.thrift" />
309 </exec>
566d8d44 »
2011-02-17 Added ability to deploy into existing cassandra system
310 </target>
c87b8655 »
2011-06-10 fixed cassandra-dist task with right classname and spelling of velocity
311 </project>
Something went wrong with that request. Please try again.