From 2a34194231cef56071e81f07b194312d0fd8a5fe Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sat, 7 Mar 2015 19:04:48 +0100 Subject: [PATCH] Moved part of the build out of build.xml --- .travis.yml | 24 ++++++++-------- build/build.bat | 37 ++++++++++++++++++++++++ build/build.properties | 2 +- build/build.sh | 39 +++++++++++++++++++++++++ build/build.xml | 64 +++++++++--------------------------------- doc/html/.gitignore | 2 ++ 6 files changed, 104 insertions(+), 64 deletions(-) create mode 100644 build/build.bat create mode 100644 build/build.sh diff --git a/.travis.yml b/.travis.yml index 0c6115f..599095a 100644 --- a/.travis.yml +++ b/.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 diff --git a/build/build.bat b/build/build.bat new file mode 100644 index 0000000..e747db4 --- /dev/null +++ b/build/build.bat @@ -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 \ No newline at end of file diff --git a/build/build.properties b/build/build.properties index 9324819..623180f 100644 --- a/build/build.properties +++ b/build/build.properties @@ -1 +1 @@ -extensions = headers,check +extensions = headers,check,run diff --git a/build/build.sh b/build/build.sh new file mode 100644 index 0000000..1f6f8b4 --- /dev/null +++ b/build/build.sh @@ -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 diff --git a/build/build.xml b/build/build.xml index 86465d1..dceaa60 100644 --- a/build/build.xml +++ b/build/build.xml @@ -10,46 +10,26 @@ - - - + + - - - - - - - - - - - - - - - + + - - - - - - - + @@ -68,25 +48,13 @@ - + - + - - + + - - - - - - - - - - - - @@ -135,17 +103,11 @@ - - + + - - - - - - - + @@ -156,6 +118,6 @@ - + diff --git a/doc/html/.gitignore b/doc/html/.gitignore index 6660434..df8a062 100644 --- a/doc/html/.gitignore +++ b/doc/html/.gitignore @@ -1,2 +1,4 @@ +*.css *.html +*.png standalone_HTML.manifest