forked from janodvarko/harviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
125 lines (101 loc) · 6.29 KB
/
build.xml
File metadata and controls
125 lines (101 loc) · 6.29 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
<?xml version="1.0" ?>
<!-- Build instruction for HAR Viewer application. In order to build final
distribution, run: $ant build within the root directory and
deploy files located within 'webapp-build' directory -->
<project name="HARViewer" basedir="." default="build">
<!-- Directories -->
<property name="app.dir" value="webapp"/>
<property name="build.dir" value="${app.dir}-build"/>
<property name="examples.dir" value="${app.dir}/examples"/>
<property file="ant.properties"/>
<property name="build.tools.dir" value="build-tools"/>
<property name="rjs.cmd" value="${basedir}/node_modules/requirejs/bin/r.js"/>
<property name="selenium.server.version" value="2.53.1"/>
<property name="selenium.server.version.major" value="2.53"/>
<property name="selenium.server.url" value="https://selenium-release.storage.googleapis.com/${selenium.server.version.major}/selenium-server-standalone-${selenium.server.version}.jar"/>
<property name="iedriver.version" value="2.53.1"/>
<property name="iedriver.filename" value="IEDriverServer_Win32_${iedriver.version}.zip"/>
<property name="iedriver.url" value="https://selenium-release.storage.googleapis.com/${selenium.server.version.major}/${iedriver.filename}"/>
<property name="chromedriver.version" value="2.27"/>
<property name="chromedriver.filename" value="chromedriver_win32.zip"/>
<property name="chromedriver.url" value="http://chromedriver.storage.googleapis.com/${chromedriver.version}/${chromedriver.filename}"/>
<property name="geckodriver.version" value="0.13.0"/>
<property name="geckodriver.filename" value="geckodriver-v${geckodriver.version}-win32.zip"/>
<property name="geckodriver.url" value="https://github.com/mozilla/geckodriver/releases/download/v${geckodriver.version}/${geckodriver.filename}"/>
<!-- Remove the previous HAR Viewer build. -->
<target name="clean" description="Cleans the webapp and jsdoc build folders">
<delete dir="${build.dir}"/>
<delete dir="${jsdoc.build.dir}"/>
</target>
<!--
Downloads selenium server. Selenium server is required for testing.
-->
<target name="get-iedriver" description="Downloads IEDriver and makes it available to the start-server.bat command">
<property name="iedriver.dir" value="${basedir}/selenium/iedriver"/>
<mkdir dir="${iedriver.dir}"/>
<get dest="${iedriver.dir}" verbose="true">
<url url="${iedriver.url}" />
</get>
<unzip src="${iedriver.dir}/${iedriver.filename}" dest="${basedir}/selenium"/>
</target>
<target name="get-chromedriver" description="Downloads ChromeDriver and makes it available to the start-server.bat command">
<property name="chromedriver.dir" value="${basedir}/selenium/chromedriver"/>
<mkdir dir="${chromedriver.dir}"/>
<get dest="${chromedriver.dir}" verbose="true">
<url url="${chromedriver.url}" />
</get>
<unzip src="${chromedriver.dir}/${chromedriver.filename}" dest="${basedir}/selenium"/>
</target>
<target name="get-geckodriver" description="Downloads GeckoDriver and makes it available to the start-server.bat command">
<property name="geckodriver.dir" value="${basedir}/selenium/geckodriver"/>
<mkdir dir="${geckodriver.dir}"/>
<get dest="${geckodriver.dir}" verbose="true">
<url url="${geckodriver.url}" />
</get>
<unzip src="${geckodriver.dir}/${geckodriver.filename}" dest="${basedir}/selenium"/>
</target>
<target name="get-selenium" depends="get-iedriver, get-chromedriver, get-geckodriver" description="Downloads Selenium and IE/Chrome/Gecko drivers and makes them available to the start-server.bat command">
<get src="${selenium.server.url}" dest="${basedir}/selenium/server/selenium-server.jar" verbose="true"/>
</target>
<!-- Run r.js build tool using Node -->
<target name="rjs-node">
<exec dir="${app.dir}/scripts" executable="node" resolveexecutable="true">
<arg value="${rjs.cmd}"/>
<arg value="-o"/>
<arg value="app.build.js"/>
</exec>
</target>
<!-- Build HAR Viewer package (the result is within build.dir) -->
<target name="build" depends="rjs-node" description="Builds HAR Viewer">
<!-- Log info about the current OS -->
<echo message="Building HAR Viewer on:" />
<echo message="os.name = ${os.name}" />
<echo message="os.arch = ${os.arch}" />
<echo message="os.version = ${os.version}" />
<!-- Copy fresh harSchema.js we don't want it to be compressed
its content is displayed in the Schema tab -->
<copy file="${app.dir}/scripts/preview/harSchema.js"
todir="${build.dir}/scripts/preview" overwrite="true"/>
<!-- Preprocess script/core/trace file to avoid using the console object -->
<exec dir="${basedir}" executable="node" resolveexecutable="true">
<arg value="${build.tools.dir}/preprocess.js"/>
<arg value="${app.dir}/scripts/core/trace.js"/>
<arg value="${build.dir}/scripts/core/trace.js"/>
</exec>
<!-- Insert version number into PHP files. The version info is loaded from 'ant.properties'
file (or provided as a Java system property on the command line). -->
<replace dir="${build.dir}" includes="*.php" token="@VERSION@" value="${VERSION}" />
<!-- Insert analytics tracking id into analytics.include. -->
<replace dir="${build.dir}" includes="analytics.include" token="@GOOGLE-ANALYTICS-PROFILE@" value="${GOOGLE-ANALYTICS-PROFILE}" />
<!-- Load the analytics include file, as we're going to insert it into all the PHP/HTML files. -->
<loadfile property="analytics.include" srcFile="${build.dir}/analytics.include"/>
<replace dir="${build.dir}" value="${analytics.include}" includes="*.php, *.html">
<replacetoken><![CDATA[<!--@GOOGLE-ANALYTICS-INCLUDE@-->]]></replacetoken>
</replace>
<!-- Final version message -->
<echo message="HAR Viewer version: ${VERSION} build OK"/>
</target>
<!-- Build HAR Viewer package (the result is within build.dir) -->
<target name="clean-build" depends="clean, build" description="Calls the clean task then performs a build">
</target>
</project>