mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Changed project layout
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@460 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
b22842eade
commit
3358ddda0e
55 changed files with 32 additions and 0 deletions
156
build/build.xml
Normal file
156
build/build.xml
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
<project name="turtle" default="all">
|
||||
|
||||
<property environment="env"/>
|
||||
<import file="${env.PONEY_HOME}/poney.xml"/>
|
||||
|
||||
<target name="clean" description="clean intermediate build artifacts">
|
||||
<delete dir="${out.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="configure" description="update external libraries">
|
||||
<update name="boost"/>
|
||||
</target>
|
||||
|
||||
<presetdef name="build-turtle-test">
|
||||
<build-test input="test" depends="boost" mode="all" excludes="bench_*,fail_*">
|
||||
<compilerarg value="-Wno-uninitialized" location="mid" if="is-cygwin"/>
|
||||
</build-test>
|
||||
</presetdef>
|
||||
|
||||
<target name="test" description="run unit tests">
|
||||
<delete dir="${tests.dir}/test/bin"/>
|
||||
<build-turtle-test name="turtle"/>
|
||||
<build-turtle-test name="turtle_max_args">
|
||||
<defineset>
|
||||
<define name="MOCK_MAX_ARGS" value="21"/>
|
||||
</defineset>
|
||||
</build-turtle-test>
|
||||
<build-turtle-test name="turtle_use_conversions">
|
||||
<defineset define="MOCK_USE_CONVERSIONS"/>
|
||||
</build-turtle-test>
|
||||
<build-turtle-test name="turtle_use_boost_test">
|
||||
<defineset define="MOCK_USE_BOOST_TEST"/>
|
||||
</build-turtle-test>
|
||||
</target>
|
||||
|
||||
<target name="analyse" description="run errors analyser">
|
||||
<quiet>
|
||||
<mkdir dir="${reports.dir}"/>
|
||||
<delete file="${reports.dir}/errors-${platform}.log"/>
|
||||
<touch file="${reports.dir}/errors-${platform}.log"/>
|
||||
</quiet>
|
||||
<for param="file">
|
||||
<fileset dir="${tests.dir}/errors_test" includes="*.cpp"/>
|
||||
<sequential>
|
||||
<record name="${reports.dir}/errors-${platform}.log" action="start" append="true"/>
|
||||
<ant target="-analyse">
|
||||
<property name="file" value="@{file}"/>
|
||||
</ant>
|
||||
<record name="${reports.dir}/errors-${platform}.log" action="stop"/>
|
||||
</sequential>
|
||||
</for>
|
||||
</target>
|
||||
|
||||
<target name="-analyse">
|
||||
<trycatch>
|
||||
<try>
|
||||
<echo>${file}</echo>
|
||||
<compile name="errors" input="${tests.dir}/errors_test" outdir="${out.dir}/errors_test" excludes="**">
|
||||
<includepath path="${libraries.dir}"/>
|
||||
<fileset file="${file}"/>
|
||||
</compile>
|
||||
</try>
|
||||
</trycatch>
|
||||
</target>
|
||||
|
||||
<target name="bench" description="run compilation benchmark">
|
||||
<mkdir dir="${reports.dir}"/>
|
||||
<quiet>
|
||||
<delete file="${reports.dir}/benchmark-${platform}.log"/>
|
||||
<touch file="${reports.dir}/benchmark-${platform}.log"/>
|
||||
<delete dir="${out.dir}/bench_test"/>
|
||||
<delete dir="${tests.dir}/test/bin"/>
|
||||
</quiet>
|
||||
<for param="file">
|
||||
<fileset dir="${tests.dir}/test" includes="bench_*.cpp"/>
|
||||
<sequential>
|
||||
<record name="${reports.dir}/benchmark-${platform}.log" action="start" append="true"/>
|
||||
<ant target="-bench">
|
||||
<property name="file" value="@{file}"/>
|
||||
</ant>
|
||||
<record name="${reports.dir}/benchmark-${platform}.log" action="stop"/>
|
||||
</sequential>
|
||||
</for>
|
||||
</target>
|
||||
|
||||
<target name="-bench">
|
||||
<echo>${file}</echo>
|
||||
<stopwatch name="bench"/>
|
||||
<quiet>
|
||||
<compile name="bench" input="${tests.dir}/test" outdir="${out.dir}/bench_test" excludes="**">
|
||||
<includepath path="${libraries.dir}"/>
|
||||
<fileset file="${file}"/>
|
||||
</compile>
|
||||
</quiet>
|
||||
<stopwatch name="bench" action="total"/>
|
||||
</target>
|
||||
|
||||
<target name="reports" description="generate code analysis reports">
|
||||
<headers name="turtle"/>
|
||||
<check name="turtle"/>
|
||||
</target>
|
||||
|
||||
<target name="export" description="export distribution">
|
||||
<sync todir="${dist.dir}/include">
|
||||
<fileset dir="${libraries.dir}" includes="turtle/**.hpp"/>
|
||||
</sync>
|
||||
<info version="svn rev ${svn.revision}" todir="${dist.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="package" depends="export" description="package distribution">
|
||||
<mkdir dir="${dist.dir}"/>
|
||||
<zip destfile="${dist.dir}/${ant.project.name}.zip">
|
||||
<fileset dir="${dist.dir}" includes="include/**"/>
|
||||
<fileset dir="${root.dir}" includes="*.txt"/>
|
||||
</zip>
|
||||
<tar destfile="${dist.dir}/${ant.project.name}.tar.bz2" compression="bzip2">
|
||||
<fileset dir="${dist.dir}" includes="include/**"/>
|
||||
<fileset dir="${root.dir}" includes="*.txt"/>
|
||||
</tar>
|
||||
</target>
|
||||
|
||||
<property name="boost.dir" value="${out.dir}/../boost.mock"/>
|
||||
<target name="boost" description="convert to boost">
|
||||
<delete dir="${boost.dir}"/>
|
||||
<copy todir="${boost.dir}/boost/mock">
|
||||
<fileset dir="${libraries.dir}/turtle" includes="**"/>
|
||||
</copy>
|
||||
<copy todir="${boost.dir}/libs/mock/test">
|
||||
<fileset dir="${tests.dir}/test" includes="**"/>
|
||||
</copy>
|
||||
<copy todir="${boost.dir}">
|
||||
<fileset dir="${libraries.dir}" includes="Jam*"/>
|
||||
</copy>
|
||||
<replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g">
|
||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
||||
</replaceregexp>
|
||||
<replaceregexp match="BOOST_MOCK_BOOST_MOCK" replace="BOOST_MOCK" flags="g">
|
||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
||||
</replaceregexp>
|
||||
<replaceregexp match='"([^"]+)"' replace="<boost/mock/\1>" flags="g">
|
||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
||||
</replaceregexp>
|
||||
<replaceregexp match="<turtle/([^>]+)" replace="<boost/mock/\1" flags="g">
|
||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
||||
</replaceregexp>
|
||||
<replaceregexp match="(namespace mock)" replace="namespace boost${line.separator}{${line.separator}\1" flags="g">
|
||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
||||
</replaceregexp>
|
||||
<replaceregexp match="(}${line.separator}${line.separator}#endif //)" replace="}${line.separator}\1" flags="g">
|
||||
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
|
||||
</replaceregexp>
|
||||
</target>
|
||||
|
||||
<target name="all" depends="configure,test,bench,reports,export,package" description="configure, build and run tests and benchmark, export and package distribution"/>
|
||||
|
||||
</project>
|
||||
Loading…
Add table
Add a link
Reference in a new issue