SVN::Project

Description

Class encapsulating methods for various svn:tags Rake tasks.

Installation

sudo gem install svn_project

Configuration

To use these methods, add the below directives to your rakefile. This library assumes that you are working with a project that has already been checked into svn.

require 'svn/rake/svntask'
Rake::SVN::ProjectTasks.new() do |s|
  s.method = "http"
  s.username = "jeff"
  s.project_url = "/one/two/three/go"
  s.svn_cmd = "/path/to/svn"            # optional
  s.always_update_current = true        # optional (maintains a tag 'current' pointing to your most numerically recent tag)
  s.current_name = "some_name"          # options (uses 'some_name' as the name of your 'current' tag)
end

You can now use the following tasks in your svn project:

  • svn:project:current_version #=> Display most current version of the project

  • svn:project:tags_url #=> Display URL for the project’s TAGS dir

  • svn:project:trunk_url #=> Display URL for the project’s TRUNK dir

  • svn:project:url #=> Displays URL for project

  • svn:tags:create_fix #=> Create tag for a fix release

  • svn:tags:create_major #=> Create tag for a major release

  • svn:tags:create_minor #=> Create tag for a minor release

  • svn:tags:current #=> Current release tag

  • svn:tags:list #=> Display all release tags in the tags dir

  • svn:tags:list_all #=> Display all tags in the tags dir

  • svn:tags:list_releases #=> Display all release tags in the tags dir

  • svn:tags:ls #=> Display all release tags in the tags dir

  • svn:tags:next_fix #=> Display next fix release tag

  • svn:tags:next_major #=> Display next major release tag

  • svn:tags:next_minor #=> Display next minor release tag

Example Usage

To get the current release tag:

rake svn:tags:current   #=> rel-0.0.1

To get the current version

rake svn:project:current_version #=> 0.0.1

To create a new minor release:

rake svn:tags:create_minor
#=> Created rel-0.1.0 tag

To see all the tags:

rake svn:tags:ls
#=> rel-0.0.1
    rel-0.1.0
    rel-1.0.0

Version Numbering

Versions are of the form major.minor.fix

  • a fix version does not add functionality, but corrrects some defect

  • a minor version adds a small amount of functionality

  • a major version adds a relatively large amount of functionallity

The difference between major and minor is subjective and will usually be determined by the customer.

When minor or major are incremented, all numbers to the right are set to “0”

The version after 1.0.9 is 1.0.10

The task svn:tags:ls sorts release tags correctly.