2010-11-12

HOWTO: Publish Javadoc on Google Code

Adding to Eric Burke's identically titled blog entry from three years ago, this entry details how to ensure Javadoc files have the correct svn:mime-type for normal browser viewing, when files are added to Subversion using the command line svn in M$ Windows.

For an example of viewing properly published Javadoc in a Google Code project, take a look at http://jgenere.googlecode.com/svn/tags/initial_port_v0.3r2010.1105/jgenere-initial_port/javadoc/index.html
Link To This ArticleQR Code Link To This Articlehttp://goo.gl/vM4jz

As described in the "Properties" section of Version Control with Subversion, Subversion includes subcommands to edit file properties, such as mime-type, with the command line tools. Also, the "Runtime Configuration Area" section, describes setting properties in the Windows registry, or in a "config" file. So, where is this mysterious config file?

The Secret Detail: The config file is in the %appdata%/Subversion directory and it's named simply "config", with no filename extension - at least it is on my computer. Notes: 1. On my system, %appdata% is the /Users/USERNAME/AppData/Roaming directory. 2. The %appdata%/Subversion directory wasn't created on my system after just installing svn tooling. (I'm using Slik SVN.) Instead, the directory was created after the first time I successfully executed a svn checkout command.

In the file named simply "config", just before the [auto-props] section, uncomment (by deleting any # characters in front of it) or add an entry for "enable-auto-props = yes", and then add the following three configurations to the [auto-props] section.
  • *.html = svn:mime-type=text/html
  • *.css = svn:mime-type=text/css
  • *.gif = svn:mime-type=image/gif
Of course, if the content to be published contains files with other extensions, add auto-props mime-type configurations for each of them, as well.

After editing and saving the config file, simply execute svn add and svn commit commands to add the Javadoc to the repository. If the docs were already in the repository before altering the config file, it will be necessary to make changes to them or delete and add them again, in order for the new mime-type properties to be set (or to use the subcommands for editing properties, as previously mentioned).