Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding directories for Doxygen

Tags:

doxygen

I want Doxygen to ignore, bypass, not search the following directories of my project:

*/.svn/* */docs/* */Properties/* */bin/* 

According to the Doxygen FAQ:

How can I exclude all test directories from my directory tree?  Simply put an exclude pattern like this in the configuration file:  EXCLUDE_PATTERNS = */test/* 

So, my Doxygen file looks like this:

# If the value of the INPUT tag contains directories, you can use the  # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude  # certain files from those directories. Note that the wildcards are matched  # against the file with absolute path, so to exclude all test directories  # for example use the pattern */test/*  EXCLUDE_PATTERNS       = */.svn/* \                          */docs/* \                          */published/* \                          */bin/* \                          */obj/* 

The output from Doxygen is:

Searching for include files... Searching for example files... Searching for images... Searching for files in directory c:/Test_Fixtures/pc_application/docs Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn/text-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn/tmp Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn/tmp/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn/tmp/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/.svn/tmp/text-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn/text-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn/tmp Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn/tmp/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn/tmp/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/.svn/tmp/text-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn/text-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn/tmp Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn/tmp/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn/tmp/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/html/search/.svn/tmp/text-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn/text-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn/tmp Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn/tmp/prop-base Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn/tmp/props Searching for files in directory c:/Test_Fixtures/pc_application/docs/rtf/.svn/tmp/text-base 

Which clearly shows that the EXCLUDE_PATTERNS is not working. I also have the EXCLUDE option set as:

# The EXCLUDE tag can be used to specify files and/or directories that should  # excluded from the INPUT source files. This way you can easily exclude a  # subdirectory from a directory tree whose root is specified with the INPUT tag.  EXCLUDE                = ../.svn \                          ../docs \                          ../published \                          ../docs/.svn \                          ../docs/.svn 

Which is not working either.

So, the USD$ 100000 question is: How do I make Doxygen exclude, bypass, ignore, stay clear of specified directories or folders (preferably something that works)?

I am using the Doxygen Wizard on Windows 7 on 64-bit CPU platform, and Doxygen 1.7.3.

like image 747
Thomas Matthews Avatar asked Mar 31 '11 22:03

Thomas Matthews


People also ask

How do I exclude a file in Doxygen?

How can I make doxygen ignore some code fragment? The new and easiest way is to add one comment block with a \cond command at the start and one comment block with a \endcond command at the end of the piece of code that should be ignored. This should be within the same file of course.

How do I upload a file to doxygen?

Just list your custom files in the INPUT macro in your doxyfile. You can choose whatever name you find appropriate. Format is text with Doxygen tags.


2 Answers

Note that the wildcards are matched against the file with absolute path

So, just use absolute paths for your exclusions ;)

PS: BTW, I have struggled too many times with that. This small mention on the doxyfile's comment seems to go unnoticed too often.

Oops, I missed the detail that you had already tried that. Maybe it's an issue with the multi-line value: try inlining all the paths, using just a space as separator. That (plus absolute patterns) is enough on the few systems I have been using doxygen lately.


I have done some deeper testing, and also taken another look at the doxyfile's documentation. The correct syntax is using space for separation. If you really want to go multi-line, the supported and documented syntax would be:

EXCLUDE_PATTERNS       = */.svn/* EXCLUDE_PATTERNS      += */docs/* EXCLUDE_PATTERNS      += */published/* # and so on 

Also, take a closer look at how exclude patterns work: the directory itself is included, then everything within it will be tested against the exclude patterns and (since it will always match), be excluded on a file-per-file basis.

So take a closer look at your output: the Searching for files in directory lines are supposed to be there (doxygen will search the directory, but find nothing on it because everything is being excluded); are you getting Parsing code for file or Generating docs for for any of the contents on those directories? If you don't get any of those, this means that everything is working fine (directories are searched, but nothing on them is included). If the files are indeed being included, give the space separation or the += syntax a try. I see nothing on the docs even hinting that your \ syntax could work (of course, I may have overlooked something).

like image 51
Edurne Pascual Avatar answered Sep 29 '22 03:09

Edurne Pascual


How do I make Doxygen exclude, bypass, ignore, stay clear of specified directories or folders (preferably something that works)?

Use the INPUT configuration option!

INPUT = src other_folder README.md 

As mentioned, exclude patterns will still consider the files in the directories, and not parse them based on it matching the regex. Specifying folders and files to be considered will achieve the desired result of not even searching the folders in the first place, which can dramatically improve generation time.

Note that this needs the EXCLUDE directive to be empty, or the searching will happen.

Precisions from David C.'s comment:

More precisely, adding a directory to the EXCLUDE directive causes everything in that directory to be searched. You can exclude specific files (that would otherwise by hit by the INPUT directive) without blowing up the search process.

like image 41
Félix Adriyel Gagnon-Grenier Avatar answered Sep 29 '22 02:09

Félix Adriyel Gagnon-Grenier