AutoVersioning plugin

From CodeBlocks
Revision as of 02:00, 17 September 2007 by Jgm (Talk | contribs) (Features)

Jump to: navigation, search
AutoVersioning
AutoVersioningLogo.png
Developer(s): JGM
Maintainer(s): JGM
Version: 0.8

An application versioning plug in that increments the version and build number of your application every time a change has been made and stores it in version.h with easy to use variable declarations. Also have a feature for committing changes a la SVN style, a version scheme editor, a change log generator and more...

Introduction

The idea of the Auto Versioning plugin was made during the development of a pre-alpha software that required the version info and status. Been to busy coding, without time to maintain the version number, just decided to develop a plugin that could do the job with little intervention as possible, and made a little contribution to this fabulous OS IDE.

Features

Here is the list of features the plugin covers summarized:

  • Supports C and C++
  • Generates and auto increment version variables
  • Software status editor
  • Integrated scheme editor for changing the behavior of the auto incrementation of version values
  • Date declarations as month, date and year
  • Ubuntu style version
  • Svn revision check
  • Change log generator.

Sources

Usually source and news about new releases are posted on the Code::Blocks forums on the plugins development section. You can access this plugin topic over here, recent sources are attached on the first post (you have to be logged in to download attachments on the forum).

The plugin also have a project page at www.berlios.de. The link is http://developer.berlios.de/projects/autoversioning/. Submit all features request and bugs on the project page.

Svn check out: svn://svn.berlios.de/autoversioning

Usage

After downloading the sources, compiling them and installing the plugin to Code::Blocks just go to Project->Auto Versioning menu. A pop up window like this will appear:

AvAskConfigure.png

When hitting yes on the ask to configure message box, the main autoversioning configuration dialog will open, to let you configure the version info of your project. Each editable control has a tool tip with information that explains you its features, so if you put the mouse on the control the tool tip will pop up. Below is a screenshot showing all the tabs:

AvDialog.png

After configuring your project for auto versioning, a version.ini (for the settings that you entered on the configuration dialog) and version.h files will be created next to your project file. For now, everytime that you hit the Project->Auto Versioning menu the configuration dialog will popup to let you edit your project version and settings, unless you delete the version.ini that has all the configurations.

Dialog notebook tabs

Version Values

Here you just enter the corresponding version values or let the autoversioning plugin increment them by himself.

  • Major - Increments by 1 when the minor version reaches its maximum
  • Minor - Increments by 1 when the build number pass the barrier of build times, the value is reset to 0 when it reach its maximum value.
  • Build Number (also equivalent to Release) - Increments by 1 every time that the revision number is incremented.
  • Revision - Increments randomly when the project has been modified and then compiled.

Status

Some fields to keep track of your software status with a list of predefined values for convenience.

  • Software Status - The typical example should be v1.0 Alpha
  • Abbreviation - Same as software status but like this: v1.0a

Scheme

Lets you edit how the plugin will increment the version values.

  • Minor maximum - The maximum number that the Minor value can reach, after this value is reached the Major is incremented by 1 and next time project is compiled the Minor is set to 0.
  • Build Number maximum - When the value is reached, the next time the project is compiled is set to 0.
  • Revision maximum - Same as Build Number maximum.
  • Revision random maximum - The revision increments by random numbers that you decide, if you put here 1, the revision obviously will increment by 1.
  • Build times before incrementing Minor - After successful changes to code and compilation the build history will increment, and when it reaches this value the Minor will increment.

Settings

Here you can set some settings of the auto versioning behavior.

  • Autoincrement Major and Minor - lets the plugin increments this values by you using the scheme.
  • Create date declarations - create entries in the version.h file with dates and ubuntu style version.
  • Commit Changes - to increment the changes using the scheme when you feel that is the right moment, just using the menu Project->Commit Changes. This will increment the version values.
  • Header language - select the language output of version.h
  • Ask to commit changes - if marked Commit Changes, it ask you before compilation (if changes has been made) to increment the version values.
  • svn enabled - search for the svn revision and date in the current folder and generates the correct entries in version.h

Changes Log

This lets you enter every change made to the project to generate a CHANGES.txt next to your project file.

  • Generate changes log - Enables this feature.
  • Title Format - a format able title with a list of predefined values.

Including in your code

To use the variables generated by the plugin just #include <version.h>. An example code would be like the following:

#include <iostream>
#include "version.h"

void main(){
    std::cout<<AutoVersion::Major<<endl;
}

Output of version.h

The header version.h is generated next to your project file. Here is a sample content of the file on c++ mode:

#ifndef VERSION_H
#define VERSION_H

namespace AutoVersion{
	
	//Date Version Types
	static char DATE[] = "15";
	static char MONTH[] = "09";
	static char YEAR[] = "2007";
	static double UBUNTU_VERSION_STYLE = 7.09;
	
	//Software Status
	static char STATUS[] = "Pre-alpha";
	static char STATUS_SHORT[] = "pa";
	
	//Standard Version Type
	static long MAJOR = 0;
	static long MINOR = 10;
	static long BUILD = 1086;
	static long REVISION = 6349;
	
	//Miscellaneous Version Types
	static long BUILDS_COUNT = 1984;
	#define RC_FILEVERSION 0,10,1086,6349
	#define RC_FILEVERSION_STRING "0, 10, 1086, 6349\0"
	static char FULLVERSION_STRING[] = "0.10.1086.6349";
	
}
#endif //VERSION_h

On C mode is the same as C++ but without the namespace:

#ifndef VERSION_H
#define VERSION_H
	
	//Date Version Types
	static char DATE[] = "15";
	static char MONTH[] = "09";
	static char YEAR[] = "2007";
	static double UBUNTU_VERSION_STYLE = 7.09;
	
	//Software Status
	static char STATUS[] = "Pre-alpha";
	static char STATUS_SHORT[] = "pa";
	
	//Standard Version Type
	static long MAJOR = 0;
	static long MINOR = 10;
	static long BUILD = 1086;
	static long REVISION = 6349;
	
	//Miscellaneous Version Types
	static long BUILDS_COUNT = 1984;
	#define RC_FILEVERSION 0,10,1086,6349
	#define RC_FILEVERSION_STRING "0, 10, 1086, 6349\0"
	static char FULLVERSION_STRING[] = "0.10.1086.6349";
	
#endif //VERSION_h

Change log generator

After checking the option Generate changes log on the configuration dialog of auto versioning, a window will open to let you enter the list of changes after a modification to the project sources or a Commit Changes event. Below is an example screen shot

AvChangesList.png

Here is an example of the output generated by the plugin to the CHANGES.txt file created next to your project file:

03 September 2007
   released version 0.7.34 of AutoVersioning-Linux

     Change log:
        -Fixed: pointer declaration
        -Bug: blah blah

02 September 2007
   released version 0.7.32 of AutoVersioning-Linux

     Change log:
        -Documented some areas of the code
        -Reorganized the code for readability

01 September 2007
   released version 0.7.30 of AutoVersioning-Linux

     Change log:
        -Edited the change log window
        -If the change log windows is leave blank no changes.txt is modified