Commit 7dc8a418 authored by Vít Kabele's avatar Vít Kabele
Browse files

DiSL is now compiling in separate build.xml file

parent 0aecea0a
lib.dir=lib
lib.ant.dir=${lib.dir}/ant
lib.disl.dir=${lib.dir}/disl
lib.test.dir=${lib.dir}/test
lib.devel.dir=${lib.dir}/devel
src.bin=bin
src.disl.prefix=disl
src.disl=src-disl
src.disl.annotation=src-annotation
src.disl.classparser=src-classparser
src.disl.coderep=src-coderep
src.disl.context=src-context
src.disl.exception=src-exception
src.disl.guard=src-guard
src.disl.localvar=src-localvar
src.disl.main=src-main
src.disl.marker=src-marker
src.disl.processor=src-processor
src.disl.resolver=src-resolver
src.disl.scope=src-scope
src.disl.snippet=src-snippet
src.disl.staticcontext-uid=src-staticcontext-uid
src.disl.staticcontext=src-staticcontext
src.disl.util=src-util
src.disl.weaver-pe=src-weaver-pe
src.disl.weaver=src-weaver
src.disl.bypass=src-disl-bypass
src.disl.agent=src-disl-agent
src.shvm=src-shvm
......@@ -40,39 +11,9 @@ src.doc.jdoc=${src.doc}/javadoc
src.doc.intro=${src.doc}/intro
src.examples=examples
# Base output directory
out.dir=output
# Directories for build artifacts
build.dir=${out.dir}/build
build.util=${build.dir}/util
build.tools=${build.dir}/tools
build.disl=${build.dir}/disl
build.disl.thread=${build.disl}-thread
build.disl.bypass=${build.disl}-bypass
build.shvm=${build.dir}/shvm
build.shvm.dispatch=${build.shvm}-dispatch
build.test=${build.dir}/test
build.doc.intro=${build.dir}/intro
# 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
build.ivy.file = dependencies.xml
build.artifacts.list = ${lib.dir}/artifacts.lst
# Directories for output artifacts
out.lib=${out.dir}/lib
out.src=${out.dir}/src
out.test=${out.dir}/test
out.junit=${out.dir}/junit
out.doc.jdoc=${out.dir}/jdoc
# Output library artifact names
disl.lib=disl-server.jar
disl.bypass.lib=disl-bypass.jar
......
......@@ -14,6 +14,8 @@
<property file="build.local.properties"/>
<property file="build.properties"/>
<property file="common.properties" />
<!-- ================================================================== -->
<!-- IVY SETUP & TASKS -->
......@@ -264,7 +266,7 @@
</path>
<path id="disl.classpath">
<pathelement location="${build.disl}"/>
<pathelement location="${src.disl.prefix}/${build.disl}"/>
</path>
<path id="disl.bypass.classpath">
......@@ -473,45 +475,16 @@
<!-- DiSL -->
<target name="compile-disl" depends="compile-util,compile-disl-bypass">
<mkdir dir="${build.disl}"/>
<javac destdir="${build.disl}" debug="true">
<src path="${src.disl.prefix}/src/${src.disl.annotation}"/>
<src path="${src.disl.prefix}/src/${src.disl.classparser}"/>
<src path="${src.disl.prefix}/src/${src.disl.coderep}"/>
<src path="${src.disl.prefix}/src/${src.disl.context}"/>
<src path="${src.disl.prefix}/src/${src.disl.exception}"/>
<src path="${src.disl.prefix}/src/${src.disl.guard}"/>
<src path="${src.disl.prefix}/src/${src.disl.localvar}"/>
<src path="${src.disl.prefix}/src/${src.disl.main}"/>
<src path="${src.disl.prefix}/src/${src.disl.marker}"/>
<src path="${src.disl.prefix}/src/${src.disl.processor}"/>
<src path="${src.disl.prefix}/src/${src.disl.resolver}"/>
<src path="${src.disl.prefix}/src/${src.disl.scope}"/>
<src path="${src.disl.prefix}/src/${src.disl.snippet}"/>
<src path="${src.disl.prefix}/src/${src.disl.staticcontext-uid}"/>
<src path="${src.disl.prefix}/src/${src.disl.staticcontext}"/>
<src path="${src.disl.prefix}/src/${src.disl.util}"/>
<src path="${src.disl.prefix}/src/${src.disl.weaver-pe}"/>
<src path="${src.disl.prefix}/src/${src.disl.weaver}"/>
<src path="disl-server/src"/>
<classpath>
<path refid="disl.bypass.classpath"/>
<path refid="util.classpath"/>
<path refid="asm.classpath"/>
<path refid="protobuf.classpath"/>
</classpath>
</javac>
<ant antfile="${src.disl.prefix}/build.xml" target="compile" usenativebasedir="true"/>
</target>
<target name="build-disl" depends="compile-disl,build-disl-bypass">
<local name="server.class"/>
<find-class property="server.class" dir="${build.disl}" name="DiSLServer"/>
<find-class property="server.class" dir="${src.disl.prefix}/${build.disl}" name="DiSLServer"/>
<local name="classfinder.class"/>
<find-class property="classfinder.class" dir="${build.disl}" name="DislClassFinder"/>
<find-class property="classfinder.class" dir="${src.disl.prefix}/${build.disl}" name="DislClassFinder"/>
<jar destfile="${out.lib}/${disl.lib}">
<manifest>
......@@ -523,7 +496,7 @@
<service type="javax.annotation.processing.Processor" provider="${classfinder.class}"/>
<fileset dir="${build.util}"/>
<fileset dir="${build.disl}"/>
<fileset dir="${src.disl.prefix}/${build.disl}"/>
<resources refid="disl.bypass.files"/>
</jar>
</target>
......@@ -793,7 +766,7 @@
<tempfile property="classfinder.output" prefix="@{name}-disl-classes-" suffix=".lst" destDir="${out.dir}" createFile="true" deleteOnExit="true"/>
<local name="classfinder.class"/>
<find-class property="classfinder.class" dir="${build.disl}" name="DislClassFinder"/>
<find-class property="classfinder.class" dir="${src.disl.prefix}/${build.disl}" name="DislClassFinder"/>
<mkdir dir="${out.dir}/empty"/>
<javac srcdir="${src.test}" destDir="${out.dir}/empty">
......@@ -859,7 +832,7 @@
<path refid="junit.classpath"/>
<pathelement location="${build.test}"/>
<pathelement location="${build.util}"/>
<pathelement location="${build.disl}"/>
<pathelement location="${src.disl.prefix}/${build.disl}"/>
<pathelement location="${build.shvm}"/>
</classpath>
......@@ -956,11 +929,11 @@
source="1.8"
>
<sourcepath>
<pathelement path="${src.disl}"/>
<pathelement path="${src.disl.prefix}/src"/>
</sourcepath>
<sourcefiles>
<fileset dir="${src.disl}">
<fileset dir="${src.disl.prefix}/src">
<include name="**/DiSL.java"/>
<include name="**/Reflection.java"/>
<include name="**/Scope.java"/>
......@@ -1014,7 +987,7 @@
<target name="package-src">
<zip destfile="${out.src}/src.zip">
<zipfileset dir="${src.disl}"/>
<zipfileset dir="${src.disl.prefix}/src"/>
<zipfileset dir="${src.disl.bypass}/dynamic"/>
<zipfileset dir="${src.shvm}"/>
<zipfileset dir="${src.shvm.dispatch}"/>
......@@ -1104,8 +1077,12 @@
<ant dir="${src.examples}" target="clean"/>
</target>
<target name="clean-disl">
<ant dir="${src.disl.prefix}" target="clean" />
</target>
<target name="clean" description="Removes all files produced during the build.">
<target name="clean" depends="clean-disl" description="Removes all files produced during the build.">
<exec executable="make" dir="${src.disl.agent}">
<arg value="cleanall"/>
</exec>
......
#
# Build properties common for the main project and all subprojects.
#
lib.dir=lib
lib.ant.dir=${lib.dir}/ant
lib.disl.dir=${lib.dir}/disl
lib.test.dir=${lib.dir}/test
lib.devel.dir=${lib.dir}/devel
# 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
build.ivy.file = dependencies.xml
src.bin=bin
src.disl.prefix=disl
# Base output directory
out.dir=output
# Directories for output artifacts
out.lib=${out.dir}/lib
out.src=${out.dir}/src
out.test=${out.dir}/test
out.junit=${out.dir}/junit
out.doc.jdoc=${out.dir}/jdoc
# Directories for build artifacts
build.dir=${out.dir}/build
build.util=${build.dir}/util
build.tools=${build.dir}/tools
build.disl=${build.dir}/disl
build.disl.thread=${build.disl}-thread
build.disl.bypass=${build.disl}-bypass
build.shvm=${build.dir}/shvm
build.shvm.dispatch=${build.shvm}-dispatch
build.test=${build.dir}/test
build.doc.intro=${build.dir}/intro
# Build properties related to the DiSL instrumentation library
src.disl.annotation=src-annotation
src.disl.classparser=src-classparser
src.disl.coderep=src-coderep
src.disl.context=src-context
src.disl.exception=src-exception
src.disl.guard=src-guard
src.disl.localvar=src-localvar
src.disl.main=src-main
src.disl.marker=src-marker
src.disl.processor=src-processor
src.disl.resolver=src-resolver
src.disl.scope=src-scope
src.disl.snippet=src-snippet
src.disl.staticcontext-uid=src-staticcontext-uid
src.disl.staticcontext=src-staticcontext
src.disl.util=src-util
src.disl.weaver-pe=src-weaver-pe
src.disl.weaver=src-weaver
<project name="disl" default="compile" basedir=".">
<!--
Import required property files.
-->
<property file="../common.properties"/>
<property file="build.properties" />
<!--
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>
<path id="disl.bypass.classpath">
<pathelement location="../${build.disl.bypass}/dynamic"/>
</path>
<!--
Initialize the build directory
-->
<target name="init">
<mkdir dir="${build.disl}" />
</target>
<!--
Refer to the parent targets
-->
<target name="compile-util">
<ant antfile="../build.xml" target="compile-util" usenativebasedir="true" />
</target>
<target name="compile-disl-bypass">
<ant antfile="../build.xml" target="compile-disl-bypass" usenativebasedir="true" />
</target>
<!-- 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}"/>
<src path="src/${src.disl.coderep}"/>
<src path="src/${src.disl.context}"/>
<src path="src/${src.disl.exception}"/>
<src path="src/${src.disl.guard}"/>
<src path="src/${src.disl.localvar}"/>
<src path="src/${src.disl.main}"/>
<src path="src/${src.disl.marker}"/>
<src path="src/${src.disl.processor}"/>
<src path="src/${src.disl.resolver}"/>
<src path="src/${src.disl.scope}"/>
<src path="src/${src.disl.snippet}"/>
<src path="src/${src.disl.staticcontext-uid}"/>
<src path="src/${src.disl.staticcontext}"/>
<src path="src/${src.disl.util}"/>
<src path="src/${src.disl.weaver-pe}"/>
<src path="src/${src.disl.weaver}"/>
<src path="../disl-server/src" />
<classpath>
<path refid="disl.bypass.classpath"/>
<path refid="util.classpath"/>
<path refid="asm.classpath"/>
<path refid="protobuf.classpath"/>
</classpath>
</javac>
</target>
<target name="clean">
<delete dir="${out.dir}" />
</target>
</project>
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