-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
76 lines (66 loc) · 2.91 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Enums" default="compile" basedir=".">
<property name="scala-source.dir" value="${basedir}/src/main/scala" />
<property name="target.dir" value="${basedir}/target" />
<property name="target-docs.dir" value="${target.dir}/docs" />
<property name="build.dir" value="${target.dir}/main/classes" />
<property name="main.class" value="rockthejvm.Main" />
<property name="test-source.dir" value="${basedir}/src/test/scala" />
<property name="test-build.dir" value="${target.dir}/test/classes" />
<property name="test-report.dir" value="${target.dir}/test/reports" />
<!-- task 'init' and macro 'dotc' are defined in parent build.xml -->
<import file="../build.xml" />
<target name="compile" depends="init">
<mkdir dir="${build.dir}" />
<dotc srcdir="${scala-source.dir}"
destdir="${build.dir}"
classpathref="build.classpath" />
</target>
<target name="doc" depends="init">
<mkdir dir="${target-docs.dir}" />
<dotd srcdir="${scala-source.dir}"
destdir="${target-docs.dir}"
classpathref="build.classpath" />
</target>
<target name="run" depends="compile">
<java classname="${main.class}">
<!-- <arg value="1" /> -->
<classpath>
<path refid="scala3.classpath" />
<path refid="build.classpath" />
</classpath>
</java>
</target>
<target name="test-compile" depends="init, compile">
<mkdir dir="${test-build.dir}" />
<pathconvert property="test.classpath" refid="test.classpath" />
<pathconvert property="test.sources" pathsep=" ">
<fileset dir="${test-source.dir}/" includes="**/*.scala" />
</pathconvert>
<dotc srcdir="${test-source.dir}"
destdir="${test-build.dir}"
classpathref="test.classpath" />
</target>
<target name="test" depends="compile, test-compile">
<!--
see https://junit.org/junit5/docs/snapshot/user-guide/#running-tests-console-launcher-options
-->
<java classpathref="test.classpath"
classname="org.junit.platform.console.ConsoleLauncher"
fork="true" failonerror="true">
<jvmarg value="-Dfile.encoding=UTF-8"/>
<arg value=""--select-directory=${test-build.dir}""/>
<arg line="--reports-dir "${test-report.dir}""/> <!-- created if not found -->
<arg value="--fail-if-no-tests"/>
</java>
<junitreport todir="${test-report.dir}">
<fileset dir="${test-report.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test-report.dir}/html"/>
</junitreport>
</target>
<target name="clean">
<delete dir="${target.dir}"/>
</target>
</project>