build.xml 2.91 KB
Newer Older
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 91 92 93 94
<project name="shvm-server" default="build" basedir=".">

    <!--
     Import required property files.
     -->
    <property file="../common.properties"/>
    <property file="build.properties" />
    <property file="../disl.version.properties" />

    <!--
    Initialize the build directory
    -->
    <target name="init">
        <mkdir dir="${build.shvm-server}" />
    </target>

    <!--
    Dependency class paths
    -->
    <path id="asm.classpath">
        <fileset dir="../${lib.disl.dir}" includes="asm*.jar" id="asm.fileset"/>
    </path>
    <path id="util.classpath">
        <pathelement location="../${build.util}"/>
    </path>

    <path id="protobuf.classpath">
        <fileset dir="../${lib.disl.dir}" includes="protobuf*.jar"/>
    </path>

    <!--
    Refer to the parent targets
    -->
    <target name="compile-util">
        <ant antfile="../build.xml" target="compile-util" usenativebasedir="true" />
    </target>

    <target name="compile-shvm-dispatch">
        <ant antfile="../build.xml" target="compile-shvm-dispatch" usenativebasedir="true" />
    </target>

    <target name="build-shvm-dispatch">
        <ant antfile="../build.xml" target="build-shvm-dispatch" usenativebasedir="true" />
    </target>

    <target name="compile-shvm">
        <ant antfile="../build.xml" target="compile-shvm" usenativebasedir="true" />
    </target>

    <!-- SHVM Server -->
    <target name="compile" depends="compile-shvm,compile-util,compile-shvm-dispatch,init">
        <javac destdir="${build.shvm-server}" debug="true" srcdir="src/">
            <classpath>
                <path path="../${src.shvm.prefix}/${build.shvm}" />
                <path refid="util.classpath"/>
                <path refid="asm.classpath" />
                <path refid="protobuf.classpath"/>
            </classpath>
        </javac>
    </target>

    <!-- Get ASM libs from ASM class path. -->
    <pathconvert pathsep=" " property="asm.libs" refid="asm.classpath">
        <mapper type="flatten"/>
    </pathconvert>

    <!-- Get ProtoBuf Java libs from ProtoBuf class path. -->
    <pathconvert pathsep=" " property="protobuf.libs" refid="protobuf.classpath">
        <mapper type="flatten"/>
    </pathconvert>

    <target name="build" depends="compile, build-shvm-dispatch">

        <jar destfile="${out.lib}/${shvm-server.lib}">
            <manifest>
                <attribute name="Class-Path" value="${asm.libs} ${protobuf.libs}"/>
                <attribute name="Main-Class" value="ch.usi.dag.dislreserver.DiSLREServer"/>
                <attribute name="DiSL-Version" value="${disl.version}"/>
            </manifest>

            <fileset dir="${build.shvm-server}" />
            <fileset dir="../${src.shvm.prefix}/${build.shvm}" />
            <fileset dir="../${build.util}"/>
        </jar>
    </target>

    <!--
    Clean the build directory
    -->
    <target name="clean">
        <delete dir="${out.dir}" />
    </target>

</project>