Clean and remove build directory

Move scripts into scripts folder
Move doc-stuff into docs
Update CI & CMake scripts

See #89
This commit is contained in:
Alexander Grund 2020-07-16 12:52:45 +02:00
parent 3d44f9bfda
commit 32d16f773b
No known key found for this signature in database
GPG key ID: E92C451FC21EF13F
13 changed files with 9 additions and 151 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
.vscode
bin
out
build/xsl
/build
__build

View file

@ -71,10 +71,10 @@ script:
- cd $PROJECT_DIR
- export BOOST_ROOT=$BOOST
# `--coverage` flags required to generate coverage info for Coveralls
- build/build.sh --toolset=$CC "cxxflags=-std=c++$CXX_STANDARD -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations --coverage" "linkflags=--coverage" -j3
- scripts/build.sh --toolset=$CC "cxxflags=-std=c++$CXX_STANDARD -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations --coverage" "linkflags=--coverage" -j3
# CMake build
- cd $BOOST && ./b2 --with-test --with-thread --with-chrono --with-system --with-atomic --with-date_time -a -j3 # Build required libs
- mkdir $PROJECT_DIR/__build && cd $PROJECT_DIR/__build
- mkdir $PROJECT_DIR/build && cd $PROJECT_DIR/build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-std=c++$CXX_STANDARD"
- cmake --build . --config Debug -- -j3
- ctest --output-on-failure --build-config Debug

View file

@ -22,7 +22,7 @@ endif()
find_package(Boost 1.58 REQUIRED)
set(MOCK_VERSION "\"${PROJECT_VERSION}\"")
configure_file(build/version.hpp ${CMAKE_CURRENT_BINARY_DIR}/include/turtle/version.hpp @ONLY)
configure_file(version.hpp.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/turtle/version.hpp @ONLY)
add_library(turtle INTERFACE)
add_library(turtle::turtle ALIAS turtle)

View file

@ -53,7 +53,7 @@ build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxflags=/std:c++%CXX_STANDARD%
- set BUILD_ARGS=address-model=32,64 variant=debug,release
- call build\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3
- call scripts\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3
for:
- matrix:
@ -62,8 +62,7 @@ for:
build_script:
- set BOOST_ROOT=C:\Libraries\boost_%BOOST%
- cd %APPVEYOR_BUILD_FOLDER%
- mkdir __build
- cd __build
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=Debug
- cmake --build . --config Debug
- ctest --output-on-failure --build-config Debug

View file

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

View file

@ -1,115 +0,0 @@
<!--
Copyright Mathieu Champlon 2008.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<project name="turtle" default="all">
<property environment="env"/>
<fail unless="env.BOOST_ROOT" message="missing BOOST_ROOT environment variable"/>
<property name="boost.dir" value="${env.BOOST_ROOT}"/>
<property name="src.dir" value="${root.dir}"/>
<property name="doc.dir" value="${src.dir}/doc"/>
<property name="libraries.dir" value="${src.dir}/include"/>
<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"/>
<target name="package" depends="build" description="produce release packages">
<fail unless="version" message="missing version property"/>
<copy file="version.hpp" tofile="${out.dir}/version.hpp" overwrite="true">
<filterset>
<filter token="MOCK_VERSION" value="${version}"/>
</filterset>
</copy>
<mkdir dir="${dist.dir}"/>
<zip destfile="${dist.dir}/${ant.project.name}-${version}.zip">
<fileset dir="${src.dir}" includes="include/**"/>
<zipfileset dir="${doc.dir}/html" prefix="doc"/>
<zipfileset dir="${out.dir}" includes="version.hpp" prefix="include/turtle"/>
</zip>
<tar destfile="${dist.dir}/${ant.project.name}-${version}.tar.bz2" compression="bzip2">
<fileset dir="${src.dir}" includes="include/**"/>
<zipfileset dir="${doc.dir}/html" prefix="doc"/>
<zipfileset dir="${out.dir}" includes="version.hpp" prefix="include/turtle"/>
</tar>
</target>
<target name="all" depends="build,reports,package" description="build documentation, run tests and package distribution"/>
<target name="boost.convert" description="convert Boost.Mock">
<delete dir="${boost-mock.dir}"/>
<copy todir="${boost-mock.dir}">
<fileset dir="${root.dir}" excludes="bin/**"/>
</copy>
<move file="${boost-mock.dir}/include/turtle" tofile="${boost-mock.dir}/include/boost/mock"/>
<delete dir="${boost-mock.dir}/doc/html/turtle"/>
<replaceregexp match="MOCK" replace="BOOST_MOCK" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="BOOST_MOCK_BOOST_MOCK" replace="BOOST_MOCK" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match='"([^"]+\.hpp)"' replace="&lt;boost/mock/\1&gt;" flags="g">
<fileset dir="${boost-mock.dir}/include" includes="**/*.hpp" excludes="**/detail/*.hpp"/>
</replaceregexp>
<replaceregexp match='"\.\./([^"]+\.hpp)"' replace="&lt;boost/mock/\1&gt;" flags="g">
<fileset dir="${boost-mock.dir}/include" includes="**/*.hpp"/>
</replaceregexp>
<replaceregexp match='"([^"]+\.hpp)"' replace="&lt;boost/mock/detail/\1&gt;" flags="g">
<fileset dir="${boost-mock.dir}/include" includes="**/detail/*.hpp"/>
</replaceregexp>
<replaceregexp match="&lt;turtle/([^&gt;]+)" replace="&lt;boost/mock/\1" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="(namespace mock)" replace="namespace boost${line.separator}{${line.separator}\1" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="} // mock" replace="}${line.separator}}" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp"/>
</replaceregexp>
<replaceregexp match=" mock::" replace=" boost::mock::" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="^mock::" replace="boost::mock::" flags="m">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp,**/*.qbk"/>
</replaceregexp>
<replaceregexp match="http://turtle.sourceforge.net" replace="Boost.Mock" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.cpp,**/*.hpp"/>
</replaceregexp>
<replaceregexp match="reference.helpers." replace="reference.helpers.boost_" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.qbk"/>
</replaceregexp>
<replaceregexp match="turtle." replace="boost_mock." flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.qbk"/>
</replaceregexp>
<replaceregexp match="Turtle" replace="Boost.Mock" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/*.qbk"/>
</replaceregexp>
<replaceregexp match="\[include changelog.qbk\]" replace="" flags="g">
<fileset dir="${boost-mock.dir}" includes="**/mock.qbk"/>
</replaceregexp>
</target>
<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.package" depends="boost.build" description="package Boost.Mock">
<fail unless="version" message="missing version property"/>
<zip destfile="${dist.dir}/boost-mock-${version}.zip">
<fileset dir="${boost-mock.dir}" includes="include/**,test/**,doc/**" excludes="**/bin/**"/>
<fileset dir="${boost-mock.dir}" includes="LICENSE_1_0.txt,index.html"/>
</zip>
<tar destfile="${dist.dir}/boost-mock-${version}.tar.bz2" compression="bzip2">
<fileset dir="${boost-mock.dir}" includes="include/**,test/**,doc/**" excludes="**/bin/**"/>
<fileset dir="${boost-mock.dir}" includes="LICENSE_1_0.txt,index.html"/>
</tar>
</target>
<target name="boost" depends="boost.convert,boost.build,boost.package" description="convert and package to boost with documentation and tests"/>
</project>

View file

@ -1,17 +0,0 @@
# $ docker build --platform=linux -f clang/Dockerfile -t turtle-clang .
FROM buildpack-deps:stretch
RUN apt-get update && apt-get install -y xsltproc docbook-xsl docbook-xml && apt-get autoremove && apt-get clean
ENV DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl \
DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 \
BOOST_ROOT=/home/dev/cpp/boost/
# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add - && \
RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --allow-unauthenticated clang-5.0 lld-5.0 libc++1 && \
apt-get autoremove && \
apt-get clean && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 100 && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 100
RUN echo 'cd /home/dev/cpp/turtle/build' >> ~/.bashrc
# $ docker run --platform=linux --rm -v C:/dev:/home/dev -m 32g -it turtle-clang
# ./build.sh --toolset=clang "cxxflags=-std=c++17 -stdlib=libc++ -Wno-unused-variable"

View file

@ -1,9 +0,0 @@
# $ docker build -f Dockerfile -t turtle-gcc .
FROM gcc
RUN apt-get update && apt-get install -y xsltproc docbook-xsl docbook-xml && apt-get autoremove && apt-get clean
ENV DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl \
DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 \
BOOST_ROOT=/home/dev/cpp/boost/
RUN echo 'cd /home/dev/cpp/turtle/build' >> ~/.bashrc
# $ docker run --platform=linux --rm -v C:/dev:/home/dev -m 16g -it turtle-gcc
# ./build.sh --toolset=gcc "cxxflags=-std=c++17 -Wno-noexcept-type -Wno-unused-variable -Wno-unused-function -Wno-deprecated-declarations"

View file

@ -19,7 +19,7 @@ cd %PROJECT_DIR%
set BOOSTBOOK_DIR=%PROJECT_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 build\boostbook %BOOSTBOOK_DIR%
xcopy /Y /S /Q /I doc\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

View file

@ -22,7 +22,7 @@ PROJECT_DIR="${PROJECT_DIR:-$(pwd)}"
export BOOSTBOOK_DIR="${PROJECT_DIR}/bin/turtle/boostbook"
copy -r "$BOOST_ROOT"/tools/boostbook/xsl "$BOOSTBOOK_DIR"
copy -r "$BOOST_ROOT"/tools/boostbook/dtd "$BOOSTBOOK_DIR"
copy -r build/boostbook/* "$BOOSTBOOK_DIR"
copy -r doc/boostbook/* "$BOOSTBOOK_DIR"
copy "$BOOST_ROOT"/doc/src/boostbook.css doc/html
copy "$BOOST_ROOT"/doc/src/images/*.png doc/html/images
copy "$BOOST_ROOT"/doc/src/images/callouts/*.png doc/html/images/callouts

View file

@ -7,3 +7,4 @@
// http://www.boost.org/LICENSE_1_0.txt)
#define MOCK_VERSION @MOCK_VERSION@
#define TURTLE_VERSION "@turtle_VERSION@"