views:

449

answers:

4
+1  Q: 

Doxygen with Xcode

Hi,

I'm trying to use Doxygen with 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.

A: 

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.

Fred
A: 

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.

JJD
A: 

Hi

I am trying to use the following script by duckrowing (pointed to above), to document an existing xcode project.

 #
# Build the doxygen documentation for the project and load the docset into Xcode 
#
# Created by Fred McCann on 03/16/2010.
# http://www.duckrowing.com
#
# Based on the build script provided by Apple:
# http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
#
# Set the variable $COMPANY_RDOMAIN_PREFIX equal to the reverse domain name of your comany
# Example: com.duckrowing
#

DOXYGEN_PATH=/Applications/Doxygen.app/Contents/Resources/doxygen
DOCSET_PATH=$SOURCE_ROOT/build/$PRODUCT_NAME.docset

if ! [ -f $SOURCE_ROOT/Doxyfile] 
then 
  echo doxygen config file does not exist
  $DOXYGEN_PATH -g $SOURCE_ROOT/Doxyfile
fi

#  Append the proper input/output directories and docset info to the config file.
#  This works even though values are assigned higher up in the file. Easier than sed.

cp $SOURCE_ROOT/Doxyfile $TEMP_DIR/Doxyfile

echo "INPUT = $SOURCE_ROOT" >> $TEMP_DIR/Doxyfile
echo "OUTPUT_DIRECTORY = $DOCSET_PATH" >> $TEMP_DIR/Doxyfile
echo "RECURSIVE = YES" >> $TEMP_DIR/Doxyfile
echo "EXTRACT_ALL        = YES" >> $TEMP_DIR/Doxyfile
echo "JAVADOC_AUTOBRIEF        = YES" >> $TEMP_DIR/Doxyfile
echo "GENERATE_LATEX        = NO" >> $TEMP_DIR/Doxyfile
echo "GENERATE_DOCSET        = YES" >> $TEMP_DIR/Doxyfile
echo "DOCSET_FEEDNAME = $PRODUCT_NAME Documentation" >> $TEMP_DIR/Doxyfile
echo "DOCSET_BUNDLE_ID       = $COMPANY_RDOMAIN_PREFIX.$PRODUCT_NAME" >> $TEMP_DIR/Doxyfile

#  Run doxygen on the updated config file.
#  Note: doxygen creates a Makefile that does most of the heavy lifting.

$DOXYGEN_PATH $TEMP_DIR/Doxyfile

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

make -C $DOCSET_PATH/html install

#  Construct a temporary applescript file to tell Xcode to load a docset.

rm -f $TEMP_DIR/loadDocSet.scpt

echo "tell application \"Xcode\"" >> $TEMP_DIR/loadDocSet.scpt
echo "load documentation set with path \"/Users/$USER/Library/Developer/Shared/Documentation/DocSets/$COMPANY_RDOMAIN_PREFIX.$PRODUCT_NAME.docset\"" >> $TEMP_DIR/loadDocSet.scpt
echo "end tell" >> $TEMP_DIR/loadDocSet.scpt

#  Run the load-docset applescript command.
osascript $TEMP_DIR/loadDocSet.scpt

exit 0

However, I am getting these errors

Osascript:/Users/[username]/SVN/trunk/Examples: No such file or directory

Earlier in the script output (in xcode window after building) I see these msgs:

Configuration file '/Users/[username]/SVN/trunk/Examples' created

the problem I think is that the full path is actually

'/Users/[username]/SVN/trunk/Examples using SDK'

I was working on the assumption that the whitespaces were the culprit. So I tried two approaches:

$SOURCE_ROOT = "/Users/[username]/SVN/trunk/Examples using SDK"
$SOURCE_ROOT = /Users/[username]/SVN/trunk/Examples\ using\ SDK
set $SOURCE_ROOT to quoted form of POSIX path of /Users/$USER/SVN/trunk/Examples\ using\ SDK/

but all give the same Osascript error as above. Also, the docset is not build into the requested directory

/Users/$USER/Library/Developer/Shared/Documentation/DocSets/$COMPANY_RDOMAIN_PREFIX.$PRODUCT_NAME.docset\

I've scratched my head over this for a while but can't figure out what is the problem. One hypothesis is that I am running Doxygen on a project that is not a new project. To handle this EXTRACT_ALL is set to YES (which should remove all warning messages, but I get 19 warnings too).

Any help would be much appreciated

thank you

Peyman

Peyman
the problem was solved through escaping the vars as follows: echo "INPUT = \"$Source_Root\"
Peyman
A: 

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!

Jano