Maintaining a Flare project in Google Code

January 30th, 2010

googleCode

I've got a MadCap Flare project that I want to publish as open source code for anyone to go and download. It turns out this is extremely easy to do using Google Code. And Google Code has the benefit of allowing you to sync your work with the online source files using SVN (Subversion).

Multiple people can work on the project simultaneously and each time you open the Flare project the SVN plugin for Flare asks you if you want to use the most up-to-date files from the online repository. When you've finished making changes you just commit your changes, straight into Google Code, without having to leave Flare.

Here's how to create a project in Google Code and add a Flare project.

Prerequisites:

  • For the initial upload of files into a Google Code project I'm using TortoiseSVN. You can download this from http://tortoisesvn.net/downloads. TortoiseSVN allows you to work with a Subversion repository from the right-click menu of Windows Explorer.
  • You will sign into Google Code using a Google account, so you need one of these if you haven't got one already. If you use Gmail you've already got a Google account, so use that.
  • You are going to commit files into a publicly viewable repository. Even if you delete a file from the repository, people will still be able to browse previous revisions of the project and view the file. Versioning repository systems like Subversion are designed to keep a historical record of everything that happened to the repository, so there's no easy way to remove all trace of a file that you didn't mean to upload.* So, before adding a project, make sure that you remove any files that you don't want other people to see.

To put a Flare project into Google Code:

  1. Go to http://code.google.com/p/support/wiki/GettingStarted and read through the information about project hosting.
  2. When you're ready, go to http://code.google.com/hosting/createProject, fill out the simple form and click Create.

    You will now have a Google Code project with one project member: you (or, to be more precise, your Google account).

    You are the project owner. To allow other people to commit changes to the project, you can add more project members from the Administer tab.

  3. Click the Profile link (top right of the page).
  4. Go to the Settings tab and copy your googlecode.com password.
  5. Now go to Windows Explorer and browse to the directory that contains the Flare project you want to add.
  6. Within the project directory select and cut the Analyzer and Output directories.
  7. Paste the Analyzer and Output directories somewhere outside of the project directories.

    This is to avoid these directories being added to the repository.

  8. Do the same to the Project/Reports and Project/Users directories, moving them out of the project for now.
  9. Right-click your Flare project directory and choose TortoiseSVN > Import.
    GoogleCode1

  10. In the Import dialog box, enter the following as the URL of the repository:

    https://<PROJECT-NAME>.googlecode.com/svn/trunk
    GoogleCode2

  11. When prompted, enter your user name and password.

    These are the user name of your Google Code account (e.g. the bit before the @ symbol in your Gmail address) and the googlecode.com password you copied to the clipboard.

  12. Click OK.

    This will now add all of the files/directories to the SVN trunk in Google Code.

    TortoiseSVN displays the progress.
    GoogleCode3
    If you have a lot of files in the project this may take some time.

  13. When the import finishes, click OK to close the dialog box.
  14. Move the Analyzer, Output, Project/Reports and Project/Users directories back within the Flare project directory again.
  15. Still in Windows Explorer, in the directory that contains your Flare project directory, right-click anywhere on the background to the main pane of Windows Explorer and choose SVN Checkout.
  16. In the Checkout dialog box, enter the URL of the repository:

    https://<PROJECT-NAME>.googlecode.com/svn/trunk

    and the Windows path to the Flare project directory (that is, the directory you just imported into Google Code) as the checkout directory.
    GoogleCode5

  17. Click OK.

    The files you imported are checked out and marked as under version control.

    A little check mark on the file icon indicates that TortoiseSVN knows they are part of a Subversion repository.
    GoogleCode7 

  18. In your browser, go to the Source tab of your Google Code project.

    For example, http://code.google.com/p/itauthorflare/source/browse/

  19. Click trunk and you should see all of the files you uploaded.

    GoogleCode4

You can now start Flare and open your project and (if you have the SVN plugin) you will be asked if you want to load the latest version of the files from the SVN repository.


* Note: If you forget about clearing out sensitive files and you discover you've uploaded something you really don't want anyone to see, then you can remove all the revisions within the project - in other words you can empty the project and return it back to its initial state before you imported any files. You do this by resetting the repository.

To do this, go to the Source tab in your Google Code project and click the reset this repository link near the bottom of the page. Be aware that this removes everything from the repository, so you should never do this for a project that has an active community working on it, or a project with any sort of a history because this history will be destroyed by resetting the repository. But if you've just started and then realised there's stuff in there that shouldn't be, then it's a way out of a fix.

Leave a comment