-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
90 lines (79 loc) · 3.02 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
<?xml version="1.0"?>
<project name="scalax" default="jar">
<property file="build.local.properties"/>
<property file="${user.home}/build.local.properties"/>
<property name="version" value="0.0"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="src.tests.dir" value="${basedir}/tests"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.tests.dir" value="${basedir}/build-tests"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="tmp.dir" value="${basedir}/tmp"/>
<target name="messages">
<echo>=========================================================</echo>
<echo>This build method exists on sufferance.</echo>
<echo>You are strongly encouraged to build using Maven instead.</echo>
<echo>=========================================================</echo>
<echo/>
<echo>scala.home=${scala.home}</echo>
</target>
<target name="check-downloads">
<mkdir dir="${tmp.dir}"/>
<available property="got.slf4j" file="${tmp.dir}/slf4j-api-1.5.0.jar"/>
</target>
<target name="download-slf4j" unless="got.slf4j">
<get src="http://mirrors.ibiblio.org/pub/mirrors/maven2/org/slf4j/slf4j-api/1.5.0/slf4j-api-1.5.0.jar" dest="${tmp.dir}/slf4j-api-1.5.0.jar"/>
</target>
<target name="init" depends="messages, check-downloads, download-slf4j">
<property name="scala-library.jar" value="${scala.home}/lib/scala-library.jar"/>
<path id="build.classpath">
<pathelement location="${scala-library.jar}"/>
<pathelement location="${tmp.dir}/slf4j-api-1.5.0.jar"/>
</path>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${scala.home}/lib/scala-compiler.jar"/>
<pathelement location="${scala-library.jar}"/>
</classpath>
</taskdef>
</target>
<target name="build" depends="init">
<mkdir dir="${build.dir}"/>
<scalac srcdir="${src.dir}" destdir="${build.dir}"
deprecation="on" unchecked="on" encoding="UTF-8"
classpathref="build.classpath" force="changed"/>
</target>
<target name="build-tests" depends="build">
<mkdir dir="${build.tests.dir}"/>
<scalac srcdir="${src.tests.dir}" destdir="${build.tests.dir}"
deprecation="on" unchecked="on" encoding="UTF-8"
force="changed">
<classpath refid="build.classpath"/>
<classpath>
<pathelement location="${build.dir}"/>
</classpath>
</scalac>
</target>
<target name="run-tests" depends="build-tests">
<java classname="ScalaxTests">
<sysproperty key="java.awt.headless" value="true"/>
<classpath refid="build.classpath"/>
<classpath>
<pathelement location="build"/>
<pathelement location="build-tests"/>
</classpath>
</java>
</target>
<target name="jar" depends="build">
<mkdir dir="${dist.dir}"/>
<jar basedir="${build.dir}"
jarfile="${dist.dir}/${ant.project.name}-${version}.jar" index="true"/>
</target>
<target name="clean" depends="messages">
<delete dir="${build.dir}"/>
<delete dir="${build.tests.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${tmp.dir}"/>
</target>
</project>
<!-- vim: set ts=4 sw=4 noet: -->