-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
65 lines (53 loc) · 2.05 KB
/
Copy pathbuild.xml
File metadata and controls
65 lines (53 loc) · 2.05 KB
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- HelloWorld.scalaをコンパイルしてjarを作成するbuild.xml
環境に合わせてScala-homeを変更してください。 -->
<project default="create-jar" basedir=".">
<!-- Scala-home (環境に合わせて要変更) -->
<property name="scala-home" value="path/for/scala" />
<!-- Target Program Name -->
<property name="target" value="HelloWorld" />
<!-- Project-Home -->
<property name="project-home" value="." />
<!-- Binaries Directory -->
<property name="bin.dir" value="${project-home}/bin" />
<!-- Source Directory -->
<property name="src.dir" value="${project-home}/src" />
<!-- Build Directory -->
<property name="build.dir" value="${project-home}/classes" />
<!-- Scala library -->
<property name="target.jar" value="${target}.jar" />
<property name="scala.lib" value="${scala-home}/lib/scala-library.jar" />
<!-- Define scalac-->
<target name="init">
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${scala-home}/lib/scala-compiler.jar" />
<pathelement location="${scala.lib}" />
</classpath>
</taskdef>
</target>
<!-- Build with scalac -->
<target name="build" depends="init">
<delete>
<fileset dir="${build.dir}" includes="**/*.class" />
</delete>
<scalac srcdir="${src.dir}" destdir="${build.dir}">
<classpath>
<pathelement location="${scala.lib}" />
<pathelement location="${build.dir}" />
</classpath>
</scalac>
</target>
<!-- Create Jarfile -->
<target name="create-jar" depends="build">
<property name="target.jar" value="${target}.jar" />
<jar destfile="${bin.dir}/${target.jar}" update="true" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="${target}" />
<attribute name="Class-Path" value="." />
</manifest>
<fileset dir="${build.dir}" />
<zipfileset src="${scala.lib}" excludes="META-INF/*.SF,library.properties" />
</jar>
</target>
</project>