-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
123 lines (105 loc) · 5.3 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
<!--
Copyright (c) 2008, Tiest Vilee
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="JsSlim" basedir="." default="run-all-tests">
<import file="fitnesse-build.xml" />
<property name="libdir" value="lib"/>
<path id="classpath">
<pathelement path="classes"/>
<fileset dir="${libdir}">
<include name="junit-4.8.1.jar" />
<include name="*.jar"/>
</fileset>
</path>
<target name="run-all-tests" depends="run-unit-tests, run-js-lint"/>
<target name="build" depends="clean, compile" description="clean, then compile the source">
<copy todir="classes/jsSlim/jsLib">
<fileset dir="src/jsSlim/jsLib" />
</copy>
</target>
<target name="clean">
<delete dir="classes"/>
<mkdir dir="classes"/>
<delete dir="test-results"/>
<mkdir dir="test-results"/>
</target>
<target name="compile" depends="clean, get-fitnesse-jar" description="compile the source (make)">
<javac srcdir="src" destdir="classes" classpathref="classpath" debug="true">
</javac>
</target>
<target name="jar" depends="build" description="generate the jar file">
<mkdir dir="dist"/>
<delete file="dist/jsSlim.jar"/>
<jar jarfile="dist/jsSlim.jar" basedir="classes">
<exclude name = "**/*Test.class"/>
<exclude name = "**/TestSuite.class"/>
<exclude name = "**/testModule/**"/>
<include name="**/*.class"/>
<include name="jsSlim/jsLib/**/*.js" />
<exclude name = "jsSlim/jsLib/addOne.js"/>
<zipfileset src="${libdir}/fitnesse.jar">
<exclude name = "**/*TestBase.class"/>
<include name="fitnesse/slim/*.class"/>
<include name="fitnesse/socketservice/*.class"/>
<include name="util/*.class"/>
</zipfileset>
<manifest>
<attribute name="Built-By" value="Gregor Gramlich."/>
<attribute name="Main-Class" value="jsSlim.JsSlimService"/>
</manifest>
</jar>
</target>
<target name="run-unit-tests" depends="run-js-tests, unit_test">
</target>
<target name="unit_test" depends="build" description="run the unit tests">
<junit forkmode="once" fork="yes" printsummary="no" haltonfailure="yes" haltonerror="yes" dir="${basedir}">
<classpath refid="classpath"/>
<formatter type="xml" usefile="true"/>
<formatter type="plain" usefile="false"/>
<batchtest todir="test-results">
<fileset dir="src">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="run-js-tests">
<rhinounit options="{verbose:true, stackTrace:true}" haltOnFirstFailure="true" rhinoUnitUtilPath="lib/rhinoUnitUtil.js" ignoredglobalvars="List ArrayList String">
<fileset dir="JsSlim/test">
<include name="*.js"/>
<exclude name="standard.js"/>
</fileset>
</rhinounit>
</target>
<target name="run-js-lint">
<jslintant options="{eqeqeq : false, white: true, plusplus : false, bitwise : true, passfail: false, browser: true, evil: true, forin: true, newprimitive: true}">
<fileset dir="src">
<include name="**/*.js"/>
</fileset>
<fileset dir="JsSlim">
<include name="**/*.js"/>
</fileset>
</jslintant>
</target>
<scriptdef name="rhinounit"
src="lib/rhinoUnitAnt.js"
language="javascript">
<attribute name="options"/>
<attribute name="ignoredglobalvars"/>
<attribute name="haltOnFirstFailure"/>
<attribute name="rhinoUnitUtilPath"/>
<element name="fileset" type="fileset"/>
</scriptdef>
<scriptdef name="jslintant"
src="lib/jslintant.js"
language="javascript">
<attribute name="options" />
<element name="fileset" type="fileset" />
</scriptdef>
</project>