-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
46 lines (43 loc) · 1.94 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
<project name="Flickering Chess" default="compile">
<property name="java.sdk" value="1.8"/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="main.src.dir" value="src/main/kotlin"/>
<property name="test.src.dir" value="src/test/kotlin"/>
<property name="lib" value="/opt/kotlin/lib"/>
<property name="junit.jar" value="/usr/share/junit-4/lib/junit.jar"/>
<property name="flickering-chess.jar" value="${build.dir}/flickering-chess.jar"/>
<path id="classpath.test">
<pathelement location="${flickering-chess.jar}"/>
<pathelement location="${build.dir}"/>
<pathelement location="${lib}/kotlin-test.jar"/>
<pathelement location="${lib}/kotlin-test-junit.jar"/>
<pathelement location="${junit.jar}"/>
</path>
<typedef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="/opt/kotlin/lib/kotlin-ant.jar"/>
<target name="compile">
<mkdir dir="${build.dir}"/>
<kotlinc src="${main.src.dir}" output="${flickering-chess.jar}">
<compilerarg line="-jvm-target ${java.sdk}"/>
</kotlinc>
<jar destfile="${build.dir}/flickering-chess.jar" update="true">
<zipfileset dir="src/main/resources" prefix="resources/" />
</jar>
</target>
<target name="test-compile" depends="compile">
<mkdir dir="${build.dir}"/>
<kotlinc src="${test.src.dir}" output="${build.dir}/flickering-chess-test.jar" classpath="${junit.jar}:${lib}/kotlin-test.jar:${lib}/kotlin-test-junit.jar:${flickering-chess.jar}">
<compilerarg line="-jvm-target ${java.sdk}"/>
</kotlinc>
</target>
<target name="test" depends="test-compile">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<pathelement location="${build.dir}/flickering-chess-test.jar"/>
<pathelement location="${junit.jar}"/>
</classpath>
<formatter type="plain" usefile="false" />
<test name="RulesTest"/>
</junit>
</target>
</project>