views:

598

answers:

2

I followed this guide from Apple to create doxygen documentation. I did need to modify the script to put variables in quotes so when it parses a directory with spaces, it doesn't treat it as two separate arguments.

That said, I recently switched to use subversion in XCODE instead of using the Snapshot stuff, which has a notorious history with corrupting itself and losing your history. My process for doing such was to create a subversion like directory structure for my project, check that into SVN, then check check out from the trunk.

My problem is that when I create the documentation, no matter how I modify my doxygen config file (exclude_parameters, etc...), the first time it creates the docset for the documentation it is fine. The second time it goes through, it has issues trying to copy with the cp command to my library documentation directory where it is installed for XCODE to reference.

I've tried adding to the exclude_parameters .svn *.svn* */.svn* */.svn/* but nothing seems to help or affect the documentation. I did a chmod on my docset after it is installed, and that resolves the issue, but it is really just masking the fact that the .svn directories are still present in the documentation.

I thought maybe creating a folder action might do the trick, but I haven't really messed around with apple scripts that much. It would be a hack, but would certainly get the job done.

To do this right though, does anyone have an idea of how do this gracefully (the correct way)?

Thanks!

+1  A: 

I don't know exactly where your problem is, so I will try to describe how I work with svn, doxygen and Xcode. I have written a more complete guide than this answer, but unfortunately it is in french.

Concerning source files, my project directory structure is flat: no source code is in sub folders (this is the default when you manage code with Xcode only). My Doxyfile contains this setting:

RECURSIVE = NO

This way, .svn directories are not parsed by doxygen.

Concerning docsets, my Doxyfile contains these settings:

GENERATE_DOCSET        = YES
DOCSET_FEEDNAME        = "My wonderful Application"
DOCSET_BUNDLE_ID       = com.example.mywonderfulapp

and my script looks like this:

# Where are doxygen and dot (assuming in my own Applications folder)
DOXYGEN_PATH=${HOME}/Applications/Doxygen.app/Contents/Resources
PATH=${DOXYGEN_PATH}:${PATH}
export PATH

# Doxygen documentation generation
doxygen || exit 1

# DOCSET generation
make -C html install || exit 1

# Open DOCSET in Xcode
DOCSET_PATH=Library/Developer/Shared/Documentation/DocSets
open $HOME/$DOCSET_PATH/fr.exemple.doxygentutorial.docset || exit 1

With these settings I didn't experience issues like the ones you describes.

mouviciel
Perfect! Most of my directory structure was already flat, except for a few files that I believe the default XCode project put into a sub directory. I just had to move those few files and setting RECURSIVE = NO did the trick. I did try changing the input directories to include the Classes directory, but something about the doc build seems to ignore that. A flat structure seems to work better anyway. Thanks!
Gary
A: 

You shouldn't have a flat directory structure on your project. What if you want to internationalize it?

The way to avoid those cp errors is to add the DocSet package to the list of files ignored by SVN. If it's ignored it's not versioned and if it's not versioned there's no .svn files for cp to complain about.

I'm using the command line SVN client so YMMV, but here's what I did:

  • First, svn update your working copy to make sure you're synchronized with the repository.
  • Second, svn delete the DocSet directory from the repository and commit.
  • Third, build the project to generate a new DocSet directory (this one is unversioned).
  • Add it to SVN ignore and commit
  • Do svn status to make sure everything is ok. You should now be able to work without problems.

I spent a couple of hours figuring this out, but now I can build my project at will without being misled by those fake errors AND I have my DocSet.

Rui Pacheco