Commit 63d4dd1b authored by Vít Kabele's avatar Vít Kabele

Compiling and building disl-server in subproject

parent 7dc8a418
Pipeline #3397 passed with stages
in 3 minutes and 14 seconds
......@@ -11,11 +11,10 @@ src.doc.jdoc=${src.doc}/javadoc
src.doc.intro=${src.doc}/intro
src.examples=examples
build.artifacts.list = ${lib.dir}/artifacts.lst
# Output library artifact names
disl.lib=disl-server.jar
disl.bypass.lib=disl-bypass.jar
disl.agent.lib.base=dislagent
......
......@@ -6,7 +6,7 @@
<property name="build.sysclasspath" value="ignore"/>
<property file="disl.version"/>
<property file="disl.version.properties"/>
<property file="dependencies.local.properties"/>
<property file="dependencies.properties"/>
......@@ -269,6 +269,10 @@
<pathelement location="${src.disl.prefix}/${build.disl}"/>
</path>
<path id="disl-server.classpath">
<pathelement location="${src.disl-server.prefix}/${build.disl-server}"/>
</path>
<path id="disl.bypass.classpath">
<pathelement location="${build.disl.bypass}/dynamic"/>
</path>
......@@ -478,27 +482,14 @@
<ant antfile="${src.disl.prefix}/build.xml" target="compile" usenativebasedir="true"/>
</target>
<target name="compile-disl-server" depends="compile-disl">
<ant dir="${src.disl-server.prefix}" target="compile"/>
</target>
<target name="build-disl" depends="compile-disl,build-disl-bypass">
<local name="server.class"/>
<find-class property="server.class" dir="${src.disl.prefix}/${build.disl}" name="DiSLServer"/>
<local name="classfinder.class"/>
<find-class property="classfinder.class" dir="${src.disl.prefix}/${build.disl}" name="DislClassFinder"/>
<jar destfile="${out.lib}/${disl.lib}">
<manifest>
<attribute name="Class-Path" value="${asm.libs} ${protobuf.libs}"/>
<attribute name="Main-Class" value="${server.class}"/>
<attribute name="DiSL-Version" value="${disl.version}"/>
</manifest>
<service type="javax.annotation.processing.Processor" provider="${classfinder.class}"/>
<fileset dir="${build.util}"/>
<fileset dir="${src.disl.prefix}/${build.disl}"/>
<resources refid="disl.bypass.files"/>
</jar>
<target name="build-disl" depends="compile-disl,build-disl-bypass">
<ant dir="${src.disl-server.prefix}" target="build" />
<copy file="${src.disl-server.prefix}/${out.lib}/${disl.lib}" tofile="${out.lib}/${disl.lib}" />
</target>
......@@ -685,6 +676,7 @@
<path id="test.classpath">
<path refid="util.classpath"/>
<path refid="disl.classpath"/>
<path refid="disl-server.classpath"/>
<path refid="shvm.classpath"/>
<path refid="junit.classpath"/>
<path refid="asm.classpath"/>
......@@ -963,14 +955,6 @@
<path refid="util.classpath"/>
<path refid="asm.classpath"/>
</classpath>
<package name="ch.usi.dag.disl.annotation"/>
<package name="ch.usi.dag.disl.marker"/>
<package name="ch.usi.dag.disl.guardcontext"/>
<package name="ch.usi.dag.disl.staticcontext"/>
<package name="ch.usi.dag.disl.dynamiccontext"/>
<package name="ch.usi.dag.disl.classcontext"/>
<package name="ch.usi.dag.disl.processorcontext"/>
</javadoc>
</target>
......@@ -1081,8 +1065,12 @@
<ant dir="${src.disl.prefix}" target="clean" />
</target>
<target name="clean-disl-server">
<ant dir="${src.disl-server.prefix}" target="clean" />
</target>
<target name="clean" depends="clean-disl" description="Removes all files produced during the build.">
<target name="clean" depends="clean-disl, clean-disl-server" description="Removes all files produced during the build.">
<exec executable="make" dir="${src.disl.agent}">
<arg value="cleanall"/>
</exec>
......
......@@ -7,6 +7,8 @@ lib.disl.dir=${lib.dir}/disl
lib.test.dir=${lib.dir}/test
lib.devel.dir=${lib.dir}/devel
build.artifacts.list = ${lib.dir}/artifacts.lst
# Build system libraries
build.ivy.url = http://central.maven.org/maven2/org/apache/ivy/ivy/${ivy.rev}/ivy-${ivy.rev}.jar
build.ivy.path = ${lib.ant.dir}/ivy.jar
......@@ -15,6 +17,9 @@ build.ivy.file = dependencies.xml
src.bin=bin
src.disl.prefix=disl
src.disl-server.prefix=disl-server
disl.lib=disl-server.jar
# Base output directory
out.dir=output
......@@ -32,6 +37,7 @@ build.dir=${out.dir}/build
build.util=${build.dir}/util
build.tools=${build.dir}/tools
build.disl=${build.dir}/disl
build.disl-server=${build.dir}/disl-server
build.disl.thread=${build.disl}-thread
build.disl.bypass=${build.disl}-bypass
build.shvm=${build.dir}/shvm
......
<project name="disl-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.disl-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="build-disl-bypass">
<ant antfile="../build.xml" target="build-disl-bypass" usenativebasedir="true" />
</target>
<!-- DiSL Server -->
<target name="compile" depends="compile-util,init">
<javac destdir="${build.disl-server}" debug="true" srcdir="src/">
<classpath>
<path path="../${src.disl.prefix}/${build.disl}" />
<path refid="util.classpath"/>
<path refid="asm.classpath"/>
<path refid="protobuf.classpath"/>
</classpath>
</javac>
</target>
<union id="disl.bypass.files">
<fileset dir="../${build.disl.bypass}/always" includes="**/BypassCheck.class"/>
<fileset dir="../${build.disl.bypass}/dynamic" includes="**/DynamicBypass.class"/>
</union>
<!-- 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-disl-bypass">
<jar destfile="${out.lib}/${disl.lib}">
<manifest>
<attribute name="Class-Path" value="${asm.libs} ${protobuf.libs}"/>
<attribute name="Main-Class" value="ch.usi.dag.dislserver.DiSLServer"/>
<attribute name="DiSL-Version" value="${disl.version}"/>
</manifest>
<service type="javax.annotation.processing.Processor" provider="ch.usi.dag.disl.DislClassFinder"/>
<fileset dir="${build.disl-server}" />
<fileset dir="../${build.util}"/>
<fileset dir="../${src.disl.prefix}/${build.disl}"/>
<resources refid="disl.bypass.files"/>
</jar>
</target>
<!--
Clean the build directory
-->
<target name="clean">
<delete dir="output" />
</target>
</project>
......@@ -112,6 +112,13 @@ final class RequestProcessor {
}
/**
* TODO VK: Consider not using the {@link ClassReader} class, as this only usage makes dependency
* on the ASM package.
* @param nameBytes
* @param classBytes
* @return
*/
private static String __getClassName (
final byte [] nameBytes, final byte [] classBytes
) {
......
......@@ -45,7 +45,6 @@
<!-- DiSL -->
<target name="compile" depends="compile-util,compile-disl-bypass, init">
<mkdir dir="${build.disl}"/>
<javac destdir="${build.disl}" debug="true">
<src path="src/${src.disl.annotation}"/>
<src path="src/${src.disl.classparser}"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment