From 32d16f773ba535f80a39d4c7a14661afff71d6f2 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 16 Jul 2020 12:52:45 +0200 Subject: [PATCH] Clean and remove build directory Move scripts into scripts folder Move doc-stuff into docs Update CI & CMake scripts See #89 --- .gitignore | 2 +- .travis.yml | 4 +- CMakeLists.txt | 2 +- appveyor.yml | 5 +- build/build.properties | 1 - build/build.xml | 115 ------------------------ build/clang/Dockerfile | 17 ---- build/gcc/Dockerfile | 9 -- {build => doc}/boostbook/xsl/navbar.xsl | 0 {build => scripts}/build.bat | 2 +- {build => scripts}/build.sh | 0 scripts/build_doc.sh | 2 +- build/version.hpp => version.hpp.cmake | 1 + 13 files changed, 9 insertions(+), 151 deletions(-) delete mode 100644 build/build.properties delete mode 100644 build/build.xml delete mode 100644 build/clang/Dockerfile delete mode 100644 build/gcc/Dockerfile rename {build => doc}/boostbook/xsl/navbar.xsl (100%) rename {build => scripts}/build.bat (94%) rename {build => scripts}/build.sh (100%) rename build/version.hpp => version.hpp.cmake (83%) diff --git a/.gitignore b/.gitignore index 534e0e9..f094525 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .vscode bin out -build/xsl +/build __build diff --git a/.travis.yml b/.travis.yml index 2ce871f..097c9f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index c372908..58b6828 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/appveyor.yml b/appveyor.yml index 1ca3551..7ebd82e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/build/build.properties b/build/build.properties deleted file mode 100644 index 623180f..0000000 --- a/build/build.properties +++ /dev/null @@ -1 +0,0 @@ -extensions = headers,check,run diff --git a/build/build.xml b/build/build.xml deleted file mode 100644 index b2201f8..0000000 --- a/build/build.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/clang/Dockerfile b/build/clang/Dockerfile deleted file mode 100644 index fd3a65b..0000000 --- a/build/clang/Dockerfile +++ /dev/null @@ -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" diff --git a/build/gcc/Dockerfile b/build/gcc/Dockerfile deleted file mode 100644 index 5d1a4d8..0000000 --- a/build/gcc/Dockerfile +++ /dev/null @@ -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" diff --git a/build/boostbook/xsl/navbar.xsl b/doc/boostbook/xsl/navbar.xsl similarity index 100% rename from build/boostbook/xsl/navbar.xsl rename to doc/boostbook/xsl/navbar.xsl diff --git a/build/build.bat b/scripts/build.bat similarity index 94% rename from build/build.bat rename to scripts/build.bat index 261831c..0e2e38a 100644 --- a/build/build.bat +++ b/scripts/build.bat @@ -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 diff --git a/build/build.sh b/scripts/build.sh similarity index 100% rename from build/build.sh rename to scripts/build.sh diff --git a/scripts/build_doc.sh b/scripts/build_doc.sh index d0e4830..42af832 100755 --- a/scripts/build_doc.sh +++ b/scripts/build_doc.sh @@ -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 diff --git a/build/version.hpp b/version.hpp.cmake similarity index 83% rename from build/version.hpp rename to version.hpp.cmake index 2dfeecc..d9c8a24 100644 --- a/build/version.hpp +++ b/version.hpp.cmake @@ -7,3 +7,4 @@ // http://www.boost.org/LICENSE_1_0.txt) #define MOCK_VERSION @MOCK_VERSION@ +#define TURTLE_VERSION "@turtle_VERSION@"