<project name="soundcomp" basedir="." default="all">
<!-- this ant script builds SoundComp on native amd64 linux and executes some JUnit tests -->
<target name="init">
<!--taskdef name="FilterGrammar" classpath="tools" classname="FilterGrammar" />
<taskdef name="JFlex" classpath="tools/JFlex.jar" classname="JFlex.anttask.JFlexTask" /-->
<!--taskdef name="junit" classpath="tools/junit.jar" classname="" /-->
</target>
<target name="version">
<ant target="adjust_version" antfile="VersionInfo.xml" />
</target>
<target name="parserpre">
<ant antfile="parserpre.xml" dir="tools" />
<mkdir dir="Debug"/>
<delete file="tools/yacc"/>
<echo file="makeyacc.sh">#!/bin/sh
cd tools
tar -xzf byaccj1.15_src.tar.gz
cd byaccj1.15/src
gcc -o ../../yacc *.c
cd ../..
rm -rf byaccj1.15
</echo>
<exec executable="/bin/bash">
<arg value="makeyacc.sh"/>
</exec>
<chmod file="tools/yacc" perm="777"/>
</target>
<target name="parser" depends="parserpre">
<ant antfile="parsergen.xml" dir="tools" />
</target>
<target name="java">
<javac srcdir="javasrc" destdir="bin" classpath="junit.jar" includeantruntime="false" />
<ant antfile="SoundCompJar.xml" />
</target>
<target name="cpp">
<ant dir="csupport" antfile="build.xml.unix-ci" inheritall="false" target="helper"/>
<ant dir="csupport" antfile="build.xml.unix-ci" inheritall="false" target="all"/>
<echo file="buildc.sh">mkdir Debug 2>/dev/null
cd csrc
gcc -dumpversion
gcc -dumpmachine
gcc -Llib -fPIC -shared -o ../Debug/libSoundCompC.so -Iincludes */*.cpp -lflac -lape -lstdc++
cd ..
rm -f libSoundCompC.so
ln -s Debug/libSoundCompC.so libSoundCompC.so
</echo>
<exec executable="sh">
<arg line="buildc.sh" />
</exec>
<delete file="buildc.sh" />
</target>
<target name="all" depends="parserpre,init,version,parser,cpp,java">
</target>
<target name="junit">
<junit filtertrace="off">
<formatter type="plain" extension="txt"/>
<classpath path="tools/junit.jar;SoundComp.jar" />
<test name="de.maramuse.soundcomp.test.Test" errorproperty="testerror" failureproperty="testfailure" filtertrace="off" outfile="test-log">
<formatter type="plain" />
</test>
</junit>
<concat append="true">
<filelist dir="." files="test-log.txt"></filelist>
</concat>
<!-- could do additional things even if test fails -->
<condition property="fail">
<or>
<isset property="testerror"/>
<isset property="testfailure"/>
</or>
</condition>
<fail if="fail" />
</target>
<target name="default" depends="all, junit">
</target>
<target name="clean">
<delete file="tools/FilterGrammar.class" />
<delete file="tools/SCParser.java" />
<delete file="tools/MacroDefParser.java" />
<delete file="tools/ConditionalParser.java" />
<delete file="Debug/SoundCompC.so" />
<delete dir="bin/de" />
<delete file="SoundCompC.so" />
<delete file="soundcomp.jar" />
<ant dir="csupport" target="clean" antfile="build.xml.unix" />
</target>
</project>