Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen for a project managed with git?

I'm working on a C++ and Objective C iPhone Project. I'm using git as my version control system.

The codebase has been growing quite a bit, so I would like to add doxygen to the project. The problem is that I'm not sure about what would be the best approach to do it.

I've thought about a couple of options:

1) Create the doxygen HTML documentation in the project folder and make it "part" of the project so that it is also versioned and committed to git.

2) Create the doxygen HTML documentation in the project folder and add it to the .gitignore so each user of the project is responsible for generating the docs and the project git repository would remain untouched (except for the .gitignore).

We are using a git --bare repository in our main server, so to mount a webpage containing the HTML doxygen in the server would be complicated ( you can't actually see the project files with a git --bare repo, so I won't be able to see the doxygen generated HTML doc unless I uploaded it separately )

Maybe I could make some kind of cron-job, to keep the doxygen updated on the server side ?

Help is very welcome.

like image 559
Goles Avatar asked Aug 20 '10 04:08

Goles


People also ask

What is Doxygen documentation?

Doxygen (/ˈdɒksidʒən/ DOK-see-jən) is a documentation generator and static analysis tool for software source trees. When used as a documentation generator, Doxygen extracts information from specially-formatted comments within the code.

How do I upload a file to Doxygen?

Just list your custom files in the INPUT macro in your doxyfile. You can choose whatever name you find appropriate. Format is text with Doxygen tags.


2 Answers

I believe one should never store generated files in a source repository, particularly when they're generated by commonly-available tools like Doxygen from files that are already stored in the repository. In the case of Doxygen, you only need to store Doxyfile in the repo.

(Or, better, if you're using autoconf, store Doxyfile.in, so that the current project version number gets substituted into the generated Doxyfile as part of the configure step.)

If you want to ensure that everyone who checks your project out gets a copy of the Doxygen-generated reference manual, make it part of the default build process.

like image 199
Warren Young Avatar answered Oct 02 '22 13:10

Warren Young


I agree with Warren, but I would add the following:

You can use a ''post-receive hook'' to automatically update a (separate) working directory every time there's a push to the bare repository. This approach is described for maintaining version-controlled web sites here http://toroid.org/ams/git-website-howto, and I use it that way.

It seems reasonable to me that you could add a step to the hook to run Doxygen after the update, which would be about what you're looking for. You might need to think about how to report errors to the user/committer if Doxygen borks, but that's the only issue I see.

like image 45
Eric Anderson Avatar answered Oct 02 '22 13:10

Eric Anderson