| 317 |
ashish |
1 |
<?xml version="1.0"?>
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
<!-- ======================================================================
|
| 325 |
ashish |
5 |
Date: June 2010
|
| 317 |
ashish |
6 |
|
| 325 |
ashish |
7 |
Project: Website
|
| 317 |
ashish |
8 |
|
| 325 |
ashish |
9 |
Author: Ashish Singh
|
| 317 |
ashish |
10 |
====================================================================== -->
|
|
|
11 |
|
|
|
12 |
|
| 942 |
chandransh |
13 |
|
| 318 |
ashish |
14 |
<project name="Website" default="archive" basedir=".">
|
| 942 |
chandransh |
15 |
|
|
|
16 |
<description>
|
| 318 |
ashish |
17 |
Shop2020 Website
|
| 317 |
ashish |
18 |
</description>
|
| 942 |
chandransh |
19 |
|
| 317 |
ashish |
20 |
<property file="build.properties"/>
|
| 1196 |
vikas |
21 |
<taskdef name="jmeter" classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>
|
| 421 |
rajveer |
22 |
|
| 942 |
chandransh |
23 |
<filelist id="apache.libs" dir="${basedir}/${thirdparty.location}/readonly/apache">
|
| 1045 |
chandransh |
24 |
<file name="commons-codec-1.4/commons-codec-1.4.jar"/>
|
| 942 |
chandransh |
25 |
<file name="commons-collections-3.2.1/commons-collections-3.2.1.jar"/>
|
| 1045 |
chandransh |
26 |
<file name="commons-digester-2.0/commons-digester-2.0.jar"/>
|
| 942 |
chandransh |
27 |
<file name="commons-fileupload-1.2.1/commons-fileupload-1.2.1.jar"/>
|
|
|
28 |
<file name="commons-io-1.3.2/commons-io-1.3.2.jar"/>
|
|
|
29 |
<file name="commons-lang-2.4/commons-lang-2.4.jar"/>
|
|
|
30 |
<file name="commons-logging-1.0.4/commons-logging-1.0.4.jar"/>
|
|
|
31 |
<file name="commons-logging-api-1.1/commons-logging-api-1.1.jar"/>
|
|
|
32 |
<file name="commons-validator-1.3.1/commons-validator-1.3.1.jar"/>
|
| 1045 |
chandransh |
33 |
<file name="ezmorph/ezmorph-1.0.3.jar"/>
|
|
|
34 |
<file name="json/json-lib-2.1-jdk15.jar"/>
|
| 942 |
chandransh |
35 |
<file name="jsp-2.1/jsp-api.jar"/>
|
| 1045 |
chandransh |
36 |
<file name="log4j/log4j-1.2.16.jar"/>
|
|
|
37 |
<file name="ognl/ognl-2.7.3.jar"/>
|
| 942 |
chandransh |
38 |
<file name="struts-2.1.8.1/struts2-convention-plugin-2.1.8.1.jar"/>
|
|
|
39 |
<file name="struts-2.1.8.1/struts2-core-2.1.8.1.jar"/>
|
|
|
40 |
<file name="struts-2.1.8.1/struts2-rest-plugin-2.1.8.1.jar"/>
|
|
|
41 |
<file name="struts-2.1.8.1/xstream-1.2.2.jar"/>
|
|
|
42 |
<file name="struts-2.1.8.1/xwork-core-2.1.6.jar"/>
|
| 1045 |
chandransh |
43 |
<file name="thrift-0.2.0/libthrift.jar"/>
|
| 942 |
chandransh |
44 |
<file name="velocity-1.6.3/velocity-1.6.3.jar"/>
|
| 1045 |
chandransh |
45 |
<file name="velocity-1.6.3/velocity-tools-1.4.jar"/>
|
| 942 |
chandransh |
46 |
<file name="xpp/xpp3_min-1.1.3.4.O.jar"/>
|
|
|
47 |
</filelist>
|
| 317 |
ashish |
48 |
|
| 942 |
chandransh |
49 |
<filelist id="Website.libs" dir="${basedir}/${thirdparty.location}">
|
|
|
50 |
<file name="readonly/freemarker/freemarker-2.3.15.jar"/>
|
|
|
51 |
<file name="readonly/slf4j/slf4j-api-1.5.8.jar"/>
|
|
|
52 |
<file name="readonly/slf4j/slf4j-simple-1.5.8.jar"/>
|
|
|
53 |
<file name="readonly/payment/payments.jar"/>
|
|
|
54 |
<file name="readonly/yuicompressor-2.4.2/yuicompressor-2.4.2.jar"/>
|
| 1511 |
rajveer |
55 |
<file name="readonly/UserAgentUtils/UserAgentUtils-1.2.3.jar"/>
|
| 942 |
chandransh |
56 |
<file name="Common.jar"/>
|
|
|
57 |
<file name="ThriftConfig.jar"/>
|
|
|
58 |
</filelist>
|
| 392 |
rajveer |
59 |
|
| 942 |
chandransh |
60 |
<path id="Website.classpath">
|
|
|
61 |
<pathelement location="${basedir}/build/classes"/>
|
|
|
62 |
<filelist refid="apache.libs"/>
|
|
|
63 |
<filelist refid="Website.libs"/>
|
|
|
64 |
<pathelement location="${basedir}/${thirdparty.location}/readonly/apache/sevlet-2.5/servlet-api.jar"/>
|
|
|
65 |
</path>
|
| 637 |
rajveer |
66 |
|
| 317 |
ashish |
67 |
<!-- ==================== Clean Target ==================================== -->
|
|
|
68 |
|
|
|
69 |
<!--
|
|
|
70 |
The "clean" target deletes any previous "build" and "dist" directory,
|
|
|
71 |
so that you can be ensured the application can be built from scratch.
|
|
|
72 |
-->
|
|
|
73 |
<target name="clean" description="Delete old build and dist directories">
|
|
|
74 |
<delete dir="${dist.home}"/>
|
|
|
75 |
<delete dir="${build.home}"/>
|
|
|
76 |
</target>
|
|
|
77 |
|
|
|
78 |
<!-- ==================== Init Target ================================== -->
|
|
|
79 |
|
|
|
80 |
<!--
|
|
|
81 |
|
|
|
82 |
The "init" target is used to create the "build" destination directory,
|
|
|
83 |
Normally, this task is executed indirectly when needed.
|
|
|
84 |
|
|
|
85 |
-->
|
|
|
86 |
<target name="init" depends="clean" description="Create build directory">
|
| 942 |
chandransh |
87 |
|
| 317 |
ashish |
88 |
<mkdir dir="${build.home}" />
|
| 1107 |
chandransh |
89 |
<mkdir dir="${build.home}/WEB-INF/classes" />
|
|
|
90 |
<mkdir dir="${build.home}/WEB-INF/lib" />
|
| 877 |
vikas |
91 |
<property name="yuic" location="${thirdparty.location}/readonly/yuicompressor-2.4.2/yuicompressor-2.4.2.jar"/>
|
| 317 |
ashish |
92 |
|
|
|
93 |
</target>
|
| 942 |
chandransh |
94 |
|
| 317 |
ashish |
95 |
<!-- ==================== Compile Target ================================== -->
|
|
|
96 |
|
|
|
97 |
<!--
|
|
|
98 |
|
|
|
99 |
The "compile" target transforms source files (from your "src" directory)
|
|
|
100 |
into class files in the appropriate location in the build directory.
|
|
|
101 |
This example assumes that you will be including your classes in an
|
|
|
102 |
unpacked directory hierarchy under "/WEB-INF/classes".
|
|
|
103 |
|
|
|
104 |
-->
|
|
|
105 |
<target name="compile" depends="init" description="Compile Java sources">
|
|
|
106 |
<javac srcdir="${source.home}"
|
|
|
107 |
destdir="${build.home}/WEB-INF/classes"
|
|
|
108 |
debug="${compile.debug}"
|
|
|
109 |
deprecation="${compile.deprecation}"
|
|
|
110 |
optimize="${compile.optimize}"
|
| 877 |
vikas |
111 |
source="1.6" target="1.6">
|
| 942 |
chandransh |
112 |
<classpath refid="Website.classpath"/>
|
| 317 |
ashish |
113 |
</javac>
|
| 318 |
ashish |
114 |
<javac srcdir="${conf.home}"
|
| 1505 |
chandransh |
115 |
destdir="${build.home}/WEB-INF/classes"
|
|
|
116 |
debug="${compile.debug}"
|
|
|
117 |
deprecation="${compile.deprecation}"
|
|
|
118 |
optimize="${compile.optimize}"
|
|
|
119 |
source="1.6" target="1.6">
|
| 942 |
chandransh |
120 |
<classpath refid="Website.classpath"/>
|
| 318 |
ashish |
121 |
</javac>
|
| 317 |
ashish |
122 |
|
|
|
123 |
</target>
|
| 942 |
chandransh |
124 |
|
| 317 |
ashish |
125 |
<!-- ==================== Build Target ================================== -->
|
|
|
126 |
|
|
|
127 |
<!--
|
|
|
128 |
|
|
|
129 |
The "build" target copies all non class files to build directory
|
|
|
130 |
|
|
|
131 |
-->
|
| 942 |
chandransh |
132 |
|
| 317 |
ashish |
133 |
<target name="build" depends="compile" description="Copies all non Java classes to build directoy">
|
|
|
134 |
<copy todir="${build.home}">
|
|
|
135 |
<fileset dir="${webapp.home}" excludes="CVS,**/*.class" />
|
|
|
136 |
</copy>
|
|
|
137 |
<copy todir="${build.home}/WEB-INF/classes">
|
| 318 |
ashish |
138 |
<fileset dir="${conf.home}" excludes="CVS,**/*.java" />
|
| 317 |
ashish |
139 |
</copy>
|
| 942 |
chandransh |
140 |
|
| 318 |
ashish |
141 |
<copy todir="${build.home}/WEB-INF/lib">
|
| 942 |
chandransh |
142 |
<filelist refid="apache.libs"/>
|
| 318 |
ashish |
143 |
<filelist refid="Website.libs"/>
|
|
|
144 |
<mapper type="flatten"/>
|
| 877 |
vikas |
145 |
</copy>
|
| 942 |
chandransh |
146 |
|
| 877 |
vikas |
147 |
<!--Join css files -->
|
|
|
148 |
<concat destfile="${build.home}/css/saholic.css">
|
| 4738 |
rajveer |
149 |
<filelist dir="${build.home}/css" files="style.css,common.css,header-footer.css,widgets.css,cartflow.css,widget.css,demoStyles.css,
|
|
|
150 |
product.css,cart.css,contactus.css,signinsignup.css,myaccount.css,gc_safari.css,comparision.css,scroller.css,proceed-to-pay.css,
|
|
|
151 |
payment-modes.css,jquery.ui.autocomplete.css"/>
|
| 877 |
vikas |
152 |
</concat>
|
| 943 |
vikas |
153 |
<!--Minify css files -->
|
| 877 |
vikas |
154 |
<apply executable="java" dest="${build.home}/css" parallel="false">
|
| 942 |
chandransh |
155 |
<filelist dir="${build.home}/css" files="saholic.css" />
|
|
|
156 |
<arg line="-jar" />
|
|
|
157 |
<arg path="${yuic}" />
|
|
|
158 |
<srcfile />
|
|
|
159 |
<arg line="-o" />
|
|
|
160 |
<mapper type="glob" from="*.css" to="*-min.css" />
|
|
|
161 |
<targetfile />
|
| 877 |
vikas |
162 |
</apply>
|
| 942 |
chandransh |
163 |
|
| 877 |
vikas |
164 |
<!--Join js files -->
|
|
|
165 |
<concat destfile="${build.home}/js/saholic.js">
|
| 4738 |
rajveer |
166 |
<filelist dir="${build.home}/js" files="jquery-1.4.2.js,jquery-ui.min.js,jquery.validate.js,jquery.Storage.js,jquery.cookie.js,
|
|
|
167 |
jquery.number_format.js,jquery.tipsy.js,jquery.truncate.min.js,loginpop.js,all.js,common.js,ga-invoker.js,charLimit.js,jsapi.js,
|
|
|
168 |
gallery.js,scrolltab.js,widget_slidetab.js,custom-jquery.js,myaccount.js,loginregister.js,loopedslider.js,widget_accordion.js,
|
| 6775 |
rajveer |
169 |
shippingAddress.js,productCategory.js,comparison.js,paymode-selection.js,jquery.colorbox-min.js,widgets.js,remarketing.js,
|
| 7039 |
anupam.sin |
170 |
jquery.ui.autocomplete.js,cart-details.js"/>
|
| 942 |
chandransh |
171 |
</concat>
|
| 877 |
vikas |
172 |
<!--Minify js files -->
|
|
|
173 |
<apply executable="java" dest="${build.home}/js" parallel="false">
|
| 942 |
chandransh |
174 |
<filelist dir="${build.home}/js" files="saholic.js" />
|
|
|
175 |
<arg line="-jar" />
|
|
|
176 |
<arg path="${yuic}" />
|
|
|
177 |
<srcfile />
|
|
|
178 |
<arg line="-o" />
|
|
|
179 |
<mapper type="glob" from="*.js" to="*-min.js" />
|
|
|
180 |
<targetfile />
|
| 877 |
vikas |
181 |
</apply>
|
| 942 |
chandransh |
182 |
|
| 317 |
ashish |
183 |
</target>
|
| 942 |
chandransh |
184 |
|
| 317 |
ashish |
185 |
<!-- ==================== Archive Target ================================== -->
|
|
|
186 |
|
|
|
187 |
<!--
|
|
|
188 |
|
|
|
189 |
The "archive" target create a binary archive of all files in build.home
|
|
|
190 |
|
|
|
191 |
-->
|
|
|
192 |
|
|
|
193 |
<target name="archive" depends="build" description="Create binary archive of all files in dist.home">
|
| 942 |
chandransh |
194 |
|
|
|
195 |
|
| 317 |
ashish |
196 |
<!-- Create application WAR file -->
|
| 942 |
chandransh |
197 |
<jar jarfile="${lib.home}/${app.name}.war"
|
| 317 |
ashish |
198 |
basedir="${build.home}" />
|
|
|
199 |
|
| 942 |
chandransh |
200 |
</target>
|
| 1196 |
vikas |
201 |
|
|
|
202 |
<macrodef name="run-test">
|
|
|
203 |
<attribute name="test"/>
|
|
|
204 |
<sequential>
|
|
|
205 |
<echo> ==========================</echo>
|
|
|
206 |
<echo> Running test "@{test}"</echo>
|
|
|
207 |
<echo> ==========================</echo>
|
|
|
208 |
<delete dir="${jmeter.home}/bin/samples/@{test}"/>
|
|
|
209 |
<mkdir dir="${jmeter.home}/bin/samples/@{test}"/>
|
|
|
210 |
<mkdir dir="/tmp/jmeter"/>
|
|
|
211 |
<jmeter jmeterhome="${jmeter.home}" resultlogdir="/tmp/jmeter">
|
|
|
212 |
<testplans dir="${test.home}/jmeter" includes="@{test}.jmx"/>
|
|
|
213 |
</jmeter>
|
| 1551 |
chandransh |
214 |
<exec executable="diff" resultproperty="jmeter.failure.@{test}">
|
| 1499 |
chandransh |
215 |
<arg line="-x .svn"/>
|
| 1196 |
vikas |
216 |
<arg line="-r"/>
|
| 1505 |
chandransh |
217 |
<arg line="--brief"/>
|
| 1499 |
chandransh |
218 |
<arg line="${jmeter.home}/bin/samples/@{test}"/>
|
| 1668 |
vikas |
219 |
<arg line="${test.home}/samples/@{test}"/>
|
| 1196 |
vikas |
220 |
</exec>
|
| 1551 |
chandransh |
221 |
<touch file="jmeter-sample-diff-result-${jmeter.failure.@{test}}"/>
|
| 1196 |
vikas |
222 |
</sequential>
|
|
|
223 |
</macrodef>
|
| 942 |
chandransh |
224 |
|
| 2920 |
vikas |
225 |
<macrodef name="run-jmeter-test">
|
|
|
226 |
<attribute name="test"/>
|
|
|
227 |
<sequential>
|
|
|
228 |
<echo> ==========================</echo>
|
|
|
229 |
<echo> Running test "@{test}"</echo>
|
|
|
230 |
<echo> ==========================</echo>
|
|
|
231 |
<delete file="/tmp/jmeter/@{test}.jtl"/>
|
|
|
232 |
<jmeter jmeterhome="${jmeter.home}" resultlogdir="/tmp/jmeter" failureproperty="jmeter.test.failure.@{test}">
|
|
|
233 |
<testplans dir="${test.home}/jmeter" includes="@{test}.jmx"/>
|
|
|
234 |
</jmeter>
|
|
|
235 |
<antcall target="print-jmeter-test-failure">
|
|
|
236 |
<param name="current.test.name" value="@{test}"/>
|
|
|
237 |
</antcall>
|
|
|
238 |
</sequential>
|
|
|
239 |
</macrodef>
|
|
|
240 |
|
| 1196 |
vikas |
241 |
<target name="run-tests" >
|
| 1505 |
chandransh |
242 |
<delete file="jmeter-sample-diff-result-0"/>
|
|
|
243 |
<delete file="jmeter-sample-diff-result-1"/>
|
| 1196 |
vikas |
244 |
<record name="src/test/log/run-tests.log" action="start"/>
|
|
|
245 |
<run-test test="home"/>
|
|
|
246 |
<run-test test="product"/>
|
| 4738 |
rajveer |
247 |
|
|
|
248 |
<!--run-jmeter-test test="searching"/>
|
|
|
249 |
<run-jmeter-test test="register"/>
|
|
|
250 |
<run-jmeter-test test="payment"/>
|
|
|
251 |
<run-test test="categorypage"/>
|
| 2920 |
vikas |
252 |
<run-test test="accessories-category-page"/>
|
|
|
253 |
<run-test test="register"/>
|
|
|
254 |
<run-test test="cart"/>
|
| 1196 |
vikas |
255 |
<run-test test="myaccount"/>
|
| 4738 |
rajveer |
256 |
<run-test test="forgotpass"/>
|
| 2920 |
vikas |
257 |
<run-jmeter-test test="payment"/>
|
| 4738 |
rajveer |
258 |
<run-jmeter-test test="register"/-->
|
|
|
259 |
|
| 1505 |
chandransh |
260 |
<antcall target="test-build-failure"/>
|
| 1196 |
vikas |
261 |
</target>
|
|
|
262 |
|
|
|
263 |
<target name="run-single-test">
|
| 1505 |
chandransh |
264 |
<delete file="jmeter-sample-diff-result-0"/>
|
|
|
265 |
<delete file="jmeter-sample-diff-result-1"/>
|
| 1196 |
vikas |
266 |
<record name="src/test/log/run-test-${test.name}.log" action="start"/>
|
|
|
267 |
<run-test test="${test.name}"/>
|
| 1505 |
chandransh |
268 |
<antcall target="test-build-failure"/>
|
| 1196 |
vikas |
269 |
</target>
|
| 1505 |
chandransh |
270 |
|
|
|
271 |
<target name="test-build-failure">
|
|
|
272 |
<available property="jmeter.test.failure" file="jmeter-sample-diff-result-1" />
|
|
|
273 |
<delete file="jmeter-sample-diff-result-0"/>
|
|
|
274 |
<delete file="jmeter-sample-diff-result-1"/>
|
|
|
275 |
<fail message="JMeter tests failed" if="jmeter.test.failure"/>
|
|
|
276 |
</target>
|
| 2920 |
vikas |
277 |
|
|
|
278 |
<target name="print-jmeter-test-failure" if="jmeter.test.failure.${current.test.name}">
|
|
|
279 |
<echo>${current.test.name} Test failed. Please see /tmp/jmeter/${current.test.name}.jtl</echo>
|
|
|
280 |
<touch file="jmeter-sample-diff-result-1"/>
|
|
|
281 |
</target>
|
| 1499 |
chandransh |
282 |
</project>
|