diff --git a/brix11/lib/brix11/brix/common/cmds/gendoc/doxygen.rb b/brix11/lib/brix11/brix/common/cmds/gendoc/doxygen.rb index 31e3837..4cf5cd7 100644 --- a/brix11/lib/brix11/brix/common/cmds/gendoc/doxygen.rb +++ b/brix11/lib/brix11/brix/common/cmds/gendoc/doxygen.rb @@ -33,6 +33,10 @@ def has_doxygen? !!(Sys.expand('doxygen -v') =~ /\d+\.\d+\.\d+/) end + def has_dot? + !!(Sys.expand('dot -V', '', false) =~ /graphviz/) + end + public def generate(config, noredirect) @@ -42,14 +46,12 @@ def generate(config, noredirect) config = config.gsub(/\$\{(\w+)\}/) { |_| resolve_path_var($1) } # check for availability of doxygen if has_doxygen? + opts = { env: { 'BRIX11_HAVE_DOT' => has_dot? ? 'YES' : 'NO'} } Sys.in_dir(Exec.get_run_environment('X11_BASE_ROOT')) do - args = [] - args << '-q' unless noredirect - args << config - Exec.runcmd('doxygen', *args, noredirect ? {} : {silent: true, filter: NullFilter.new}) + Exec.runcmd('doxygen', config, noredirect ? opts : opts.merge({silent: true, filter: NullFilter.new})) end else - BRIX11.log_warning('No source documentation will be generated as the doxygen tool is not available!') + BRIX11.log_error('No source documentation will be generated as the doxygen tool is not available!') end end end diff --git a/brix11/lib/brix11/brix/common/docs/generate_documentation.rd b/brix11/lib/brix11/brix/common/docs/generate_documentation.rd index fa4c22f..42ae71b 100644 --- a/brix11/lib/brix11/brix/common/docs/generate_documentation.rd +++ b/brix11/lib/brix11/brix/common/docs/generate_documentation.rd @@ -11,6 +11,11 @@ common === options + -D, --doxygen Generate doxygen source documentation. + Not generated by default. + -N, --no-redirect Do not redirect output from doxygen process.. + Default: run silent and hide output. + -f, --force Force all tasks to run even if their dependencies do not require them to. Default: off -v, --verbose Run with increased verbosity level. Repeat to increase more. @@ -18,9 +23,15 @@ common -h, --help Show this help message. - == Description +== Description Generate documentation from Asciidoctor sources into the 'docs' directory. To install Asciidoctor with coderay support as gem run the following command $ gem install asciidoctor:2.0.15 coderay + +Installation of the *Doxygen* toolset is required to be able to generate doxygen source documentation. +When not available an error will be shown and no source documentation is generated. + +When the *Graphviz* toolset is installed it will be used by doxygen to generate class inheritance graphs for +the doxygen source documentation otherwise the (simpler) integrated graph generation will be used. diff --git a/brix11/lib/brix11/system.rb b/brix11/lib/brix11/system.rb index aabde84..be4c36a 100644 --- a/brix11/lib/brix11/system.rb +++ b/brix11/lib/brix11/system.rb @@ -45,6 +45,8 @@ def self.expand(cmd, default='', redirect_err=true) excmd = cmd if redirect_err excmd << ' 2>' << (mswin? ? 'NUL' : '/dev/null') + else + excmd << ' 2>&1' end %x{#{excmd}} rescue default end