排除Doxygen的目录

时间:2011-03-31 22:21:27

标签: doxygen

我希望Doxygen忽略,绕过,而不是搜索我项目的以下目录:

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

根据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/*

所以,我的Doxygen文件看起来像这样:

# 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/*

Doxygen的输出是:

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

这清楚地表明EXCLUDE_PATTERNS不起作用。 我还将EXCLUDE选项设置为:

# 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

哪个也不起作用。

因此,100000美元的问题是:如何使Doxygen排除,绕过,忽略,保持清除指定的目录或文件夹(最好是有效的东西)?

我在64位CPU平台上使用Windows 7上的Doxygen Wizard,以及Doxygen 1.7.3。

3 个答案:

答案 0 :(得分:41)

  

请注意,通配符与具有绝对路径的文件匹配

所以,只需使用排除的绝对路径;)

PS:顺便说一下,我已经挣了很多次。这篇关于doxyfile评论的小提及似乎不经常被忽视。

哎呀,我错过了你已经尝试过的细节。也许这是多行值的问题:尝试使用空格作为分隔符来内联所有路径。那个(加上绝对模式)在我最近使用doxygen的几个系统上已经足够了。


我做了一些更深入的测试,还看了一下doxyfile的文档。 正确的语法是使用空间进行分离。如果您真的想要多线,支持和记录的语法将是:

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

另外,仔细看看排除模式是如何工作的:包含目录本身,然后其中的所有内容都将针对排除模式进行测试,并且(因为它将始终匹配),排除在文件上 - 每个文件基础

所以仔细看看你的输出:Searching for files in directory行应该在那里(doxygen将搜索目录,但在其上找不到任何内容,因为所有内容都被排除在外);对于这些目录中的任何内容,您获得Parsing code for fileGenerating docs for吗?如果你没有得到任何这些,这意味着一切正常(搜索目录,但不包括任何内容)。如果确实包含了文件,请尝试使用空格分隔或+=语法。我在文档上看不到任何内容,甚至暗示你的\语法可行(当然,我可能忽略了某些内容)。

答案 1 :(得分:2)

请注意,当我使用doxygen时,我会看到类似的现象。但是,当工具搜索示例文件和图像时会发生这种情况:

Searching for example files...
Searching for files in directory .../wpkg/mainline/documentation
Searching for files in directory .../wpkg/mainline/documentation/.svn
Searching for files in directory .../wpkg/mainline/documentation/.svn/prop-base
[...]
Searching for images...
Searching for files in directory .../wpkg/mainline/documentation
Searching for files in directory .../wpkg/mainline/documentation/.svn
Searching for files in directory .../wpkg/mainline/documentation/.svn/prop-base
[...]

因为你有EXCLUDE_PATTERNS设置忽略.svn子目录。我想这是doxygen中的一个错误,它应该在扫描示例和图像时检查这些排除。

它看起来可能是它打印屏幕上的所有目录,但在使用它们之前正确地忽略它,它会检查排除模式。但这只是猜测;虽然似乎有人说这是它的工作方式:

http://doxygen.10944.n7.nabble.com/EXCLUDE-DIRECTORY-PATTERN-td2185.html

答案 2 :(得分:0)

  

如何使Doxygen排除,绕过,忽略,远离指定的目录或文件夹(最好是可行的东西)?

使用INPUT配置选项!

INPUT = src other_folder README.md

mentioned一样,排除模式仍将考虑目录中的文件,而不根据与正则表达式匹配的文件来解析它们。指定要考虑的文件夹和文件将获得理想的结果,甚至不需要首先搜索文件夹,这可以大大缩短生成时间。

请注意,这需要EXCLUDE指令为空,否则搜索将会发生。