-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscalatasks.xml
76 lines (60 loc) · 2.57 KB
/
scalatasks.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
<project name="ScalaTasks">
<!--
Standard scala tasks together with a few useful macros and path definitions
-->
<target name ="scalatasks"
description="Define Scala tasks and classpaths" >
<echo message="DEFAULT ANT SCALATASKS"/>
<property name = "scala-library.jar"
value = "${scala.home}/lib/scala-library.jar" />
<path id="scala.compile.classpath">
<pathelement location="${scala-library.jar}"/>
</path>
<taskdef name="scalac" classname="ant.ScalaCompilerTask"
classpath="${base.dir}/ScalaCompilerTask.jar"/>
</target>
<macrodef name="makemain">
<!--
Make the named jar file from all the compiled files in
${build.dir} and with a class path pointing to the scala
library Example: <makemain name="test.jar" class="Test1"/>
The resulting jar file is executable from java, but
THIS IS NOT A WAY OF BUILDING A CLOSED JAVA PROGRAM
because the scala class library will be located differently
on different machines.
-->
<attribute name="name"/> <!-- Name of the program jar file -->
<attribute name="class"/> <!-- Name of the main class -->
<sequential>
<jar destfile = "${build.dir}/@{name}"
basedir = "${build.dir}"
includes = "**/*.class">
<manifest>
<attribute name="Main-Class" value="@{class}"/>
<attribute name="Class-Path" value="${scala-library.jar}"/>
</manifest>
</jar>
</sequential>
</macrodef>
<macrodef name="makejavamain">
<!--
Make the named jar file from all the compiled files in
${build.dir} together with the scala library
Example: <makemain name="test.jar" class="Test1"/>
-->
<attribute name="name"/> <!-- Name of the program jar file -->
<attribute name="class"/> <!-- Name of the main class -->
<sequential>
<delete file="${build.dir}/@{name}"/>
<copy file ="${scala-library.jar}" toFile="${build.dir}/@{name}"/>
<jar destfile = "${build.dir}/@{name}"
basedir = "${build.dir}"
update = "on"
includes = "**/*.class">
<manifest>
<attribute name="Main-Class" value="@{class}"/>
</manifest>
</jar>
</sequential>
</macrodef>
</project>