[cmd] Move doxygen command (#7821)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 30 Sep 2019 05:20:35 +0000 (14:20 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 30 Sep 2019 05:20:35 +0000 (14:20 +0900)
Move doxygen command from nnfw to nnas
Use user-setting workspace for docygen output
Add document for help

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
.gitignore
docs/UseDoxygen.md [new file with mode: 0644]
infra/command/doxygen [new file with mode: 0644]
infra/doxygen/Doxyfile [moved from infra/nnfw/doxygen/Doxyfile with 99% similarity]
infra/nnfw/command/doxygen [deleted file]

index 5a52860..32c3360 100644 (file)
@@ -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 (file)
index 0000000..1b016c0
--- /dev/null
@@ -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
+
+```
+<nnas-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-root-path>/nnas doxygen
+```
+
+Generated documentation html is in your workspace directory: `<NNAS_WORKSPACE>/doxygen/html`
+Default workspace directory is `build`
diff --git a/infra/command/doxygen b/infra/command/doxygen
new file mode 100644 (file)
index 0000000..e02d3b0
--- /dev/null
@@ -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
similarity index 99%
rename from infra/nnfw/doxygen/Doxyfile
rename to infra/doxygen/Doxyfile
index c04a7bb..c082a1b 100644 (file)
@@ -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 (file)
index f455934..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-pushd ${NNFW_PROJECT_PATH} > /dev/null
-
-doxygen infra/nnfw/doxygen/Doxyfile
-
-popd > /dev/null