开发者

How to use Doxygen with Xcode?

开发者 https://www.devze.com 2022-12-25 20:04 出处:网络
I\'m trying to use Doxygen w开发者_如何学编程ith Xcode. I followed the Apple tutorial. After several mistakes, I builded the project and generated the docs. I discovered that if you save the doxygen.c

I'm trying to use Doxygen w开发者_如何学编程ith Xcode. I followed the Apple tutorial. After several mistakes, I builded the project and generated the docs. I discovered that if you save the doxygen.config from Doxygen and you use space " " in the directory name you will have problem and others things.

But there is one last problem:

./search/search.png
./tab_b.gif
./tab_l.gif
./tab_r.gif
./tabs.css
/Developer/usr/bin/docsetutil index com.mycompany.DoxygenExample.docset
2010-03-31 12:30:53.847 docsetutil[46338:807] Error converting XML to CoreData: Error Domain=NSXMLParserErrorDomain Code=76 UserInfo=0x1247d0 "Line 8: Opening and ending tag mismatch: Subnodes line 0 and Node
"
Failed to create docset indexer object
make: *** [docset] Error 1
load documentation set with path "/Users/WB/Library/Developer/Shared/Documentation/DocSets/"

I don't know what is the problem?? Any idea?

I'm using Core Data - sqlite.


The parser is telling you XML is not well formed, but that error usually shows because nothing has been generated BEFORE running docsetutil.

First thing should be to go over the many lines of console output and look for warnings, probably is there. Also look for the docset you generated and right click > Show Contents. If you don't see a lot of html files with the documentation, same thing: you failed at generating documentation and docsetutil has nothing to do. And btw, it's docsetutil who is using CoreData, doesn't matter if you use it on your project or not.

I don't get why Apple doesn't provide a doxygen-like tool more tightly integrated. Or a better code formatter than Crustify. Just take the damn tools and improve them a little bit. Argh!


There is a know bug from generation of Nodes.xml by Doxygen. It is referenced here https://bugzilla.gnome.org/show_bug.cgi?id=671591 and should be corrected in the next doxygen Version (Post V 1.8.0) :

At the end of the Nodes.xml there is an additional

the -silence option is workaround to suppress error, but this param does not allow dosetgeneration to work properly.

$DOXYGEN_PATH $TEMP_DIR/doxygen.config

make -C $TEMP_DIR/DoxygenDocs.docset/html install

Insert following code

Note : The script works in $TEMP_DIR and not in SOURCE_ROOT as AppleScript

$DOXYGEN_PATH $TEMP_DIR/doxygen.config

#  make will invoke docsetutil. Take a look at the Makefile to see how this is done.


LINE=`xmllint  --c14n $TEMP_DIR/DoxygenDocs.docset/html/Nodes.xml 2>&1  |  awk 'NR == 1 {print $1}' | cut -d':' -f 2`

ECHO $LINE

if [ $LINE -gt 0 ]
then 
echo "XML Cleaning "
sed  -i.bak $LINE'd'  $TEMP_DIR/DoxygenDocs.docset/html/Nodes.xml

fi 

make -C $TEMP_DIR/DoxygenDocs.docset/html install

NB: awk and sed may certainly be combined in one line.


So the long story short is that the script creates a Doxyfile on the fly, and it does not recursively scan all subdirectories.

Take a look at this post:

http://www.duckrowing.com/2010/03/18/documenting-objective-c-with-doxygen-part-ii/

There's a script included on the second post that is based on Apple's script that shouldn't have this issue.


I use an extended version of the above script but based on the same priniciples. Although everything works fine on another project this time my script fails. The generation of the docset works fine but the make command produces the following error.

x ./search/search_r.png
2010-07-26 17:36:01.815 docsetutil[8441:903] 
Error converting XML to CoreData: 
Error Domain=NSXMLParserErrorDomain 
Code=76 
UserInfo=0x1006105e0 
"Line 8: Opening and ending tag mismatch: Subnodes line 0 and Node"
Failed to create docset indexer object
make: *** [docset] Error 1

The make command I use is: make --silent -C "$DOCSET_OUTPUT/html" install. I added line breaks to the error message for readability.

0

精彩评论

暂无评论...
验证码 换一张
取 消