0
votes

I'm using ant-doxygen to create the documentation for a java project, which works quite well. Unfortunately the ant task does not echo the warnings of doxygen although they are enabled in the doxygen config file.

I would like to get warnings in case some classes/methods don't have any documentation comments.

As an example, take the following java class...

Class Foo

package com.example;
/**
 *
 * The class Foo is a test class
 */
public class Foo
{

    /**
     * The test method
     * @param args
     */
    public static void main(String[] args)
    {

    }

    public static void undocumentedMethod()
    {

    }
}

As you can see the static method "undocumentedMethod" does not have any Javadoc comments. When creating the documentation I want to be informed about that.

Here is the doxygen configuration file:

Doxyfile

DOXYFILE_ENCODING      = UTF-8
PROJECT_NAME           = "DoxyTest"
OUTPUT_DIRECTORY       = "docs"
OUTPUT_LANGUAGE        = English
RECURSIVE              = YES
WARNINGS               = YES
WARN_IF_UNDOCUMENTED   = YES
WARN_IF_DOC_ERROR      = YES
WARN_NO_PARAMDOC       = NO
GENERATE_LATEX         = NO

Here is the ant script...

build.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:doxygen="antlib:org.doxygen.tools" basedir="." default="test" name="DoxyTest">
    <target name="test" description="test target">
        <doxygen:doxygen configFilename="Doxyfile"/>
    </target>   
</project>

That's the result, when I run the ant-script => there are no warnings

Result when running ant script

D:\ws\DoxyTest01>ant
Buildfile: D:\ws\DoxyTest01\build.xml

test:
[doxygen:doxygen] Exec: doxygen Doxyfile

BUILD SUCCESSFUL
Total time: 0 seconds

And here is the result, when I run doxygen directly => the warning (and a lot of other information) is shown

Result when running doxygen directly

D:\ws\DoxyTest01>doxygen Doxyfile
Searching for include files...
Searching for example files...
Searching for images...
Searching for dot files...
Searching for msc files...
Searching for dia files...
Searching for files to exclude
Searching INPUT for files to process...
Searching for files in directory D:/ws/DoxyTest01
Searching for files in directory D:/ws/DoxyTest01/bin
Searching for files in directory D:/ws/DoxyTest01/bin/com
Searching for files in directory D:/ws/DoxyTest01/bin/com/example
Searching for files in directory D:/ws/DoxyTest01/docs
Searching for files in directory D:/ws/DoxyTest01/src
Searching for files in directory D:/ws/DoxyTest01/src/com
Searching for files in directory D:/ws/DoxyTest01/src/com/example
Reading and parsing tag files
Parsing files
Reading D:/ws/DoxyTest01/src/com/example/Foo.java...
Parsing file D:/ws/DoxyTest01/src/com/example/Foo.java...
Building group list...
Building directory list...
Building namespace list...
Building file list...
Building class list...
Associating documentation with classes...
Computing nesting relations for classes...
Building example list...
Searching for enumerations...
Searching for documented typedefs...
Searching for members imported via using declarations...
Searching for included using directives...
Searching for documented variables...
Building interface member list...
Building member list...
Searching for friends...
Searching for documented defines...
Computing class inheritance relations...
Computing class usage relations...
Flushing cached template relations that have become invalid...
Creating members for template instances...
Computing class relations...
Add enum values to enums...
Searching for member function documentation...
Building page list...
Search for main page...
Computing page relations...
Determining the scope of groups...
Sorting lists...
Freeing entry tree
Determining which enums are documented
Computing member relations...
Building full member lists recursively...
Adding members to member groups.
Computing member references...
Inheriting documentation...
Generating disk names...
Adding source references...
Adding xrefitems...
Sorting member lists...
Computing dependencies between directories...
Generating citations page...
Counting data structures...
Resolving user defined references...
Finding anchors and sections in the documentation...
Transferring function references...
Combining using relations...
Adding members to index pages...
Generating style sheet...
Generating search indices...
Generating example documentation...
Generating file sources...
Generating file documentation...
Generating page documentation...
Generating group documentation...
Generating class documentation...
Generating namespace index...
Generating docs for compound com::example::Foo...
D:/ws/DoxyTest01/src/com/example/Foo.java:7: warning: Member undocumentedMethod() (function) of class com::example::Foo is not documented.
Generating graph info page...
Generating directory documentation...
Generating index page...
Generating page index...
Generating module index...
Generating namespace index...
Generating namespace member index...
Generating annotated compound index...
Generating alphabetical compound index...
Generating hierarchical class index...
Generating member index...
Generating file index...
Generating file member index...
Generating example index...
finalizing index lists...
writing tag file...
lookup cache used 2/65536 hits=2 misses=2
finished...

Does anyone know if there is a possibility to tell the ant task to print all the stuff that the command line tool prints?

1

1 Answers

0
votes

Try with verbose attribute set to true :

<doxygen:doxygen configFilename="Doxyfile" verbose="true"/>

For other usage examples see github ant-doxygen
-- EDIT --
Maybe EXTRACT_ALL is set to YES ? From doxygen site :

Build related configuration options

EXTRACT_ALL

If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in documentation are documented, even if no documentation was available. Private class members and static file members will be hidden unless the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. Note This will also disable the warnings about undocumented members that are normally produced when WARNINGS is set to YES.