forked from chirino/play-scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
191 lines (162 loc) · 7.31 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?xml version="1.0" encoding="UTF-8"?>
<project name="Scala" default="build" basedir=".">
<property name="play-scala.plugin.version" value="0.9.1" description="Default value, if the plugin was not built from local checked-out project"/>
<path id="project.classpath">
<fileset dir="lib">
<include name="*.jar"/>
<exclude name="play-scala.jar"/>
</fileset>
</path>
<path id="play.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>
</path>
<target name="check" unless="play.path">
<fail message="Please specify Play framework path using -Dplay.path=/path/to/framework/home" />
</target>
<target name="apidoc">
<delete dir="documentation/api" />
<mkdir dir="documentation/api" />
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath refid="project.classpath" />
</taskdef>
<scaladoc destdir="documentation/api" srcdir="src" doctitle="play scala API documentation">
<include name="**/*.scala" />
<classpath refid="project.classpath" />
</scaladoc>
</target>
<target name="build-compiler">
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath refid="project.classpath" />
</taskdef>
<delete dir="tmp" />
<delete file="lib/play-scala-compiler.jar" />
<mkdir dir="tmp/compiler-classes" />
<scalac srcdir="src-compiler" destdir="tmp/compiler-classes" unchecked="on" deprecation="on" force="changed">
<classpath refid="play.classpath" />
<classpath refid="project.classpath" />
</scalac>
<jar destfile="lib/play-scala-compiler.jar" basedir="tmp/compiler-classes">
<manifest>
<section name="Play">
<attribute name="Specification-Title" value="Scala Compiler"/>
</section>
</manifest>
</jar>
</target>
<target name="build" depends="check,build-compiler,git.revision">
<delete file="commands.pyc" />
<delete dir="tmp" />
<delete file="lib/play-scala.jar" />
<mkdir dir="tmp/classes" />
<javac srcdir="src" destdir="tmp/classes" debug="true">
<classpath refid="play.classpath" />
<classpath refid="project.classpath" />
</javac>
<copy todir="tmp/classes">
<fileset dir="src">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/play.plugins"/>
</fileset>
</copy>
<java classname="play.scalasupport.build.ModuleBuilder" fork="true" maxmemory="1024m" failonerror="true">
<jvmarg value="-Xms512m" />
<classpath refid="play.classpath" />
<classpath refid="project.classpath" />
</java>
<jar destfile="lib/play-scala.jar" basedir="tmp/classes">
<manifest>
<attribute name="Specification-Title" value="Play Scala module"/>
<attribute name="Specification-Version" value="${repository.version}"/>
<attribute name="Implementation-Title" value="play-scala"/>
<attribute name="Implementation-Version" value="${repository.version}"/>
</manifest>
</jar>
</target>
<target name="incremental" depends="check,git.revision">
<java classname="play.scalasupport.build.ModuleBuilder" fork="true" maxmemory="1024m" failonerror="true">
<jvmarg value="-Xms512m" />
<jvmarg value="-Dincremental" />
<classpath refid="play.classpath" />
<classpath refid="project.classpath" />
</java>
<copy todir="tmp/classes">
<fileset dir="src">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/play.plugins"/>
</fileset>
</copy>
<jar destfile="lib/play-scala.jar" basedir="tmp/classes">
<manifest>
<attribute name="Specification-Title" value="Play Scala module"/>
<attribute name="Specification-Version" value="${repository.version}"/>
<attribute name="Implementation-Title" value="play-scala"/>
<attribute name="Implementation-Version" value="${repository.version}"/>
</manifest>
</jar>
</target>
<target name="test" depends="build">
<echo message="Using ${play.path}/play" />
<echo message="Testing development lifecycle (wait ...)" />
<exec executable="${basedir}/samples-and-tests/i-am-a-developer/tests.py" failonerror="true">
<arg value="${play.path}/play"/>
</exec>
<antcall target="play-test">
<param name="testAppPath" value="${basedir}/samples-and-tests/just-test-cases"/>
</antcall>
<antcall target="play-test">
<param name="testAppPath" value="${basedir}/samples-and-tests/play-with-scala"/>
</antcall>
<antcall target="play-test">
<param name="testAppPath" value="${basedir}/samples-and-tests/yabe"/>
</antcall>
<antcall target="play-test">
<param name="testAppPath" value="${basedir}/samples-and-tests/zencontact"/>
</antcall>
<echo message="*****************" />
<echo message="All tests 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>
<available file=".git" type="dir" property="git.present"/>
<!--Retrieves the git local revision number or returns play-scala.plugin.version if not found -->
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="${play-scala.plugin.version}">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
</project>