mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Moved part of the build out of build.xml
This commit is contained in:
parent
d424d4ee7f
commit
2a34194231
6 changed files with 104 additions and 64 deletions
24
.travis.yml
24
.travis.yml
|
|
@ -45,38 +45,38 @@ before_install:
|
|||
- git submodule foreach "git reset --quiet --hard; git clean -fxd"
|
||||
- git reset --hard; git clean -fxd
|
||||
- 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
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- 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
|
||||
- ../../../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:
|
||||
- COVERALS_DIR=$PROJECT_DIR/coverals
|
||||
|
||||
# Copying Coveralls data to a separate folder
|
||||
- mkdir -p $PROJECT_DIR/coverals
|
||||
- find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $PROJECT_DIR/coverals/ \;
|
||||
- find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $PROJECT_DIR/coverals/ \;
|
||||
- mkdir -p $COVERALS_DIR
|
||||
- find ../test/bin/ -name "*.gcda" -exec cp "{}" $COVERALS_DIR/ \;
|
||||
- find ../test/bin/ -name "*.gcno" -exec cp "{}" $COVERALS_DIR/ \;
|
||||
|
||||
# Preparing Coveralls data by
|
||||
# ... installing the tools
|
||||
- sudo apt-get install -qq python-yaml lcov
|
||||
# ... 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
|
||||
- cd $BOOST
|
||||
- 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
|
||||
- lcov --remove $COVERALS_DIR/coverage.info "/usr*" "/test/*" $IGNORE_COVERAGE "tests/*" "*/doc/examples/*" -o $COVERALS_DIR/coverage.info
|
||||
|
||||
# ... 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'`
|
||||
- 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
|
||||
- cd $PROJECT_DIR
|
||||
|
|
|
|||
37
build/build.bat
Normal file
37
build/build.bat
Normal 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
|
||||
|
|
@ -1 +1 @@
|
|||
extensions = headers,check
|
||||
extensions = headers,check,run
|
||||
|
|
|
|||
39
build/build.sh
Normal file
39
build/build.sh
Normal 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
|
||||
|
|
@ -10,46 +10,26 @@
|
|||
<property environment="env"/>
|
||||
<fail unless="env.BOOST_ROOT" message="missing BOOST_ROOT environment variable"/>
|
||||
<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="doc.dir" value="${src.dir}/doc"/>
|
||||
<property name="tests.dir" value="${src.dir}/test"/>
|
||||
<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="version" value="unreleased"/>
|
||||
|
||||
<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">
|
||||
<headers name="turtle" excludes="**/*_iterate.hpp,**/*_template.hpp"/>
|
||||
<check name="turtle"/>
|
||||
</target>
|
||||
|
||||
<target name="test" description="run tests">
|
||||
<b2 dir="${tests.dir}"/>
|
||||
<target name="build" description="build tests and documentation">
|
||||
<run dir="." script="build"/>
|
||||
</target>
|
||||
|
||||
<target name="documentation" depends="boost.generate" description="generate documentation">
|
||||
<b2 dir="${boost-mock.dir}/doc">
|
||||
<env key="BOOSTBOOK_DIR" value="${boostbook.dir}"/>
|
||||
</b2>
|
||||
</target>
|
||||
|
||||
<target name="release" depends="documentation" description="produce release packages">
|
||||
<target name="release" depends="build" description="produce release packages">
|
||||
<fail unless="version" message="missing version property"/>
|
||||
<copy file="version.hpp" tofile="${out.dir}/version.hpp">
|
||||
<filterset>
|
||||
|
|
@ -68,25 +48,13 @@
|
|||
</tar>
|
||||
</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}"/>
|
||||
<copy todir="${boost-mock.dir}" overwrite="true" preservelastmodified="true">
|
||||
<fileset dir="${src.dir}" includes="LICENSE_1_0.txt,index.html,include/**,doc/**,test/**" excludes="**/bin/**"/>
|
||||
<copy todir="${boost-mock.dir}">
|
||||
<fileset dir="${root.dir}"/>
|
||||
</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"/>
|
||||
<replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g">
|
||||
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
|
||||
|
|
@ -135,17 +103,11 @@
|
|||
</replaceregexp>
|
||||
</target>
|
||||
|
||||
<target name="boost.test" description="run Boost.Mock tests">
|
||||
<b2 dir="${boost-mock.dir}/test"/>
|
||||
<target name="boost.build" depends="boost.convert" description="build Boost.Mock tests and documentation">
|
||||
<run dir="${boost-mock.dir}/build" script="build"/>
|
||||
</target>
|
||||
|
||||
<target name="boost.documentation" depends="boost.generate" description="generate Boost.Mock documentation">
|
||||
<b2 dir="${boost-mock.dir}/doc">
|
||||
<env key="BOOSTBOOK_DIR" value="${boostbook.dir}"/>
|
||||
</b2>
|
||||
</target>
|
||||
|
||||
<target name="boost.package" description="package Boost.Mock">
|
||||
<target name="boost.package" depends="boost.build" description="package Boost.Mock">
|
||||
<zip destfile="${out.dir}/boost-mock.zip">
|
||||
<fileset dir="${boost-mock.dir}" includes="libs/mock/**" excludes="**/bin/**"/>
|
||||
<fileset dir="${boost-mock.dir}" includes="LICENSE_1_0.txt"/>
|
||||
|
|
@ -156,6 +118,6 @@
|
|||
</tar>
|
||||
</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>
|
||||
|
|
|
|||
2
doc/html/.gitignore
vendored
2
doc/html/.gitignore
vendored
|
|
@ -1,2 +1,4 @@
|
|||
*.css
|
||||
*.html
|
||||
*.png
|
||||
standalone_HTML.manifest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue