-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.xml
78 lines (77 loc) · 2.49 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
<project name="pviz_core" default="test">
<property name="app.name" value="${ant.project.name}"/>
<property name="bin.phantomjs" value="phantomjs"/>
<property name="bin.nodejs" value="node"/>
<property name="targetDir" value="target"/>
<property name="dir.target.test" value="${targetDir}/test"/>
<property name="buildDir" value="${targetDir}/build"/>
<property name="srcDir" value="src"/>
<property name="dist.archive" value="${targetDir}/dist/${app.name}.tgz"/>
<target name="dist" >
<mkdir dir="${targetDir}/dist"/>
<tar destfile="${dist.archive}"
baseDir = "${srcDir}"
excludes=".*,include/**"
compression="gzip"
/>
</target>
<target name="build-app-min" depends="clean,r-optimize">
<mkdir dir="${targetDir}/dist"/>
<tar destfile="${dist.archive}"
basedir="${buildDir}"
excludes=".*,include/**"
compression="gzip"
/>
</target>
<target name="r-optimize">
<exec executable="${bin.nodejs}" failonerror="true">
<arg value="build-tools/r.js"/>
<arg value="-o"/>
<arg value="build-tools/build-app.js"/>
</exec>
</target>
<target name="test" depends="clean">
<mkdir dir="${dir.target.test}"/>
<exec executable="${bin.phantomjs}" dir="${dir.target.test}">
<arg value="${basedir}/test/scripts/phantomjs-testrunner.js"/>
<arg value="${basedir}/test/phantom-index.html"/>
</exec>
</target>
<target name="junit-html" depends="test">
<junitreport todir="${dir.target.test}">
<fileset dir="${dir.target.test}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir=".${dir.target.test}/html"/>
</junitreport>
</target>
<target name="clean">
<delete failonerror="false" dir="${targetDir}"/>
<mkdir dir="${targetDir}"/>
</target>
<target name="package" depends="package-clean,build-library-bundle,build-library-amd,package-css"/>
<target name="package-clean">
<delete failonerror="false" dir="dist"/>
<mkdir dir="dist"/>
</target>
<target name="build-library-bundle">
<exec executable="${bin.nodejs}" failonerror="true">
<arg value="build-tools/r.js"/>
<arg value="-o"/>
<arg value="build-tools/build-library-bundle.js"/>
<arg value="name=../../build-tools/almond"/>
</exec>
</target>
<target name="build-library-amd">
<exec executable="${bin.nodejs}" failonerror="true">
<arg value="build-tools/r.js"/>
<arg value="-o"/>
<arg value="build-tools/build-library-amd.js"/>
</exec>
</target>
<target name="package-css">
<copy todir="dist">
<fileset dir="src/css" includes="*.css"/>
</copy>
</target>
</project>