Moved part of the build out of build.xml

This commit is contained in:
Mathieu Champlon 2015-03-07 19:04:48 +01:00
parent d424d4ee7f
commit 2a34194231
6 changed files with 104 additions and 64 deletions

View file

@ -45,38 +45,38 @@ before_install:
- git submodule foreach "git reset --quiet --hard; git clean -fxd" - git submodule foreach "git reset --quiet --hard; git clean -fxd"
- git reset --hard; git clean -fxd - git reset --hard; git clean -fxd
- git status - git status
- mv $PROJECT_DIR/../$PROJECT_TO_TEST/ $BOOST/libs/$PROJECT_TO_TEST
- PROJECT_DIR=$BOOST/libs/$PROJECT_TO_TEST
- rm $PROJECT_DIR/Jam*
- ./bootstrap.sh - ./bootstrap.sh
- ./b2 headers - ./b2 headers
script: script:
- if [ "$CCFLAGS" != "" ]; then FLAGS="cxxflags=\"$CCFLAGS\" linkflags=\"$LINKFLAGS\""; else FLAGS=""; fi - if [ "$CCFLAGS" != "" ]; then FLAGS="cxxflags=\"$CCFLAGS\" linkflags=\"$LINKFLAGS\""; else FLAGS=""; fi
- cd $BOOST/libs/$PROJECT_TO_TEST/test/ - cd $PROJECT_DIR/build
# `--coverage` flags required to generate coverage info for Coveralls # `--coverage` flags required to generate coverage info for Coveralls
- ../../../b2 -q cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage" # ../../../b2 -q cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage"
- export BOOST_ROOT=$BOOST
- ./build.sh cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage"
after_success: after_success:
- COVERALS_DIR=$PROJECT_DIR/coverals
# Copying Coveralls data to a separate folder # Copying Coveralls data to a separate folder
- mkdir -p $PROJECT_DIR/coverals - mkdir -p $COVERALS_DIR
- find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $PROJECT_DIR/coverals/ \; - find ../test/bin/ -name "*.gcda" -exec cp "{}" $COVERALS_DIR/ \;
- find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $PROJECT_DIR/coverals/ \; - find ../test/bin/ -name "*.gcno" -exec cp "{}" $COVERALS_DIR/ \;
# Preparing Coveralls data by # Preparing Coveralls data by
# ... installing the tools # ... installing the tools
- sudo apt-get install -qq python-yaml lcov - sudo apt-get install -qq python-yaml lcov
# ... changind data format to a readable one # ... changind data format to a readable one
- lcov --directory $PROJECT_DIR/coverals --base-directory ./ --capture --output-file $PROJECT_DIR/coverals/coverage.info - lcov --directory $COVERALS_DIR --base-directory ./ --capture --output-file $COVERALS_DIR/coverage.info
# ... erasing /test/ /example/ folder data # ... erasing /test/ /example/ folder data
- cd $BOOST - lcov --remove $COVERALS_DIR/coverage.info "/usr*" "/test/*" $IGNORE_COVERAGE "tests/*" "*/doc/examples/*" -o $COVERALS_DIR/coverage.info
- lcov --remove $PROJECT_DIR/coverals/coverage.info "/usr*" "*/$PROJECT_TO_TEST/test/*" $IGNORE_COVERAGE "*/$PROJECT_TO_TEST/tests/*" "*/$PROJECT_TO_TEST/examples/*" "*/$PROJECT_TO_TEST/example/*" -o $PROJECT_DIR/coverals/coverage.info
# ... erasing data that is not related to this project directly # ... erasing data that is not related to this project directly
- OTHER_LIBS=`grep "submodule .*" .gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/$PROJECT_TO_TEST\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'` - OTHER_LIBS=`grep "submodule .*" .gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/$PROJECT_TO_TEST\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'`
- echo $OTHER_LIBS - echo $OTHER_LIBS
- eval "lcov --remove $PROJECT_DIR/coverals/coverage.info $OTHER_LIBS -o $PROJECT_DIR/coverals/coverage.info" - eval "lcov --remove $COVERALS_DIR/coverage.info $OTHER_LIBS -o $COVERALS_DIR/coverage.info"
# Sending data to Coveralls # Sending data to Coveralls
- cd $PROJECT_DIR - cd $PROJECT_DIR

37
build/build.bat Normal file
View file

@ -0,0 +1,37 @@
@echo off
rem Copyright (C) 2015 Mathieu Champlon
rem
rem Distributed under the Boost Software License, Version 1.0.
rem (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
setlocal
goto Start
:Error
color 00
goto :eof
:Start
rem error if BOOST_ROOT not set
set BOOST=%BOOST_ROOT%
pushd ..\test
%BOOST%\b2 -q %*
popd
if errorlevel 1 goto Error
set BOOSTBOOK_DIR=..\bin\turtle\boostbook
xcopy /Y /S /Q /I %BOOST%\tools\boostbook\xsl %BOOSTBOOK_DIR%\xsl
xcopy /Y /S /Q /I %BOOST%\tools\boostbook\dtd %BOOSTBOOK_DIR%\dtd
xcopy /Y /S /Q /I boostbook %BOOSTBOOK_DIR%
xcopy /Y /S /Q /I %BOOST%\doc\src\boostbook.css ..\doc\html
xcopy /Y /S /Q /I %BOOST%\doc\src\images\*.png ..\doc\html\images
xcopy /Y /S /Q /I %BOOST%\doc\src\images\callouts\*.png ..\doc\html\images\callouts
if errorlevel 1 goto Error
pushd ..\doc
%BOOST%\b2 -q %*
popd
:End

View file

@ -1 +1 @@
extensions = headers,check extensions = headers,check,run

39
build/build.sh Normal file
View file

@ -0,0 +1,39 @@
#!/bin/sh
# Copyright (C) 2015 Mathieu Champlon
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
run()
{
$@
r=$?
if test $r -ne 0 ; then
exit $r
fi
}
copy()
{
for dir; do true; done
run mkdir -p $dir
run cp $@
}
export BOOST=$BOOST_ROOT
cd ../test
run $BOOST/b2 -q $*
cd ../build
export BOOSTBOOK_DIR=../bin/turtle/boostbook
run copy -r "$BOOST"/tools/boostbook/xsl $BOOSTBOOK_DIR
run copy -r "$BOOST"/tools/boostbook/dtd $BOOSTBOOK_DIR
run copy -r boostbook/* $BOOSTBOOK_DIR
run copy "$BOOST"/doc/src/boostbook.css ../doc/html
run copy "$BOOST"/doc/src/images/*.png ../doc/html/images
run copy "$BOOST"/doc/src/images/callouts/*.png ../doc/html/images/callouts
cd ../doc
run $BOOST/b2 -q $*
cd ../build

View file

@ -10,46 +10,26 @@
<property environment="env"/> <property environment="env"/>
<fail unless="env.BOOST_ROOT" message="missing BOOST_ROOT environment variable"/> <fail unless="env.BOOST_ROOT" message="missing BOOST_ROOT environment variable"/>
<property name="boost.dir" value="${env.BOOST_ROOT}"/> <property name="boost.dir" value="${env.BOOST_ROOT}"/>
<property name="include.dir" value="${env.BOOST_ROOT}"/>
<property name="src.dir" value="${root.dir}"/> <property name="src.dir" value="${root.dir}"/>
<property name="doc.dir" value="${src.dir}/doc"/> <property name="doc.dir" value="${src.dir}/doc"/>
<property name="tests.dir" value="${src.dir}/test"/>
<property name="libraries.dir" value="${src.dir}/include"/> <property name="libraries.dir" value="${src.dir}/include"/>
<property name="boostbook.dir" value="${out.dir}/boostbook"/> <property name="out.dir" value="${root.dir}/bin/poney/${platform}"/>
<property name="boost-mock.dir" value="${out.dir}/boost-mock"/> <property name="boost-mock.dir" value="${out.dir}/boost-mock"/>
<property name="version" value="unreleased"/> <property name="version" value="unreleased"/>
<import file="${env.PONEY_HOME}/poney.xml"/> <import file="${env.PONEY_HOME}/poney.xml"/>
<condition property="b2.toolset" value="--toolset=${boost.toolset}" else="">
<isset property="boost.toolset"/>
</condition>
<condition property="b2" value="b2.exe" else="b2">
<os family="windows"/>
</condition>
<presetdef name="b2">
<exec taskname="b2" failonerror="true" executable="${boost.dir}/${b2}">
<arg value="-q"/>
<arg value="${b2.toolset}"/>
</exec>
</presetdef>
<target name="reports" description="generate code analysis reports"> <target name="reports" description="generate code analysis reports">
<headers name="turtle" excludes="**/*_iterate.hpp,**/*_template.hpp"/> <headers name="turtle" excludes="**/*_iterate.hpp,**/*_template.hpp"/>
<check name="turtle"/> <check name="turtle"/>
</target> </target>
<target name="test" description="run tests"> <target name="build" description="build tests and documentation">
<b2 dir="${tests.dir}"/> <run dir="." script="build"/>
</target> </target>
<target name="documentation" depends="boost.generate" description="generate documentation"> <target name="release" depends="build" description="produce release packages">
<b2 dir="${boost-mock.dir}/doc">
<env key="BOOSTBOOK_DIR" value="${boostbook.dir}"/>
</b2>
</target>
<target name="release" depends="documentation" description="produce release packages">
<fail unless="version" message="missing version property"/> <fail unless="version" message="missing version property"/>
<copy file="version.hpp" tofile="${out.dir}/version.hpp"> <copy file="version.hpp" tofile="${out.dir}/version.hpp">
<filterset> <filterset>
@ -68,25 +48,13 @@
</tar> </tar>
</target> </target>
<target name="all" depends="test,reports,release" description="build and run tests then package distribution"/> <target name="all" depends="build,reports,release" description="build documentation, run tests and package distribution"/>
<target name="boost.generate" description="generate Boost.Mock"> <target name="boost.convert" description="convert Boost.Mock">
<delete dir="${boost-mock.dir}"/> <delete dir="${boost-mock.dir}"/>
<copy todir="${boost-mock.dir}" overwrite="true" preservelastmodified="true"> <copy todir="${boost-mock.dir}">
<fileset dir="${src.dir}" includes="LICENSE_1_0.txt,index.html,include/**,doc/**,test/**" excludes="**/bin/**"/> <fileset dir="${root.dir}"/>
</copy> </copy>
<copy todir="${boostbook.dir}">
<fileset dir="${boost.dir}/tools/boostbook" includes="xsl/**,dtd/**"/>
</copy>
<copy todir="${boostbook.dir}" overwrite="true">
<fileset dir="boostbook"/>
</copy>
<copy todir="${boost-mock.dir}/doc/html">
<fileset dir="${boost.dir}/doc/src" includes="**/boostbook.css,**/**.png"/>
</copy>
</target>
<target name="boost.convert" depends="boost.generate" description="convert Boost.Mock">
<move file="${boost-mock.dir}/include/turtle" tofile="${boost-mock.dir}/include/boost/mock"/> <move file="${boost-mock.dir}/include/turtle" tofile="${boost-mock.dir}/include/boost/mock"/>
<replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g"> <replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/> <fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
@ -135,17 +103,11 @@
</replaceregexp> </replaceregexp>
</target> </target>
<target name="boost.test" description="run Boost.Mock tests"> <target name="boost.build" depends="boost.convert" description="build Boost.Mock tests and documentation">
<b2 dir="${boost-mock.dir}/test"/> <run dir="${boost-mock.dir}/build" script="build"/>
</target> </target>
<target name="boost.documentation" depends="boost.generate" description="generate Boost.Mock documentation"> <target name="boost.package" depends="boost.build" description="package Boost.Mock">
<b2 dir="${boost-mock.dir}/doc">
<env key="BOOSTBOOK_DIR" value="${boostbook.dir}"/>
</b2>
</target>
<target name="boost.package" description="package Boost.Mock">
<zip destfile="${out.dir}/boost-mock.zip"> <zip destfile="${out.dir}/boost-mock.zip">
<fileset dir="${boost-mock.dir}" includes="libs/mock/**" excludes="**/bin/**"/> <fileset dir="${boost-mock.dir}" includes="libs/mock/**" excludes="**/bin/**"/>
<fileset dir="${boost-mock.dir}" includes="LICENSE_1_0.txt"/> <fileset dir="${boost-mock.dir}" includes="LICENSE_1_0.txt"/>
@ -156,6 +118,6 @@
</tar> </tar>
</target> </target>
<target name="boost" depends="boost.convert,boost.test,boost.documentation,boost.package" description="convert to boost with documentation and tests"/> <target name="boost" depends="boost.convert,boost.build,boost.package" description="convert to boost with documentation and tests"/>
</project> </project>

2
doc/html/.gitignore vendored
View file

@ -1,2 +1,4 @@
*.css
*.html *.html
*.png
standalone_HTML.manifest standalone_HTML.manifest