forked from konst-git/php2scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·69 lines (57 loc) · 2.12 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
<project default="jar" basedir=".">
<!-- Scala home directory when installed on OSX with brew -->
<property environment="env"/>
<property name="scala.home" value="${env.SCALA_HOME}" />
<property name="shell" value="/bin/sh" />
<property name="quercus.src" value="quercus/src/modules/quercus/src" />
<property name="bin" value="${basedir}/bin" />
<path id="build.classpath">
<pathelement location="${scala.home}/lib/scala-compiler.jar" />
<pathelement location="${scala.home}/lib/scala-library.jar" />
<pathelement location="${lib}/quercus.jar"/>
<pathelement location="${lib}/javaee-16.jar"/>
</path>
<target name="init">
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${scala.home}/lib/scala-compiler.jar" />
<pathelement location="${scala.home}/lib/scala-library.jar" />
<pathelement location="${scala.home}/lib/scala-reflect.jar" />
</classpath>
</taskdef>
</target>
<target name="clean">
<delete dir="bin" />
<delete file="${lib}/php-scala.jar" />
</target>
<available property="quercus.installed" file="${quercus.src}" type="dir" />
<target name="mklib">
<mkdir dir="src/phplib" />
<exec executable="${shell}" output="src/phplib/phplib.java" dir="${quercus.src}" >
<arg value="${basedir}/mklib.sh" />
</exec>
</target>
<target name="phplib" if="quercus.installed">
<uptodate property="mklib.uptodate" targetfile="src/phplib/phplib.java">
<srcfiles dir="${quercus.src}" includes="*.java" />
</uptodate>
<antcall target="mklib" />
</target>
<target name="copylib">
<copy file="src/phplib/phplib.java" tofile="${copy}/src/phplib/phplib.java" />
</target>
<target name="compile" depends="init,phplib">
<mkdir dir="${bin}" />
<javac srcdir="src" destdir="${bin}" classpathref="build.classpath" includeantruntime="false">
<include name="*.java"/>
</javac>
<scalac srcdir="src" destdir="${bin}" classpathref="build.classpath">
<include name="*.scala"/>
</scalac>
</target>
<target name="jar" depends="compile">
<mkdir dir="${lib}" />
<jar destfile="lib/php-scala.jar" basedir="${bin}">
</jar>
</target>
</project>