Skip to content

Commit

Permalink
Merge pull request #107 from mcorino/mco-fix-doxygen
Browse files Browse the repository at this point in the history
Make HAVE_DOT configurable, remove -q switch, update docu.
  • Loading branch information
mcorino authored Oct 27, 2021
2 parents 4892ee0 + 692d19e commit 3c9cfe5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
12 changes: 7 additions & 5 deletions brix11/lib/brix11/brix/common/cmds/gendoc/doxygen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
13 changes: 12 additions & 1 deletion brix11/lib/brix11/brix/common/docs/generate_documentation.rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,27 @@ 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.
Default: 0

-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.
2 changes: 2 additions & 0 deletions brix11/lib/brix11/system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c9cfe5

Please sign in to comment.