forked from play-components/play-jqvalidate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
105 lines (89 loc) · 3.46 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="jqvalidate" default="build" basedir=".">
<path id="project.classpath">
<pathelement path="${play.path}/framework/classes"/>
<fileset dir="${play.path}/framework/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${play.path}/framework">
<include name="*.jar"/>
</fileset>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<pathelement location="${classes}" />
<pathelement location="${play.path}/framework/lib/junit.jar" />
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="build" depends="compile">
<copy todir="tmp/classes">
<fileset dir="src">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/play.plugins"/>
<include name="**/play.static"/>
</fileset>
</copy>
<jar destfile="lib/play-jqvalidate.jar" basedir="tmp/classes">
<manifest>
<section name="Play-module">
<attribute name="Specification-Title" value="jqvalidate"/>
</section>
</manifest>
</jar>
<delete dir="tmp" />
</target>
<target name="compile">
<mkdir dir="tmp/classes" />
<javac srcdir="src" destdir="tmp/classes" target="1.0" debug="true">
<classpath refid="project.classpath" />
</javac>
</target>
<!-- Launch all *Test.java -->
<target name="test" depends="build" description="run tests suite">
<condition property="playExtension" value=".bat">
<and><os family="windows"/></and>
</condition>
<condition property="playExtension" value="">
<and><os family="unix"/></and>
</condition>
<antcall target="play-dependencies">
<param name="testAppPath" value="${basedir}/samples-and-tests/just-test-cases"/>
</antcall>
<antcall target="play-test">
<param name="testAppPath" value="${basedir}/samples-and-tests/just-test-cases"/>
</antcall>
<antcall target="test-success" />
</target>
<target name="play-dependencies">
<echo message="play dependencies ${testAppPath}" />
<exec executable="${play.path}/play${playExtension}" failonerror="true">
<arg value="dependencies"/>
<arg value="${testAppPath}"/>
</exec>
</target>
<target name="play-test">
<echo message="play auto-test ${testAppPath} (wait)" />
<exec executable="${play.path}/play${playExtension}" failonerror="true">
<arg value="auto-test"/>
<arg value="${testAppPath}"/>
</exec>
<available file="${testAppPath}/test-result/result.passed" property="${testAppPath}testPassed" />
<fail message="Last test has failed ! (Check results in file://${testAppPath}/test-result)">
<condition>
<not>
<isset property="${testAppPath}testPassed"/>
</not>
</condition>
</fail>
</target>
<target name="test-success">
<echo message="*****************" />
<echo message="All test passed !" />
<echo message="*****************" />
</target>
</project>