From 41c801f3b01009025e0be81a9817e73f87e896d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 30 Sep 2019 14:20:35 +0900 Subject: [PATCH] [cmd] Move doxygen command (#7821) Move doxygen command from nnfw to nnas Use user-setting workspace for docygen output Add document for help Signed-off-by: Hyeongseok Oh --- .gitignore | 2 +- docs/UseDoxygen.md | 36 ++++++++++++++++++++++++++++++++++++ infra/command/doxygen | 18 ++++++++++++++++++ infra/{nnfw => }/doxygen/Doxyfile | 13 ++++++------- infra/nnfw/command/doxygen | 7 ------- 5 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 docs/UseDoxygen.md create mode 100644 infra/command/doxygen rename infra/{nnfw => }/doxygen/Doxyfile (99%) delete mode 100644 infra/nnfw/command/doxygen diff --git a/.gitignore b/.gitignore index 5a52860..32c3360 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ /report # doxygen -/docs/doxygen/html +/doxygen # Generated by format checker /format.patch diff --git a/docs/UseDoxygen.md b/docs/UseDoxygen.md new file mode 100644 index 0000000..1b016c0 --- /dev/null +++ b/docs/UseDoxygen.md @@ -0,0 +1,36 @@ +# How to generate documentation from source code using doxygen + +## Install doxygen + +If you want to use doxygen to generate documentation on Ubuntu, please install packages + +``` +$ sudo apt install doxygen +``` + +## Generate documentation + +### Pre-defined configuration + +You can find pre-defined configuration at `infra/doxygen/Doxyfile` + +### Option 1: Use pre-defined configuration + +You can use pre-defined configuration directly at nnas's root path + +``` +$ doxygen infra/doxygen/Doxyfile +``` + +Generated documentation html is in `doxygen/html` + +### Option 2: Use nnas command (recommand) + +You can use nnas command `doxygen` + +``` +$ /nnas doxygen +``` + +Generated documentation html is in your workspace directory: `/doxygen/html` +Default workspace directory is `build` diff --git a/infra/command/doxygen b/infra/command/doxygen new file mode 100644 index 0000000..e02d3b0 --- /dev/null +++ b/infra/command/doxygen @@ -0,0 +1,18 @@ +#!/bin/bash + +import "build.configuration" + +pushd ${NNAS_PROJECT_PATH} > /dev/null + +# Modify Doxyfile for custom config +# OUTPUT_DIRECTORY: Use workspace for doxygen html storage +# Generated html is in ${NNAS_PROJECT_PATH}/${BUILD_WORKSPACE_RPATH}/doxygen/html/ +# EXCLUDE: Exclude custom workspace +mkdir -p ${BUILD_WORKSPACE_RPATH}/doxygen +cp infra/doxygen/Doxyfile ${BUILD_WORKSPACE_RPATH}/doxygen/Doxyfile +echo "OUTPUT_DIRECTORY = ${BUILD_WORKSPACE_RPATH}/doxygen" >> ${BUILD_WORKSPACE_RPATH}/doxygen/Doxyfile +echo "EXCLUDE += ${BUILD_WORKSPACE_RPATH}" >> ${BUILD_WORKSPACE_RPATH}/doxygen/Doxyfile + +doxygen ${BUILD_WORKSPACE_RPATH}/doxygen/Doxyfile + +popd > /dev/null diff --git a/infra/nnfw/doxygen/Doxyfile b/infra/doxygen/Doxyfile similarity index 99% rename from infra/nnfw/doxygen/Doxyfile rename to infra/doxygen/Doxyfile index c04a7bb..c082a1b 100644 --- a/infra/nnfw/doxygen/Doxyfile +++ b/infra/doxygen/Doxyfile @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = nnfw +PROJECT_NAME = nnas # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = docs/doxygen +OUTPUT_DIRECTORY = doxygen # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -874,15 +874,14 @@ RECURSIVE = YES # run. EXCLUDE = Product/ \ + build/ \ + doxygen/ \ report/ \ - runtimes/contrib/ \ - docs/doxygen/html/ \ externals/ \ packaging/ \ + runtimes/contrib/ \ runtimes/pure_arm_compute/ \ - tests/framework/ \ - tests/nnapi/src/generated/ \ - tests/nnapi/specs/ \ + tests/ \ tools/ # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or diff --git a/infra/nnfw/command/doxygen b/infra/nnfw/command/doxygen deleted file mode 100644 index f455934..0000000 --- a/infra/nnfw/command/doxygen +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -pushd ${NNFW_PROJECT_PATH} > /dev/null - -doxygen infra/nnfw/doxygen/Doxyfile - -popd > /dev/null -- 2.7.4