/
build.xml
118 lines (100 loc) · 3.94 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
<?xml version="1.0" ?>
<project default="main" name="example build file">
<!--
***************************************
PATHS AND PROPERTIES
***************************************
-->
<!-- make environment var FOO available as env.FOO -->
<property environment="env"/>
<property file="build.properties" />
<property name='build.dir' location='obj/' />
<property name='src.dir' location='src/' />
<property name='junit.haltonfailure' value='true' />
<path id='project.classpath'>
<pathelement location='${build.dir}' />
<fileset dir='${voltdb.dir}voltdb/../lib' >
<include name='*.jar' />
</fileset>
<fileset dir='${voltdb.dir}voltdb' >
<include name='voltdb*.jar' />
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<!--
***************************************
PRIMARY ENTRY POINTS
***************************************
-->
<target name="main" depends="srccompile, compile" description="default. Compile Java stored procedures and and then run the VoltDB compiler on the stored procedures and schema to generate a catalog" />
<target name="client" depends="srccompile" description="Start the client who will connect to the server @ localhost and start calling procedures" >
<java fork="yes" classname="acme.Client" >
<jvmarg value="-server" />
<jvmarg value="-Xmx512m" />
<classpath refid='project.classpath' />
<assertions><disable /></assertions>
</java>
</target>
<target name="server" depends="srccompile, compile" description="Start the server and load the catalog." >
<java fork="yes" classname="org.voltdb.VoltDB" >
<jvmarg value="-Djava.library.path=${voltdb.dir}voltdb" />
<jvmarg value="-server" />
<jvmarg value="-Xmx512m" />
<jvmarg value="-XX:-ReduceInitialCardMarks" />
<arg value="catalog" />
<arg value="acme.jar" /> <!-- catalog -->
<arg value="deployment" />
<arg value="deployment.xml" /> <!-- deployment file -->
<arg value="license" />
<arg value="${voltdb.dir}voltdb/license.xml" /> <!-- license file -->
<arg value="leader" />
<arg value="localhost" /> <!-- leader -->
<classpath refid='project.classpath' />
<assertions><disable /></assertions>
</java>
</target>
<target name="compile" depends="srccompile" description="Compile the catalog using the schema and the DDL file" >
<java fork="yes" failonerror="true"
classname="org.voltdb.compiler.VoltCompiler" >
<jvmarg value="-Djava.library.path=${voltdb.dir}voltdb" />
<jvmarg value="-Dlog4j.configuration=file://${voltdb.dir}voltdb/log4j.xml" />
<arg value="project.xml"/> <!-- project file -->
<arg value="acme.jar"/> <!-- output -->
<classpath refid='project.classpath' />
<assertions><disable /></assertions>
</java>
</target>
<target name="shutdown" depends="srccompile" description="Shuts down the server">
<java fork="yes" classname="acme.ShutdownClient" >
<jvmarg value="-server" />
<jvmarg value="-Xmx512m" />
<arg value="localhost" /> <!-- leader -->
<classpath refid='project.classpath' />
<assertions><disable /></assertions>
</java>
</target>
<!--
***************************************
CLEANING
***************************************
-->
<target name='clean' description="remove all compiled files">
<delete includeemptydirs="true" failonerror='false'>
<fileset dir="${build.dir}" includes="**/*" />
<fileset dir="." defaultexcludes="yes" >
<include name="acme.jar" />
</fileset>
</delete>
</target>
<!--
***************************************
JAVA COMPILATION
***************************************
-->
<target name="srccompile">
<mkdir dir='${build.dir}' />
<javac target="1.6" srcdir="${src.dir}" destdir='${build.dir}' debug='true'>
<classpath refid="project.classpath" />
</javac>
</target>
</project>