forked from rsuniev/play-scalate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
97 lines (76 loc) · 3.04 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Scalate" default="build" basedir=".">
<property name="play.path" value="/opt/play" />
<path id="project.classpath">
<pathelement path="${play.path}/framework/classes"/>
<fileset dir="${play.path}/framework">
<include name="*.jar"/>
</fileset>
<fileset dir="${play.path}/framework/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<pathelement path="tmp/classes"/>
</path>
<target name="clean">
<delete dir="tmp" />
<delete file="lib/play-scalate.jar"/>
</target>
<target name="build" depends="clean">
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath refid="project.classpath" />
</taskdef>
<mkdir dir="tmp/classes" />
<scalac srcdir="src" destdir="tmp/classes" force="changed">
<classpath refid="project.classpath" />
</scalac>
<javac srcdir="src" destdir="tmp/classes" debug="true">
<classpath refid="project.classpath" />
</javac>
<copy todir="tmp/classes">
<fileset dir="src">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/play.plugins"/>
</fileset>
</copy>
<jar destfile="lib/play-scalate.jar" basedir="tmp/classes">
<manifest>
<section name="Play">
<attribute name="Specification-Title" value="Scala"/>
</section>
</manifest>
</jar>
</target>
<target name="test" depends="build">
<echo message="Using ${play.path}/play" />
<delete dir="${basedir}/samples-and-tests/just-test-cases/tmp"/>
<antcall target="play-test">
<param name="testAppPath" value="${basedir}/samples-and-tests/just-test-cases"/>
</antcall>
<echo message="*****************" />
<echo message="All test passed !" />
<echo message="*****************" />
</target>
<target name="play-test">
<echo message="${play.path}/play auto-test ${testAppPath} (wait)" />
<exec executable="${play.path}/play" failonerror="true">
<arg value="clean"/>
<arg value="${testAppPath}"/>
</exec>
<exec executable="${play.path}/play" 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>
</project>