public
Description: Cassandra is a distributed storage system for managing structured data while providing reliability at a massive scale
Homepage: http://code.google.com/p/the-cassandra-project/
Clone URL: git://github.com/tmm1/cassandra-mirror.git
cassandra-mirror / build.xml
100755 221 lines (185 sloc) 7.8 kb
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?xml version="1.0"?>
 
<!--
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 name="Cassandra" default="compile">
 
  <!-- =========================================== -->
  <!-- PROPERTIES -->
  <!-- =========================================== -->
 
  <!-- Load all the default properties, and any the user wants -->
  <!-- to contribute (without having to type -D or edit this file -->
  <property file="${user.home}/build.properties" />
  <property file="${basedir}/build.properties" />
 
  <property name="Name" value="Cassandra"/>
  <property name="name" value="cassandra"/>
  <property name="version" value="0.1.0"/>
  <property name="final.name" value="${name}-${version}"/>
  <property name="year" value="2008"/>
 
  <property name="src.dir" value="${basedir}/src"/>
  <property name="lib.dir" value="${basedir}/lib"/>
  <property name="conf.dir" value="${basedir}/conf"/>
  <property name="docs.dir" value="${basedir}/docs"/>
  <property name="interface.dir" value="${basedir}/interface"/>
 
  <property name="build.dir" value="${basedir}/build"/>
  <property name="build.classes" value="${build.dir}/classes"/>
  <property name="build.docs" value="${build.dir}/docs"/>
  <property name="build.javadoc" value="${build.docs}/api"/>
 
  <property name="dist.dir" value="${build.dir}/${final.name}"/>
 
  <property name="javadoc.link.java"
            value="http://java.sun.com/javase/6/docs/api/"/>
 
  <property name="javac.debug" value="on"/>
  <property name="javac.debuglevel" value="source,lines,vars"/>
 
  <!-- =========================================== -->
  <!-- CLASSPATHS -->
  <!-- =========================================== -->
 
  <!-- the normal classpath includes the lib/ and conf/ dirs -->
  <path id="classpath">
    <pathelement location="${build.classes}"/>
    <fileset dir="${lib.dir}">
      <include name="**/*.jar" />
      <exclude name="**/excluded/" />
    </fileset>
    <pathelement location="${conf.dir}"/>
  </path>
 
  <!-- ========================================== -->
  <!-- MACROS -->
  <!-- ========================================== -->
  <macrodef name="macro_tar" description="Worker Macro for tar">
    <attribute name="param.destfile"/>
    <element name="param.listofitems"/>
    <sequential>
      <tar compression="gzip" longfile="gnu"
      destfile="@{param.destfile}">
      <param.listofitems/>
      </tar>
    </sequential>
  </macrodef>
 
 
  <!-- =========================================== -->
  <!-- BUILD TARGETS -->
  <!-- =========================================== -->
 
  <target name="init" description="Create the directories needed to build Cassandra">
    <mkdir dir="${build.classes}"/>
  </target>
 
  <target name="clean" description="Delete the build files and their directories">
    <delete file="${build.dir}/${final.name}.jar"/>
    <delete dir="${build.classes}"/>
  </target>
 
  <target name="javadoc" description="Generate javadoc">
    <mkdir dir="${build.javadoc}"/>
    <javadoc
     packagenames="com.facebook.infrastructure.*"
     destdir="${build.javadoc}"
     author="true"
     version="true"
     use="true"
     windowtitle="${Name} ${version} API"
     doctitle="${Name} ${version} API"
    >
      <packageset dir="${src.dir}"/>
      <link href="${javadoc.link.java}"/>
 
      <classpath >
        <path refid="classpath" />
        <pathelement path="${java.class.path}"/>
      </classpath>
    </javadoc>
  </target>  
 
  <target name="compile" depends="init" description="Build the Cassandra classes">
    <javac
     debug="${javac.debug}"
     debuglevel="${javac.debuglevel}"
     destdir="${build.classes}"
     srcdir="${src.dir}"
    >
      <classpath refid="classpath"/>
    </javac>
  </target>
 
  <target name="jar" depends="compile" description="Make the Cassandra jarfile">
    <jar jarfile="${build.dir}/${final.name}.jar"
         basedir="${build.classes}">
      <manifest>
        <section name="com/facebook/infrastructure">
          <attribute name="Implementation-Title" value="Cassandra"/>
          <attribute name="Implementation-Version" value="${version}"/>
          <attribute name="Implementation-Vendor" value="Facebook"/>
          <attribute name="Premain-Class" value="com.facebook.infrastructure.continuations.ContinuationAgent"/>
        </section>
      </manifest>
    </jar>
  </target>
 
  <target name="package" depends="compile, jar, javadoc"
   description="Build distribution">
    <mkdir dir="${dist.dir}"/>
    <mkdir dir="${dist.dir}/lib"/>
    <mkdir dir="${dist.dir}/interface"/>
    <mkdir dir="${dist.dir}/bin"/>
    <mkdir dir="${dist.dir}/docs"/>
    <mkdir dir="${dist.dir}/docs/api"/>
 
    <copy todir="${dist.dir}/lib" includeEmptyDirs="false">
      <fileset dir="${lib.dir}"/>
    </copy>
    <copy todir="${dist.dir}">
      <fileset file="${build.dir}/${final.name}.jar"/>
    </copy>
    
    <copy todir="${dist.dir}/bin">
      <fileset dir="bin"/>
    </copy>
 
    <copy todir="${dist.dir}/conf">
      <fileset dir="${conf.dir}"/>
    </copy>
 
    <copy todir="${dist.dir}/docs">
      <fileset dir="${docs.dir}" />
      <fileset dir="${build.docs}"/>
    </copy>
 
    <copy todir="${dist.dir}">
      <fileset dir=".">
        <include name="*.txt" />
      </fileset>
    </copy>
 
    <copy todir="${dist.dir}/src" includeEmptyDirs="true">
      <fileset dir="src"/>
    </copy>
    
    <copy todir="${dist.dir}/" file="build.xml"/>
 
    <chmod perm="ugo+x" type="file" parallel="false">
        <fileset dir="${dist.dir}/bin"/>
    </chmod>
  </target>
 
  <target name="tar" depends="package" description="Make release tarball">
    <macro_tar param.destfile="${build.dir}/${final.name}.tar.gz">
      <param.listofitems>
        <tarfileset dir="${build.dir}" mode="664">
          <exclude name="${final.name}/bin/*" />
          <include name="${final.name}/**" />
        </tarfileset>
        <tarfileset dir="${build.dir}" mode="755">
          <include name="${final.name}/bin/*" />
        </tarfileset>
      </param.listofitems>
    </macro_tar>
  </target>
 
  <target name="binary" depends="package" description="Make tarball without source and documentation">
    <macro_tar param.destfile="${build.dir}/${final.name}-bin.tar.gz">
      <param.listofitems>
        <tarfileset dir="${build.dir}" mode="664">
          <exclude name="${final.name}/bin/*" />
          <exclude name="${final.name}/src/**" />
          <exclude name="${final.name}/docs/**" />
          <include name="${final.name}/**" />
        </tarfileset>
        <tarfileset dir="${build.dir}" mode="755">
          <include name="${final.name}/bin/*" />
        </tarfileset>
      </param.listofitems>
    </macro_tar>
  </target>
 
</project>