-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.xml
194 lines (164 loc) · 8.53 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
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
<?xml version="1.0"?>
<project name="Test Data Generator" default="run" basedir=".">
<property file="build.properties"/>
<!-- COMPONENT PARAMETERS -->
<property name="component" value="test_data_generator"/>
<property name="package" value="com.topcoder.onlinereview"/>
<property name="packagedir" value="com/topcoder/onlinereview"/>
<property name="distfilename" value="test_data_generator"/>
<property name="component_version" value="1.0"/>
<property name="component_path" value="${distfilename}/${component_version}"/>
<!-- DIRECTORY SETUP -->
<property name="srcdir" value="src"/>
<property name="tcs_libdir" value="lib/tcs"/>
<property name="ext_libdir" location="lib/third_party"/>
<property name="shared_libdir" value="lib/shared"/>
<property name="jar_tcs_libdir" value="lib/tcs"/>
<property name="jar_ext_libdir" location="lib/third_party"/>
<property name="jar_shared_libdir" location="lib/shared"/>
<property name="docsdir" value="docs"/>
<property name="configdir" value="conf"/>
<property name="javasrc" value="${srcdir}/java"/>
<property name="javamain" value="${javasrc}/main"/>
<property name="sqlsrc" value="${srcdir}/sql"/>
<property name="testfiles" value="test_files"/>
<property name="builddir" value="build/ant"/>
<property name="build_classdir" value="${builddir}/classes"/>
<property name="build_distdir" value="${builddir}/dist"/>
<property name="build_lib" value="${builddir}/lib"/>
<!-- Server installation directories -->
<property name="cactus.home.tomcat5x" value="d:\tomcat"/>
<property name="deploy-dir" value="d:\tomcat\webapps\${distfilename}.war"/>
<!-- EXECUTION TAGS -->
<property name="debug" value="off"/>
<property name="verbose" value="no"/>
<!-- COMPONENT DISTRIBUTION STRUCTURE -->
<property name="dist_lib" value="${build_distdir}/lib/tcs"/>
<!-- NAME FOR .JAR AND .WAR FILES -->
<property name="component.jar" value="${dist_lib}/${component_path}/${distfilename}.jar"/>
<property name="testDataTool.jar" value="testDataTool.jar"/>
<!-- TCS Dependencies -->
<property name="command_line_utility.version" value="1.0"/>
<property name="command_line_utility.jar.name" value="command_line_utility.jar"/>
<property name="command_line_utility.path" value="command_line_utility/${command_line_utility.version}"/>
<property name="command_line_utility.jar"
value="${tcs_libdir}/${command_line_utility.path}/${command_line_utility.jar.name}"/>
<!-- 3rd Party Dependencies -->
<property name="ifxjdbc.jar" value="${ext_libdir}/ifxjdbc.jar"/>
<path id="buildlibs">
<pathelement location="${command_line_utility.jar}"/>
<pathelement location="${ifxjdbc.jar}"/>
</path>
<path id="runtime.classpath">
<pathelement location="${testDataTool.jar}"/>
<path refid="buildlibs"/>
</path>
<macrodef name="dbaccess">
<attribute name="file"/>
<attribute name="outfile"/>
<attribute name="append"/>
<attribute name="failonerror" default="true"/>
<sequential>
<mkdir dir="logs"/>
<echo message="Processing file @{file}"/>
<exec executable="${DBACCESS}"
output="logs/@{outfile}"
append="@{append}"
failonerror="@{failonerror}">
<env key="INFORMIXSERVER" value="${INFORMIXSERVER}"/>
<env key="DB_LOCALE" value="${INFORMIXLOCALE}"/>
<env key="CLIENT_LOCALE" value="${INFORMIXLOCALE}"/>
<env key="INFORMIXDIR" value="${INFORMIXDIR}"/>
<arg line="- connfile.sql @{file}"/>
</exec>
</sequential>
</macrodef>
<target name="compile">
<mkdir dir="${build_classdir}"/>
<javac srcdir="${javamain}"
destdir="${build_classdir}"
includes="**/*.java"
debug="true"
verbose="${verbose}"
source="1.5"
target="1.5"
>
<classpath refid="buildlibs"/>
</javac>
</target>
<target name="clean">
<delete failonerror="false">
<fileset dir="${builddir}" includes="**/*.class"/>
</delete>
</target>
<target name="run">
<java classname="com.cronos.onlinereview.test.data.generator.BulkTestDataGenerator" fork="true"
maxmemory="1024M">
<arg value="-clientsCount"/>
<arg value="${number_of_clients}"/>
<arg value="-minBillingCount"/>
<arg value="${min_number_of_billing_accounts_per_client}"/>
<arg value="-maxBillingCount"/>
<arg value="${max_number_of_billing_accounts_per_client}"/>
<arg value="-minDirectCount"/>
<arg value="${min_number_of_direct_projects_per_account}"/>
<arg value="-maxDirectCount"/>
<arg value="${max_number_of_direct_projects_per_account}"/>
<arg value="-minActiveContestsCount"/>
<arg value="${min_number_of_active_contests_per_project}"/>
<arg value="-maxActiveContestsCount"/>
<arg value="${max_number_of_active_contests_per_project}"/>
<arg value="-outputFile"/>
<arg value="${out}"/>
<arg value="-idGeneratorStart"/>
<arg value="${id_generator_start}"/>
<arg value="-studioSubmissionIdsFile"/>
<arg value="${studioSubmissionIdsFile}"/>
<arg value="-submissionDeclarationsFile"/>
<arg value="${submissionDeclarationsFile}"/>
<arg value="-minProjectFulfillment"/>
<arg value="${min_project_fulfillment}"/>
<arg value="-maxProjectFulfillment"/>
<arg value="${max_project_fulfillment}"/>
<arg value="-averageProjectFulfillment"/>
<arg value="${average_project_fulfillment}"/>
<arg value="-minContestRegistrantsCount"/>
<arg value="${min_contest_registrants}"/>
<arg value="-maxContestRegistrantsCount"/>
<arg value="${max_contest_registrants}"/>
<arg value="-averageContestRegistrantsCount"/>
<arg value="${average_contest_registrants}"/>
<arg value="-averageContestSubmissionsCount"/>
<arg value="${average_contest_submissions}"/>
<arg value="-averageContestSubmissionsFailureRate"/>
<arg value="${average_submission_failure_rate}"/>
<arg value="-termsOutputFile"/>
<arg value="${outTerms}"/>
<classpath refid="runtime.classpath"/>
</java>
</target>
<!-- ************************************************************************** -->
<!-- ************ REMOVE EVERYTHING BELOW HERE FOR THE DISTRIBUTION ************* -->
<!-- ************************************************************************** -->
<!-- ************************************************************************** -->
<!-- ************************ END REMOVE EVERYTHING ***************************** -->
<!-- ************************************************************************** -->
<target name="bulk-test-data-load" description="loads the test data">
<sql driver="com.informix.jdbc.IfxDriver" password="${db_password}"
url="jdbc:informix-sqli://${db_host}:${db_port}/tcs_catalog:INFORMIXSERVER=${db_server}"
userid="${db_user}" autocommit="true" src="${out}" classpathref="buildlibs"/>
</target>
<target name="generate-and-load" description="generate and loads the test data" depends="run">
<sql driver="com.informix.jdbc.IfxDriver" password="${db_password}"
url="jdbc:informix-sqli://${db_host}:${db_port}/tcs_catalog:INFORMIXSERVER=${db_server}"
userid="${db_user}" autocommit="true" src="${out}" classpathref="buildlibs"/>
</target>
<target name="submission-declarations-load" description="loads the test data">
<echo file="submissionDeclarationsCommands.sql">
DATABASE tcs_catalog;
LOAD FROM ${submissionDeclarationsFile} INSERT INTO submission_declaration;
</echo>
<dbaccess file="submissionDeclarationsCommands.sql" outfile="submissionsDeclarations.log" append="false"/>
<delete file="submissionDeclarationsCommands.sql"/>
</target>
</project>