From 7c66eb9cee1e24e1c4844f87b869aecba239c85d Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 02:27:50 -0800 Subject: [PATCH 01/10] Added sphinx documentation --- docs/source/conf.py | 55 +++++++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 20 ++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..1d0fa0f1 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,55 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'BuildCC' +copyright = '2021, Niket Naidu' +author = 'Niket Naidu' + +# The full version, including alpha/beta/rc tags +release = '0.1.1' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'furo' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..98bd5844 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,20 @@ +.. BuildCC documentation master file, created by + sphinx-quickstart on Sun Dec 19 02:26:23 2021. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to BuildCC's documentation! +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From 4a225e0d0c47e42537397842f8c2837c994c3053 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 02:49:43 -0800 Subject: [PATCH 02/10] Update doxygen.cmake --- cmake/tool/doxygen.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cmake/tool/doxygen.cmake b/cmake/tool/doxygen.cmake index 82401577..174f830c 100644 --- a/cmake/tool/doxygen.cmake +++ b/cmake/tool/doxygen.cmake @@ -9,15 +9,16 @@ if (${BUILDCC_DOCUMENTATION}) *test/* *mock/* ) - set(DOXYGEN_BUILTIN_STL_SUPPORT YES) + # set(DOXYGEN_BUILTIN_STL_SUPPORT YES) set(DOXYGEN_EXTRACT_ALL YES) - set(DOXYGEN_MARKDOWN_SUPPORT YES) - set(DOXYGEN_WARN_IF_UNDOCUMENTED NO) - set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${CMAKE_CURRENT_SOURCE_DIR}/README.md) + # set(DOXYGEN_MARKDOWN_SUPPORT YES) + set(DOXYGEN_WARN_IF_UNDOCUMENTED YES) + # set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${CMAKE_CURRENT_SOURCE_DIR}/README.md) + set(DOXYGEN_GENERATE_XML YES) doxygen_add_docs(doxygen_documentation - ${CMAKE_CURRENT_SOURCE_DIR}/README.md - ${CMAKE_CURRENT_SOURCE_DIR}/TODO.md - ${CMAKE_CURRENT_SOURCE_DIR}/example/README.md + # ${CMAKE_CURRENT_SOURCE_DIR}/README.md + # ${CMAKE_CURRENT_SOURCE_DIR}/TODO.md + # ${CMAKE_CURRENT_SOURCE_DIR}/example/README.md ${CMAKE_CURRENT_SOURCE_DIR}/buildcc COMMENT "Doxygen documentation" ) From 9fcc16b8678290ef94075327e82e53e6df6fdce5 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 03:28:10 -0800 Subject: [PATCH 03/10] Update doxygen.cmake --- cmake/tool/doxygen.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cmake/tool/doxygen.cmake b/cmake/tool/doxygen.cmake index 174f830c..d5f8d380 100644 --- a/cmake/tool/doxygen.cmake +++ b/cmake/tool/doxygen.cmake @@ -9,17 +9,21 @@ if (${BUILDCC_DOCUMENTATION}) *test/* *mock/* ) - # set(DOXYGEN_BUILTIN_STL_SUPPORT YES) set(DOXYGEN_EXTRACT_ALL YES) - # set(DOXYGEN_MARKDOWN_SUPPORT YES) set(DOXYGEN_WARN_IF_UNDOCUMENTED YES) - # set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${CMAKE_CURRENT_SOURCE_DIR}/README.md) set(DOXYGEN_GENERATE_XML YES) doxygen_add_docs(doxygen_documentation - # ${CMAKE_CURRENT_SOURCE_DIR}/README.md - # ${CMAKE_CURRENT_SOURCE_DIR}/TODO.md - # ${CMAKE_CURRENT_SOURCE_DIR}/example/README.md ${CMAKE_CURRENT_SOURCE_DIR}/buildcc COMMENT "Doxygen documentation" ) + + find_program(sphinx_build + NAMES "sphinx-build" + REQUIRED + ) + add_custom_target(sphinx_documentation + COMMAND ${sphinx_build} -b html -Dbreathe_projects.cpp_sphinx_documentation=${CMAKE_CURRENT_BINARY_DIR}/xml . ../output + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/source + VERBATIM USES_TERMINAL + ) endif() From 9f00c54276efdb6844b87a0b26e8e09fb00bd7c4 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 03:28:13 -0800 Subject: [PATCH 04/10] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 92ed69eb..3394fcf1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ _deps .vs/ .idea/ .cache/ +docs/output # Files *.gcov From 0f8b514bdedb03d5ee617d151afa6cfd42dcb2c5 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 06:32:22 -0800 Subject: [PATCH 05/10] Updated sphinx and conf with default_project options --- cmake/tool/doxygen.cmake | 2 +- docs/source/conf.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/tool/doxygen.cmake b/cmake/tool/doxygen.cmake index d5f8d380..ead0bb12 100644 --- a/cmake/tool/doxygen.cmake +++ b/cmake/tool/doxygen.cmake @@ -22,7 +22,7 @@ if (${BUILDCC_DOCUMENTATION}) REQUIRED ) add_custom_target(sphinx_documentation - COMMAND ${sphinx_build} -b html -Dbreathe_projects.cpp_sphinx_documentation=${CMAKE_CURRENT_BINARY_DIR}/xml . ../output + COMMAND ${sphinx_build} -b html -Dbreathe_projects.buildcc_documentation=${CMAKE_CURRENT_BINARY_DIR}/xml . ../output WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/source VERBATIM USES_TERMINAL ) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1d0fa0f1..cc559fbc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -31,8 +31,12 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + "breathe" ] +breathe_default_project = "buildcc_documentation" +breathe_default_members = ("members", "undoc-members") + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] From bdf542baa47aa8097d21142e5c4224251b5f9493 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 06:46:32 -0800 Subject: [PATCH 06/10] Added User API page --- docs/source/index.rst | 4 +++- docs/source/page/user_api.rst | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 docs/source/page/user_api.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index 98bd5844..faf1ce20 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,7 +8,9 @@ Welcome to BuildCC's documentation! .. toctree:: :maxdepth: 2 - :caption: Contents: + :caption: Contents + + page/user_api diff --git a/docs/source/page/user_api.rst b/docs/source/page/user_api.rst new file mode 100644 index 00000000..9aed15ee --- /dev/null +++ b/docs/source/page/user_api.rst @@ -0,0 +1,33 @@ +********* +User API +********* + +Environment +=========== + +Toolchain +========= + +Generator +========= + +TargetInfo +========== + +Target +======= + +Toolchain specialized +===================== + +Target specialized +================== + +Args +==== + +Register +======== + +First Party Plugins +=================== From d731f62c74ab07bcfd1b6f313c343aab6e813c3c Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 07:21:28 -0800 Subject: [PATCH 07/10] Added Architecture topics --- docs/source/arch/design_patterns.rst | 2 ++ docs/source/arch/namespaces.rst | 2 ++ docs/source/arch/outputs.rst | 2 ++ docs/source/arch/project_layout.rst | 2 ++ docs/source/arch/software_heirarchy.rst | 2 ++ docs/source/arch/testing.rst | 2 ++ docs/source/index.rst | 8 ++++++++ 7 files changed, 20 insertions(+) create mode 100644 docs/source/arch/design_patterns.rst create mode 100644 docs/source/arch/namespaces.rst create mode 100644 docs/source/arch/outputs.rst create mode 100644 docs/source/arch/project_layout.rst create mode 100644 docs/source/arch/software_heirarchy.rst create mode 100644 docs/source/arch/testing.rst diff --git a/docs/source/arch/design_patterns.rst b/docs/source/arch/design_patterns.rst new file mode 100644 index 00000000..d8c48a46 --- /dev/null +++ b/docs/source/arch/design_patterns.rst @@ -0,0 +1,2 @@ +Design Patterns +=============== diff --git a/docs/source/arch/namespaces.rst b/docs/source/arch/namespaces.rst new file mode 100644 index 00000000..76d5098a --- /dev/null +++ b/docs/source/arch/namespaces.rst @@ -0,0 +1,2 @@ +Namespaces +========== diff --git a/docs/source/arch/outputs.rst b/docs/source/arch/outputs.rst new file mode 100644 index 00000000..4286020c --- /dev/null +++ b/docs/source/arch/outputs.rst @@ -0,0 +1,2 @@ +Outputs +======= diff --git a/docs/source/arch/project_layout.rst b/docs/source/arch/project_layout.rst new file mode 100644 index 00000000..9e0223cf --- /dev/null +++ b/docs/source/arch/project_layout.rst @@ -0,0 +1,2 @@ +Project Layout +============== diff --git a/docs/source/arch/software_heirarchy.rst b/docs/source/arch/software_heirarchy.rst new file mode 100644 index 00000000..c527510a --- /dev/null +++ b/docs/source/arch/software_heirarchy.rst @@ -0,0 +1,2 @@ +Software Heirarchy +================== diff --git a/docs/source/arch/testing.rst b/docs/source/arch/testing.rst new file mode 100644 index 00000000..96994bb8 --- /dev/null +++ b/docs/source/arch/testing.rst @@ -0,0 +1,2 @@ +Testing +======= diff --git a/docs/source/index.rst b/docs/source/index.rst index faf1ce20..2df0d915 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -12,7 +12,15 @@ Welcome to BuildCC's documentation! page/user_api +.. toctree:: + :caption: Architecture + arch/project_layout + arch/software_heirarchy + arch/namespaces + arch/design_patterns + arch/testing + arch/outputs Indices and tables ================== From c0032014321077f934a5dbea739a85bd4d077a3e Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 08:15:34 -0800 Subject: [PATCH 08/10] Update user_api.rst --- docs/source/page/user_api.rst | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/docs/source/page/user_api.rst b/docs/source/page/user_api.rst index 9aed15ee..590e1e52 100644 --- a/docs/source/page/user_api.rst +++ b/docs/source/page/user_api.rst @@ -5,29 +5,102 @@ User API Environment =========== +env.h +----- + +.. doxygenfunction:: is_init + +.. doxygenfunction:: get_project_root_dir + +.. doxygenfunction:: get_project_build_dir + +logging.h +--------- + +.. doxygenfunction:: log_trace + +.. doxygenfunction:: log_debug + +.. doxygenfunction:: log_info + +.. doxygenfunction:: log_warning + +.. doxygenfunction:: log_critical + +assert_fatal.h +-------------- + +assert_throw.h +-------------- + +command.h +--------- + Toolchain ========= +toolchain.h +------------ + +toolchain_verify.h +------------------ + Generator ========= +generator.h +----------- + TargetInfo ========== +target_info.h +-------------- + Target ======= +target.h +--------- + Toolchain specialized ===================== +toolchain_gcc.h +---------------- + +toolchain_msvc.h +----------------- + Target specialized ================== +target_custom.h +--------------- + +target_gcc.h +------------- + +target_msvc.h +------------- + +target_generic.h +----------------- + Args ==== +args.h +------- + Register ======== +register.h +----------- + First Party Plugins =================== + +clang_compile_commands.h +------------------------ From 6ed508a2a6521030d8bb5dfb98a5c92502212ac0 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 08:33:50 -0800 Subject: [PATCH 09/10] Create pages.yml --- .github/workflows/pages.yml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..af5b39a2 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,47 @@ +name: github pages + +on: + push: + branches: + - main # Set a branch name to trigger deployment + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + deploy: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Setup + run: | + sudo apt-get install ninja-build doxygen graphviz python3-sphinx + pip install breathe sphinx_rtd_theme furo + + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}} + run: | + cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILDCC_DOCUMENTATION=ON + + - name: Build + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build --config $BUILD_TYPE + + - name: Doxygen + Sphinx + working-directory: ${{github.workspace}}/build + shell: bash + run: | + cmake --build . --target doxygen_documentation + cmake --build . --target sphinx_documentation + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/output From 867a480dd286fd23a4de7e522a7c89e7530d7c90 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sun, 19 Dec 2021 09:31:45 -0800 Subject: [PATCH 10/10] Update CMakePresets.json --- CMakePresets.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 55023307..68fb595c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -27,7 +27,7 @@ "BUILDCC_TESTING": true, "BUILDCC_CLANGTIDY": true, "BUILDCC_CPPCHECK": true, - "BUILDCC_DOCUMENTATION": true, + "BUILDCC_DOCUMENTATION": false, "BUILDCC_NO_DEPRECATED": false } }, @@ -52,7 +52,7 @@ "BUILDCC_TESTING": true, "BUILDCC_CLANGTIDY": true, "BUILDCC_CPPCHECK": true, - "BUILDCC_DOCUMENTATION": true, + "BUILDCC_DOCUMENTATION": false, "BUILDCC_NO_DEPRECATED": false } }, @@ -77,7 +77,7 @@ "BUILDCC_TESTING": true, "BUILDCC_CLANGTIDY": true, "BUILDCC_CPPCHECK": true, - "BUILDCC_DOCUMENTATION": true, + "BUILDCC_DOCUMENTATION": false, "BUILDCC_NO_DEPRECATED": false } },