Refactored conversion to boost layout

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@645 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-05-12 08:58:55 +00:00
parent 4faf23b2b1
commit d28db33c08
2 changed files with 68 additions and 17 deletions

View file

@ -120,8 +120,15 @@
<property name="boost.dir" value="${out.dir}/../boost"/>
<target name="boost" description="convert to boost">
<delete dir="${boost.dir}"/>
<presetdef name="bjam">
<exec taskname="bjam" failonerror="true" executable="bjam">
<arg value="-q"/>
</exec>
</presetdef>
<target name="boost.generate" description="generate boost.mock into ${boost.dir}">
<delete dir="${boost.dir}/boost/mock"/>
<delete dir="${boost.dir}/libs/mock"/>
<copy todir="${boost.dir}/boost/mock">
<fileset dir="${libraries.dir}/turtle" includes="**"/>
</copy>
@ -139,37 +146,81 @@
<copy todir="${boost.dir}">
<fileset dir="boost" includes="LICENSE_1_0.txt,Jamroot.jam,Jamfile.v2"/>
</copy>
<!--
</target>
<target name="boost.convert" description="convert boost.mock in ${boost.dir}">
<replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="BOOST_MOCK_BOOST_MOCK" replace="BOOST_MOCK" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match='"([^"]+\.hpp)"' replace="&lt;boost/mock/\1&gt;" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp" excludes="**/detail/*.hpp"/>
</replaceregexp>
<replaceregexp match='"\.\./([^"]+\.hpp)"' replace="&lt;boost/mock/\1&gt;" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
</replaceregexp>
<replaceregexp match='"([^"]+\.hpp)"' replace="&lt;boost/mock/detail/\1&gt;" flags="g">
<fileset dir="${boost.dir}/boost/mock" includes="**/detail/*.hpp"/>
</replaceregexp>
<replaceregexp match="&lt;turtle/([^&gt;]+)" replace="&lt;boost/mock/\1" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="(namespace mock)" replace="namespace boost${line.separator}{${line.separator}\1" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="} // mock" replace="}${line.separator}}" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp"/>
</replaceregexp>
<replaceregexp match="( mock::)" replace=" boost::mock::" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
<replaceregexp match=" mock::" replace=" boost::mock::" flags="g">
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="^mock::" replace="boost::mock::" flags="m">
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="http://turtle.sourceforge.net" replace="Boost.Mock" flags="g">
<fileset dir="${boost.dir}" includes="**/*.hpp,**/*.cpp"/>
<fileset dir="${boost.dir}/boost/mock" includes="**/*.hpp"/>
<fileset dir="${boost.dir}/libs/mock" includes="**/*.cpp,**/*.hpp"/>
</replaceregexp>
<replaceregexp match="reference.helpers." replace="reference.helpers.boost_" flags="g">
<fileset dir="${boost.dir}/libs/mock" includes="**/*.qbk"/>
</replaceregexp>
<replaceregexp match="turtle." replace="boost_mock." flags="g">
<fileset dir="${boost.dir}/libs/mock" includes="**/*.qbk"/>
</replaceregexp>
<replaceregexp match="Turtle" replace="Boost.Mock" flags="g">
<fileset dir="${boost.dir}/libs/mock" includes="**/*.qbk"/>
</replaceregexp>
-->
</target>
<target name="boost.test" description="run boost.mock tests in ${boost.dir}">
<bjam dir="${boost.dir}/libs/mock/test"/>
</target>
<target name="boost.doc" description="generate boost.mock documentation in ${boost.dir}">
<bjam dir="${boost.dir}/libs/mock/doc"/>
</target>
<target name="boost.package" description="package boost.mock">
<zip destfile="${out.dir}/boost-mock.zip">
<fileset dir="${boost.dir}" includes="boost/mock/**"/>
<fileset dir="${boost.dir}" includes="libs/mock/**" excludes="**/bin/**"/>
<fileset dir="${boost.dir}" includes="LICENSE_1_0.txt,Jamroot.jam,Jamfile.v2"/>
</zip>
</target>
<target name="documentation" depends="boost.generate,boost.doc"/>
<target name="boost" depends="boost.generate,boost.convert,boost.doc,boost.test"/>
<target name="all" depends="configure,test,bench,reports,export,package" description="configure, build and run tests and benchmark, export and package distribution"/>
</project>