-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.xml
168 lines (152 loc) · 6.09 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project basedir="." default="compile" name="apache-cassandra-fs">
<property environment="env" />
<property file="build.properties" />
<property name="debuglevel" value="source,lines,vars" />
<property name="basedir" value="." />
<property name="build.src" value="${basedir}/src/java" />
<property name="build.lib" value="${basedir}/lib" />
<property name="build.test.src" value="${basedir}/test/src" />
<property name="build.classes" value="build/classes" />
<property name="build.test.classes" value="build/test/classes" />
<property name="javadoc.dir" value="build/javadoc" />
<property name="test.dir" value="${basedir}/test" />
<property name="test.resources" value="${test.dir}/resources" />
<property name="test.conf" value="${test.dir}/conf" />
<property name="test.name" value="Test*" />
<property name="dist.dir" value="build/dist" />
<property name="version" value="0.6.0" />
<property name="final.name" value="${ant.project.name}-${version}" />
<!--
Add all the dependencies.
-->
<path id="cassandra_fs.classpath">
<pathelement location="${build.classes}" />
<fileset dir="${build.lib}">
<include name="**/*.jar" />
</fileset>
</path>
<!--
Setup the output directories.
-->
<target name="init" depends="clean">
<mkdir dir="${build.classes}" />
<mkdir dir="${build.test.classes}" />
</target>
<target name="clean">
<delete dir="build/classes" />
<delete dir="build/test" />
</target>
<target name="compile" depends="init">
<javac debug="true" debuglevel="${debuglevel}" destdir="${build.classes}">
<src path="${build.src}" />
<classpath refid="cassandra_fs.classpath" />
</javac>
</target>
<target name="compile-test" depends="compile">
<javac debug="true" debuglevel="${debuglevel}" destdir="${build.test.classes}">
<src path="${build.test.src}" />
<classpath refid="cassandra_fs.classpath" />
</javac>
</target>
<!--
The jar target makes cassandra.jar output.
-->
<target name="jar" depends="compile">
<mkdir dir="${build.classes}/META-INF" />
<jar jarfile="build/${final.name}.jar" basedir="${build.classes}">
<manifest>
<!-- <section name="org/apache/cassandra/infrastructure"> -->
<attribute name="Implementation-Title" value="Cassandra" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Implementation-Vendor" value="Apache" />
<attribute name="Premain-Class" value="org.apache.cassandra.infrastructure.continuations.CAgent" />
<!-- </section> -->
</manifest>
</jar>
</target>
<target name="test" depends="compile-test">
<echo message="running tests" />
<mkdir dir="build/test/cassandra" />
<mkdir dir="build/test/output" />
<junit fork="on" failureproperty="testfailed">
<formatter type="xml" usefile="true" />
<formatter type="brief" usefile="false" />
<jvmarg value="-Dstorage-config=${test.conf}" />
<jvmarg value="-ea" />
<jvmarg value="-Xmx1024m" />
<classpath>
<path refid="cassandra_fs.classpath" />
<pathelement location="${build.test.classes}" />
<pathelement location="${test.conf}" />
</classpath>
<batchtest todir="build/test/output">
<fileset dir="${build.test.classes}" includes="**/${test.name}.class" />
</batchtest>
</junit>
<fail if="testfailed" message="Some test(s) failed." />
</target>
<target name="javadoc" depends="init">
<tstamp>
<format property="YEAR" pattern="yyyy" />
</tstamp>
<javadoc destdir="${javadoc.dir}" author="true" version="true" use="true" windowtitle="${ant.project.name} API" classpathref="cassandra.classpath" bottom="Copyright &copy; ${YEAR} The Apache Software Foundation">
<fileset dir="${build.src}" defaultexcludes="yes">
<include name="org/apache/**/*.java" />
</fileset>
</javadoc>
</target>
<!-- The cassandra fs web site -->
<path id="tomcat.classpath">
<fileset dir="${env.TOMCAT_HOME}/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${env.TOMCAT_HOME}/bin">
<include name="**/*.jar" />
</fileset>
</path>
<property name="cfs_web_dir" value="${basedir}/contrib/cassandra_fs_web"/>
<property name="WebXms" value="512m"/>
<property name="WebXmx" value="1024m"/>
<property name="site.port" value="18080"/>
<property name="debug.site.port" value="10080"/>
<target name="web">
<fail unless="env.TOMCAT_HOME" message="!!!Fail: not define TOMCAT_HOME"/>
<!-- Start Tomcat Java Process -->
<echo>Port - ${site.port} / debug port - ${debug.site.port}</echo>
<echo>Root - ${cfs_web_dir}/ROOT</echo>
<echo>Cassandra configuration folder - ${basedir}/conf</echo>
<echo>Run tomcat in - ${env.TOMCAT_HOME}</echo>
<java classname="org.apache.catalina.startup.Bootstrap" fork="true" maxmemory="${WebXmx}" dir="${cfs_web_dir}/ROOT" spawn="false">
<classpath refid="tomcat.classpath" />
<classpath refid="cassandra_fs.classpath" />
<jvmarg value="-Dcatalina.home=${env.TOMCAT_HOME}" />
<jvmarg value="-Dcatalina.base=${cfs_web_dir}" />
<jvmarg value="-Dstorage-config=${basedir}/conf" />
<jvmarg value="-Xms${WebXms}" />
<jvmarg value="-Xmx${WebXmx}" />
<sysproperty key="port" value="${site.port}" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${debug.site.port}" />
<jvmarg value="-Xdebug" />
<arg line="start" />
</java>
</target>
</project>