forked from yugabyte/tpcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
158 lines (132 loc) · 6.12 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="oltpbench" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<!-- <property name="javac.target" value="1.10"/> -->
<!-- <property name="javac.source" value="1.10"/> -->
<!-- *************************************** CONFIGURATION *************************************** -->
<property name="src.dir" location="src" />
<property name="lib.dir" location="lib" />
<property name="build.dir" location="build" />
<property name='build.testoutput.dir' location='${build.dir}/testoutput' />
<path id='project.classpath'>
<pathelement location='${build.dir}' />
<fileset dir='${lib.dir}'>
<include name='*.jar' />
<exclude name='ant.jar' />
<!-- We need to make sure that we use hsqldb-2 -->
<exclude name='hsqldb-1.*.jar'/>
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${lib.dir}/ant-contrib.jar"/>
</classpath>
</taskdef>
<!-- EXEC ASSERTS -->
<condition property="assertions" value="false">
<not><isset property="assertions"/></not>
</condition>
<if>
<equals arg1="${assertions}" arg2="true" />
<then>
<assertions id="assertions"><enable /></assertions>
</then>
<else>
<assertions id="assertions"><disable /></assertions>
</else>
</if>
<!-- ************************************** BOOTSTRAP IVY ************************************** -->
<!-- You have to invoke this *before* you can download the dependencies -->
<target name="bootstrap" description="Used to install the ivy task jar">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ivy.jar"
src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar"/>
</target>
<!-- ************************************* DEPENDENCIES ************************************* -->
<target name="resolve" description="Retrieve dependencies with ivy">
<ivy:retrieve />
</target>
<!-- *************************************** BUILDING *************************************** -->
<target name="build"
description="Build the entire framework">
<fileset dir="${src.dir}" excludes="**/*.launch, **/*.java"/>
<!-- <echo message="${ant.project.name}: ${ant.file}"/> -->
<mkdir dir="${build.dir}/META-INF"/>
<copy file="${src.dir}/META-INF/persistence.xml" todir="${build.dir}/META-INF"/>
<javac debug="true" debuglevel="${debuglevel}" includeantruntime="false"
destdir="${build.dir}">
<src path="${src.dir}"/>
<classpath refid="project.classpath" />
</javac>
<!-- Copy Files -->
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<include name="**/*-ddl.sql"/>
<include name="**/*-dialects.xml"/>
<include name="**/*.xsd"/>
<include name="**/histogram.*.gz"/>
<include name="**/table.*.gz"/>
</fileset>
</copy>
</target>
<target name="clean" description="Destroys all generated files and dirs.">
<delete dir="${build.dir}"/>
</target>
<!-- *************************************** EXECUTING *************************************** -->
<target name="execute" description="Execute a benchmark">
<condition property="benchmark" value="">
<not><isset property="benchmark"/></not>
</condition>
<condition property="config" value="">
<not><isset property="config"/></not>
</condition>
<condition property="create" value="false">
<not><isset property="create"/></not>
</condition>
<condition property="clear" value="false">
<not><isset property="clear"/></not>
</condition>
<condition property="load" value="false">
<not><isset property="load"/></not>
</condition>
<condition property="extra" value="">
<not><isset property="extra"/></not>
</condition>
<java fork="yes" failonerror="true" classname="com.oltpbenchmark.DBWorkload">
<jvmarg value="-Xmx2048m" />
<jvmarg value="-Dlog4j.configuration=${basedir}/log4j.properties"/>
<jvmarg value="-client" />
<arg line="-b ${benchmark}" />
<arg line="-c ${config}" />
<arg line="--create ${create}" />
<arg line="--clear ${clear}" />
<arg line="--load ${load}" />
<arg line="--execute ${execute}" />
<arg line="${extra}" />
<classpath refid='project.classpath' />
<assertions refid="assertions"/>
</java>
</target>
<!-- *************************************** UTILITY *************************************** -->
<target name="dialects-export"
description="Export all of the SQL for a given benchmark to a dialects file">
<condition property="benchmark" value="">
<not><isset property="benchmark"/></not>
</condition>
<condition property="config" value="">
<not><isset property="config"/></not>
</condition>
<java fork="yes" failonerror="true" classname="com.oltpbenchmark.DBWorkload">
<jvmarg value="-Xmx1024m" />
<jvmarg value="-Dlog4j.configuration=${basedir}/log4j.properties"/>
<jvmarg value="-client" />
<arg line="-b ${benchmark}" />
<arg line="-c ${config}" />
<arg line="--dialects-export true" />
<classpath refid='project.classpath' />
<assertions><enable/></assertions>
</java>
</target>
</project>