Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
AutoVersioning Plugin
JGM:
--- Quote from: thomas on June 28, 2007, 11:47:52 am ---Personally, I would not even increment build numbers automatically, but instead would use a number provided by the revision control system for that.
--- End quote ---
Well so I will give the user the option to not increment this values automatically and if the user wants to increment the values automatically use a default scheme.
--- Quote from: thomas on June 28, 2007, 11:47:52 am ---On the other hand, if the revision number has changed, then obviously code has been modified, and the build number should be amended.
--- End quote ---
You mean with "amended" that the build number should be incremented when the revision number is incremented? Sorry not a native english speaker :roll: So with what you said above increment the revision by random numbers from 1 to 10 and the build number by one.
--- Quote from: thomas on June 28, 2007, 11:47:52 am ---major.minor.release scheme is understood as:
* major: big change in functionality, may have entirely different look and feel, and may even not be backwards-compatible (although that's usually a requirement nevertheless)
* minor: must not break compatibility, no matter what, may contain major or minor improvements, but no gross changes in overall look and feel
* release: bug fixes or insignificant changes
--- End quote ---
Substitute the build number and revision by the release?
--- Quote from: thomas on June 28, 2007, 11:47:52 am ---year.month scheme as first made famous by Ubuntu.
--- End quote ---
Right, I thought this. I want to declare some defines with the date month and year and maybe one define that declares some UBUNTU_STYLE_VERSION with the y.mm. The only problem for know is that no EVT_COMPILER_STARTED is been fired, and is needed to update the file before the compilation takes effect.
Well i will start working on this right now :D
rjmyst3:
--- Quote from: tiwag on June 28, 2007, 02:54:43 pm ---i'm using an autobuildnumber tool,
which increments only the last number
from the docs
--- Quote ---/**
@file
@author Ryan Mulder
@author Steve Pierce
@date 3/13/06
Usage:
The first command line argument is the path to the file to edit (typically a resource file or header).
If only the first argument is supplied, the "FILEVERSION" field is incremented
If additional arguments are supplied, they are the string to search for before the version number. Example: "#define AutoBuildNumber"
Valid version numbers are a list of numbers separated by any one of:
,.|\\/&*^%$#@+-_=`~?<>:
However, only 1 of these separators can be used at once.
Version numbers can be contained inside double quotes or not, and only the last value will be incremented by this app.
Example: #define AutoBuildNumber 1.0.0.1
Example: #define AutoBuildNumber "1,0,0,1"
*/
--- End quote ---
and use it with CodeBlocks by defining a pre-build step
in "Project -> Build Options -> Pre/post build steps"
eg. if my version info is in file version.h and the macro name is APPVERSION
the you need a pre-build step like
--- Code: ---autobuildnumber version.h "#define APPVERSION"
--- End code ---
hth, regards, tiwag
--- End quote ---
This tool is open source and uses wxWidgets.
It looks like it does a very similar thing to what the plugin will do, so if the source will help you get started you can find it on google code.
http://code.google.com/p/autobuildnumber/
You can checkout the source from its svn repository here:
http://autobuildnumber.googlecode.com/svn/trunk/
JGM:
--- Quote from: rjmyst3 on June 28, 2007, 06:53:12 pm ---This tool is open source and uses wxWidgets.
It looks like it does a very similar thing to what the plugin will do, so if the source will help you get started you can find it on google code.
http://code.google.com/p/autobuildnumber/
You can checkout the source from its svn repository here:
http://autobuildnumber.googlecode.com/svn/trunk/
--- End quote ---
Thanks, I have already downloaded the zip file that attached Tiwag :)
JGM:
So far this is what is been output by the AutoVersioning when configured with a project.
--- Code: ---//version.h file
//Date Version Types
#define DATE_VERSION 28
#define MONTH_VERSION 06
#define YEAR_VERSION 2007
#define UBUNTU_VERSION_STYLE 7.06
//Standard Version Types
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_NUMBER 0
#define REVISION 0
//Miscellaneous Version Types
#define BUILDS_COUNT 1
#define RC_FILEVERSION 1,0,0,0
#define RC_FILEVERSION_STRING "1, 0, 0, 0\0"
#define FULLVERSION_STRING "1.0.0.0"
--- End code ---
Now I will implement the AutoUpdate Functions :)
killerbot:
suggestions :
- don't use defines (bad, preprocessor and ancient C shit)
- use static const int or something like that
- put them in a special namespace to avoid collisions
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version