I see that the plugin classes only implement a few events. Like attach and release, but I don't see events like onmenuclick or something like that.Have a look at cbEVT_COMPILER_STARTED -> that's what you need to listen to.
And what type of plugin this should be to work correctly? cbToolPlugin?That's a good choice I'd say.
Have a look at cbEVT_COMPILER_STARTED -> that's what you need to listen to.
The compiler plugin is not generating EVT_COMPILER_STARTED or notifying the other plugins about this event.Ouch! :shock: That's obviously not as it should be... I need to have a look at this.
Ouch! :shock: That's obviously not as it should be... I need to have a look at this.
And what type of plugin this should be to work correctly? cbToolPlugin?That's what is the most intuitive thing.
Major Version: increments by 1 when the Minor versionsThat's not what I would do. I would never change major numbers or minor numbers in an automatic way, since that's not what people normally expect.
An interesting approach to versions (which we similarly plan to use in Code::Blocks, too) is the year.month scheme as first made famous by Ubuntu.
/**
@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"
*/
autobuildnumber version.h "#define APPVERSION"
Personally, I would not even increment build numbers automatically, but instead would use a number provided by the revision control system for that.
On the other hand, if the revision number has changed, then obviously code has been modified, and the build number should be amended.
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
year.month scheme as first made famous by Ubuntu.
i'm using an autobuildnumber tool,
which increments only the last number
from the docsQuote/**
@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"
*/
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 likeCodeautobuildnumber version.h "#define APPVERSION"
hth, regards, tiwag
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/
//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"
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
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
this C shit is still widely used in the embedded world
with which I'm working daily. :shock:
namespace AutoVersion{
//Date Version Types
static long DATE_VERSION = 29;
static long MONTH_VERSION = 06;
static long YEAR_VERSION = 2007;
static double UBUNTU_VERSION_STYLE = 7.06;
//Standard Version Types
static long MAJOR_VERSION = 1;
static long MINOR_VERSION = 0;
static long BUILD_NUMBER = 0;
static long REVISION = 0;
//Miscellaneous Version Types
static long BUILDS_COUNT = 1;
#define RC_FILEVERSION 1,0,0,0
#define RC_FILEVERSION_STRING "1, 0, 0, 0\0"
static char FULLVERSION_STRING[] = "1.0.0.0";
}
static double UBUNTU_VERSION_STYLE = %.07; //here also?
//Standard Version Types
static long MAJOR_VERSION = %;
static long MINOR_VERSION = %;
static long BUILD_NUMBER = %;
static long REVISION = %;
//Miscellaneous Version Types
static long BUILDS_COUNT = %;
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
don't be too harsh please :P
this C shit is still widely used in the embedded world
with which I'm working daily. :shock:
and i can assure you, i don't feel sucked myself because of that 8)
Could you add an option to detect the revision number of the project and put it in version.h (like cb does)?
It would be nice to have autorevision's functionality built into codeblocks :D
No, I mean revision number of a version control system as codeblocks does it with svn (see sourcecode of autoversion in codeblocks_source_dir/src/build_tools/autorevision how it can be parsed).
Every time you do a "svn commit", the revision number is increased.
This guarantees, that there really are changes to the project that justify an incrementation of the version number and makes the project's version information much more meaningful.
Could you add an option to detect the revision number of the project and put it in version.h (like cb does)?
It would be nice to have autorevision's functionality built into codeblocks :D
avSvnRevision.cpp:: In function `bool QuerySvn(const std::string&, std::string&, std::string&)':
avSvnRevision.cpp:32: error: 'class TiXmlElement' has no member named 'GetText'
avSvnRevision.cpp:33: error: 'class TiXmlElement' has no member named 'GetText'
AutoVersioning.cpp:27: error: `EVT_COMPILER_STARTED' was not declared in this scope
AutoVersioning.cpp:28: error: expected `}' before "EVT_COMPILER_FINISHED"
AutoVersioning.cpp:28: error: expected `,' or `;' before "EVT_COMPILER_FINISHED"
AutoVersioning.cpp:30: error: expected declaration before '}' token
I can't compile plug in.CodeavSvnRevision.cpp:: In function `bool QuerySvn(const std::string&, std::string&, std::string&)':
avSvnRevision.cpp:32: error: 'class TiXmlElement' has no member named 'GetText'
avSvnRevision.cpp:33: error: 'class TiXmlElement' has no member named 'GetText'
AutoVersioning.cpp:27: error: `EVT_COMPILER_STARTED' was not declared in this scope
AutoVersioning.cpp:28: error: expected `}' before "EVT_COMPILER_FINISHED"
AutoVersioning.cpp:28: error: expected `,' or `;' before "EVT_COMPILER_FINISHED"
AutoVersioning.cpp:30: error: expected declaration before '}' token
Could You provide compiled version?
#include <string>
bool QuerySvn(const std::string& workingDir, std::string& revision, std::string& date);
TiXmlHandle Handle(&doc);
if(const TiXmlElement* e = Handle.FirstChildElement("entry").FirstChildElement("commit").ToElement())
{
revision = e->Attribute("revision") ? e->Attribute("revision") : "";
const TiXmlElement *d = e->FirstChildElement("date");
if(d && d->GetText())
{
date = d->GetText();
}
}
char buf[16384];
memset(buf, 0, 16384);
char buf[16384] = {'\0'};
I got to update the events handling on the plugin because that methods are deprecated in the new codeblocks revision.
What operating system are you using? A compiled version depends on the actual version of codeblocks that you are using and and the wxWidgets library to work.
Is weird that error on the Tiny Xml Class. I don't got that error, may be you are using an old version or newer than I have. I will check this.
If you can provide the actual revision of codeblocks that you are using will be of help to diagnostic the problem. :D
Some advice to the code of avSvnRevision.h
Things that can be removed from this file are :
- the include of wx.h [you don't use anything from wxwidgets in this code, aside use the headers with the things you actually use from wx, don't just include a monster of a header file]
- remove the macro (by the way don't use macros, they are f*** BAD, use a function, a template, ...], but in this case the macro is not used
Other suggestions :
- be const correct and scope limiting : your TinyXmlElement's are const --> put that in the code, and limit their scope, also make use of handle, it will simplify your codeCodeTiXmlHandle Handle(&doc);
if(const TiXmlElement* e = Handle.FirstChildElement("entry").FirstChildElement("commit").ToElement())
{
revision = e->Attribute("revision") ? e->Attribute("revision") : "";
const TiXmlElement *d = e->FirstChildElement("date");
if(d && d->GetText())
{
date = d->GetText();
}
}
- don't use memset when it is not needed, you can easily replace :Codeby :char buf[16384];
memset(buf, 0, 16384);Code- try to avoid magic numbers like '16384' and '16384' and '16383, for sure they are all related, but are they ..., put that magic number in a const variable (no define !!!)char buf[16384] = {'\0'};
I hope you find these tips and code corrections useful. I didn't look at the other source files, I just took a peek for this one wrt compile problem.
Cheers.
Windows XP SP2, C::B Nightly Build form 06 July 07 , wxWidgets 2.8.4. MinGW 5.1.3
namespace AutoVersion{
//Date Version Types
static char DATE[] = "09";
static char MONTH[] = "07";
static char YEAR[] = "2007";
static double UBUNTU_VERSION_STYLE = 7.07;
//Standard Version Types
static long MAJOR = 1;
static long MINOR = 1;
static long BUILD = 118;
static long REVISION = 1067;
//Miscellaneous Version Types
static long BUILDS_COUNT = 212;
#define RC_FILEVERSION 1,1,118,1067
#define RC_FILEVERSION_STRING "1, 1, 118, 1067\0"
static char FULLVERSION_STRING[] = "1.1.118.1067";
}
Hi!
I still have errors compiling plugin, but now some new errors occurred. I can't install compiled plugin too. C::B says that this plugin is compiled with other version of SDK than IDE.
Hi!
I still have errors compiling plugin, but now some new errors occurred. I can't install compiled plugin too. C::B says that this plugin is compiled with other version of SDK than IDE.
:?
Well maybe you haven't defined the $(#cb) variable, or you are trying to compile without compiling first codeblocks from source, also you got to compile the wx library.
Just uploaded my custom compilation of codeblocks with the autoversioning plugin working here (http://areapr.com/autoversioning/codeblocks.7z) right click and save as to download if you want to try it out.
// EDIT:
After using your version of C::B all seams to be ok :) Very nice plugin :D Thx.
And I've noticed one problem: why after compilation od one .cpp file plugin increment build count by 2 or 3?
#ifndef VERSION_H
#define VERSION_H
namespace AutoVersion{
//Date Version Types
static char DATE[] = "12";
static char MONTH[] = "07";
static char YEAR[] = "2007";
static double UBUNTU_VERSION_STYLE = 7.07;
//Software Status
static char STATUS[] = "Alpha";
static char STATUS_SHORT[] = "a";
//Standard Version Type
static long MAJOR = 1;
static long MINOR = 0;
static long BUILD = 9;
static long REVISION = 75;
//Miscellaneous Version Types
static long BUILDS_COUNT = 10;
#define RC_FILEVERSION 1,0,9,75
#define RC_FILEVERSION_STRING "1, 0, 9, 75\0"
static char FULLVERSION_STRING[] = "1.0.9.75";
}
#endif //VERSION_h
Changes File
v0.3.4a
- blah blah
- blah blah
v0.3.3a
- Some fixes
- new features
can i compile it under linux
is it possible
ok i compile it but it wouldn't start
Ubuntu 7.04 my own compile version of codeblocks witg wx2.8.4
Edit:
ERROR: /home/psyhlo/.codeblocks/share/codeblocks/plugins/autoversioning.so: not loaded (missing symbols?)
Edit: Some little mistake in the unix project of autoversioning-contrib.7z on the post-build steps.
This line: zip -j9 ..\..\..\devel\share\codeblocks\autoversioning.zip manifest.xml
should read: zip -j9 ../../../devel/share/codeblocks/autoversioning.zip manifest.xml
thats all.
I have already tested the plugin on ubuntu and it works fine. The tool tips are so smooth... :D
i compile your plugin after compilation of codeblocks rev 4281
and installed with Manage Plugins
How do you compiled codeblocks?this is my way i have only one codeblocks source dir so it is compiled with right sdk version
./bootstrap
./configure
./make
./make install
this is my way i have only one codeblocks source dir so it is compiled with right sdk version
also i used this ./configure --prefix=/usr --with-contrib-plugins=all instead of ./configure
it works!
even compile process complete without any warning
it is such a good plug-in 10x keep the good work
CodeChanges File
v0.3.4a
- blah blah
- blah blah
v0.3.3a
- Some fixes
- new features
:: === AutoVersioning, default ===
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:8: tinyxml/tinyxml.h: No such file or directory
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:: In function `bool QuerySvn(const wxString&, wxString&, wxString&)':
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: `TiXmlDocument' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: (Each undeclared identifier is reported only once for each function it appears in.)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: expected `;' before "doc"
src\src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:30: error: `doc' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:35: error: `TiXmlElement' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:35: error: `e' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:39: error: `d' undeclared (first use this function)
:: === Build finished: 8 errors, 0 warnings ===
It cannot find tinyxml:Code:: === AutoVersioning, default ===
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:8: tinyxml/tinyxml.h: No such file or directory
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:: In function `bool QuerySvn(const wxString&, wxString&, wxString&)':
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: `TiXmlDocument' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: (Each undeclared identifier is reported only once for each function it appears in.)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: expected `;' before "doc"
src\src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:30: error: `doc' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:35: error: `TiXmlElement' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:35: error: `e' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:39: error: `d' undeclared (first use this function)
:: === Build finished: 8 errors, 0 warnings ===
It cannot find tinyxml:Code:: === AutoVersioning, default ===
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:8: tinyxml/tinyxml.h: No such file or directory
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:: In function `bool QuerySvn(const wxString&, wxString&, wxString&)':
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: `TiXmlDocument' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: (Each undeclared identifier is reported only once for each function it appears in.)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:29: error: expected `;' before "doc"
src\src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:30: error: `doc' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:35: error: `TiXmlElement' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:35: error: `e' undeclared (first use this function)
src\plugins\contrib\AutoVersioning\avSvnRevision.cpp:39: error: `d' undeclared (first use this function)
:: === Build finished: 8 errors, 0 warnings ===
Does the $(#CB) Global variable is pointing to "codeblocks-head\trunk\src"? Else try changing this "$(#CB.INCLUDE)" to "$(#CB)\include"
If the problem keeps on, then try to specified all the steps that you made to compile the plugin, and also the file structure (the routes for the codeblocks sources). Some one else had the same problem I think, what could be :? :?:
If no one is able to help me, do you think you could provide a pre-compiled windows copy JGM?
I tried both the AutoVersioning and the autoversioning-contrib files, both give the same error.
my cb global variable points to C:\Installed\CodeBlocks\src
, but I tried pointing it to C:\Installed\CodeBlocks\src\src
and pointing the include variable to C:\Installed\CodeBlocks\src\src\include
More details and download on first post. :DThanks for that - applied that to one of my own projects and it worked quite well so far. :D
Thanks for that - applied that to one of my own projects and it worked quite well so far. :D
BTW: Don't you wanna put this under SVN version control.
but I think that like codeblocks is there I can associate the plugin with codeblocks.More or less - you can reference the C::B project. My intention was only to have all under one place. Thus is you search through BerliOS for C::B you will get the most important parts. Of course other repros are OK, too (like some plugins are also under google code)... Surely completely up to you - what ever is comfortable enough.
Does I'm correct? :?:
Surely completely up to you - what ever is comfortable enough.
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
(I have to update the sources on berlios now :?)In case you did this: I have no more access to the repository. Neither by any client software nor via the BerliOS (anonymous) interface. The error is 403 - access forbidden. I guess you misconfigured something, maybe...?!
In case you did this: I have no more access to the repository. Neither by any client software nor via the BerliOS (anonymous) interface. The error is 403 - access forbidden. I guess you misconfigured something, maybe...?!
Hello, It seems to me that this is usefull plugin for that nice IDE,
but I can't find any link to the sources or binaries, so could smeone give
me a link to the soures or binaries?
D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:: In member function `void AutoVersioning::GenerateChanges()':
D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:642: warning: unused variable 'date'
.objs\avSvnRevision.o:: In function `Z8QuerySvnRK8wxStringRS_S2_':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/avSvnRevision.cpp:28: undefined reference to `TiXmlDocument::Parse(char const*, TiXmlParsingData*, TiXmlEncoding)'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\avSvnRevision.cpp:39: undefined reference to `TiXmlElement::GetText() const'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\avSvnRevision.cpp:40: undefined reference to `TiXmlElement::GetText() const'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning8OnAttachEv':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:92: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:92: undefined reference to `_imp___ZNK7Manager12GetAppWindowEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:97: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:97: undefined reference to `_imp__cbEVT_COMPILER_STARTED'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:97: undefined reference to `_imp___ZN7Manager17RegisterEventSinkEiP17IEventFunctorBaseI15CodeBlocksEventE'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:98: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:98: undefined reference to `_imp__cbEVT_COMPILER_FINISHED'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:98: undefined reference to `_imp___ZN7Manager17RegisterEventSinkEiP17IEventFunctorBaseI15CodeBlocksEventE'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning17OnCompilerStartedER15CodeBlocksEvent':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:130: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:130: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning18OnCompilerFinishedER15CodeBlocksEvent':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:171: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:171: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning13OnTimerVerifyER12wxTimerEvent':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:199: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:199: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:216: undefined reference to `ProjectFile::GetFileState() const'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning20OnMenuAutoVersioningER14wxCommandEvent':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:238: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:238: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning19OnMenuCommitChangesER14wxCommandEvent':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:280: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:280: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning10OnUpdateUIER15wxUpdateUIEvent':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:304: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:304: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning19UpdateVersionHeaderEv':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:418: undefined reference to `_impInfo: resolving vtable for TiXmlDocumentby linking to __imp___ZTV13TiXmlDocument (auto-import)
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:418: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning13CommitChangesEv':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:546: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:546: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioning15GenerateChangesEv':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:628: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:628: undefined reference to `_imp___ZNK7Manager17GetProjectManagerEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:630: undefined reference to `_imp___ZN7Manager3GetEv'
:D:\Letoltes\CodeBlocks\plugin\AutoVersioning\0.7\AutoVersioning.cpp:630: undefined reference to `_imp___ZNK7Manager12GetAppWindowEv'
.objs\AutoVersioning.o:: In function `ZN14AutoVersioningC1Ev':D:/Letoltes/CodeBlocks/plugin/AutoVersioning/0.7/AutoVersioning.cpp:78: undefined reference to `_imp___Z11PlaceWindowP16wxTopLevelWindow17cbPlaceDialogModeb'
.objs\AutoVersioning.o:: In function `ZN9__gnu_cxx13new_allocatorIPN14BlockAllocatorI15CodeBlocksEventLj75ELb0EE11LinkedBlockIS2_EEE10deallocateEPS6_j':C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_vector.h:(.rdata$_ZTV14AutoVersioning[vtable for AutoVersioning]+0x74): undefined reference to `cbPlugin::NotImplemented(wxString const&) const'
)]+0x7):: undefined reference to `_imp___ZN7Manager3GetEv'
)]+0x11):: undefined reference to `_imp___ZNK7Manager16GetPluginManagerEv'
)]+0x3c):: undefined reference to `_imp___ZN13PluginManager14RegisterPluginERK8wxStringPFP8cbPluginvEPFvS4_EPFvPiS9_S9_E'
:: === Build finished: 24 errors, 1 warnings ===
JGM!
When I install Autoversioning 0.8 plugin with Manage plugin dialog, I get an error.
I use C::B SVN 4466, wxWidgets 2.8.4.
Can you help me?
One small change:
- on Linker settings tab, link library wxmsw28u -> wxmsw28u_gcc_cb
Just a small problem under Windows (2000 and XP Pro). There is a misalignment in a Setting window as shown in the attachment.
wxString svncmd = _("svn info --xml --non-interactive ");
_()
_() is used for text which might be translated to other user-languages
wxString svncmd = _T("svn info --xml --non-interactive ");
Thank you for plugin, JGM!
I download (svn) sources from repository now (rev. 4) and found some problems:
- You wrongly being used _("... ...") construction. For example in file avSvnRevision.cpp
Thanks for this plugin! :-)
Is it possible to add ability to insert version data into exe-file info for windows?
- You wrongly being used _("... ...") construction. For example in file avSvnRevision.cpp
Thank you!- You wrongly being used _("... ...") construction. For example in file avSvnRevision.cpp
Fixed and committed to revision 6 :D
Some time ago it was opted to make a plugin named version info to generate the rc file with info from the autoversioning plugin. I was going to make that, but I forgot it. :shock:I think if autoversioning plugin will be able to generate rc file for exe-file version info, it will be great :)
Codeblocks crashes when I try to compile a program and autoversioning is enabled. Nothing displayed in the log window. All is ok if autoversioning is disabled. It's the same problem with version 0.8 windows binary prebuilt, or a 0.82 version I have just built with codeblocks version 4514.
I need it!
Thank you !
// This line in MainFrame.cpp
wxT(AutoVersion::YEAR)
// generate these errors:
MainFrame.cpp:344: error: `LAutoVersion' has not been declared
MainFrame.cpp:344: error: `YEAR' was not declared in this scope
MainFrame.cpp:344: warning: unused variable 'YEAR'
// And not used variables in version.h generate warnings:
.\version.h:9: warning: 'AutoVersion::YEAR' defined but not used
.\version.h:10: warning: 'AutoVersion::UBUNTU_VERSION_STYLE' defined but not used
//...
I beg your pardon if these questions are posted already. I am using wx in unicode, so when I try to convert a char[] static variable to unicode, I get errors:Code// This line in MainFrame.cpp
wxT(AutoVersion::YEAR)
// generate these errors:
MainFrame.cpp:344: error: `LAutoVersion' has not been declared
//wxString to std::string
string ws2s(wxString as){
return string(as.mb_str(wxConvISO8859_1));
}
//std::string to wxString
wxString s2ws(string s){
return wxString((s).c_str(),wxConvISO8859_1);
}
//C string to wxString
wxString cs2ws(const char* s){
return wxString(s,wxConvISO8859_1);
}
CodeMainFrame.cpp:344: error: `YEAR' was not declared in this scope
MainFrame.cpp:344: warning: unused variable 'YEAR'
// And not used variables in version.h generate warnings:
.\version.h:9: warning: 'AutoVersion::YEAR' defined but not used
.\version.h:10: warning: 'AutoVersion::UBUNTU_VERSION_STYLE' defined but not used
//...
I think, warnings could be avoided if the plugin generated a class instead of a namespace.
wxString(AutoVersion::YEAR, wxConvISO8859_1)
#ifndef VERSION_H
#define VERSION_H
namespace AutoVersion{
//Date Version Types
static const char DATE[] = "10";
static const char MONTH[] = "10";
static const char YEAR[] = "2007";
static const double UBUNTU_VERSION_STYLE = 7.10;
//Software Status
static const char STATUS[] = "Alpha";
static const char STATUS_SHORT[] = "a";
//Standard Version Type
static const long MAJOR = 0;
static const long MINOR = 1;
static const long BUILD = 1;
static const long REVISION = 53;
//Miscellaneous Version Types
static const long BUILDS_COUNT = 65;
#define RC_FILEVERSION 0,1,1,53
#define RC_FILEVERSION_STRING "0, 1, 1, 53\0"
static const char FULLVERSION_STRING[] = "0.1.1.53";
}
#endif //VERSION_h
I found a simpler solution for avoiding warning messages. Instead of generating global variables into the namespace, you could generate consts. Moreover, this change prevents the user can change the values accidentally.
C::B crushed on uninstall you plugin. :(
Somebody may confirm it?
Hi JGM!
I have another question. Programs typically use 3 first values for displaying version: major.minor.buildNumber. Last one is autoincremented each time I press F9, so, my About dialog always shows a big unrealistic third number, something like 0.1.146.
I would like to increment them manually when I am releasing a public version (I can do it setting the "Commit changes" flag); but I want the plugin always updates dates and the Build Count, because they are useful in developing stage.
Would be it possible or am I configurating something wrong?
Thanks a lot in advance.
check the first post for downloads or my signature.
The link to the berlios project in your sig isn't correct.
The link to the berlios project in your sig isn't correct.
It works if you add a missing 'g' at the end of the URL
So many thanks for you effort!
I am trying to use the Change log feature. Is it possible to write changes in the log without incrementing the version?. For example. While I am working in the project, I fix a bug, so I want to track the change before I do some other tasks (and before I forget the change's details :D), but I am not ready for incrementing the version yet. So change events could be grouped by date then project version. That is only an idea, it seems laborious to implement...
13 December 2007
released version 1.1.0 of AutoVersioning-Linux
Change log:
-Added: Now the changes log has a data grid
-Applied: Nice drop down menu for the "Type" column
make.exe: Nothing to be done for `all'.
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
1) Why does Build Count increment even if BUILD is NOT DONE as in above message? Could you please fix it? :(
It makes sense that it increments if "Rebuild" is done / "Clean" + "Build" but not the above case.
2) Why does the Revision increment randomly. The use? ofcourse, we can choose not to use it. But still, isn't it redundant?
However, in some circles, it is also understood as:
- major: must be a bigger number than the competitor's product
- minor: increments with every new feature
- release: increments by a random amount in regular intervals, even in absence of changes to code
void AutoVersioning::OnProjectActivated(CodeBlocksEvent& event)
{
if (IsAttached())
{
// switch to the settings of the now activated project [I assume it has already been loaded before this triggers]
m_Project = event.GetProject();
}
}
If I recall correctly that was a problem of codeblocks not notifying the activated project after a workspace is completely loaded.
I 'm not sure what your question exactly is but, trust me, this event gets sent alright.
Another event you might want to check out would be WORKSPACE_CHANGED...
Now, I have found other bug :(, the configuration stored on the project file is not working (to not say loading) fine when loading a workspace instead of a project directly. Im currently checking this.
Now, I have found other bug :(, the configuration stored on the project file is not working (to not say loading) fine when loading a workspace instead of a project directly. Im currently checking this.
Ok, I found what the problem is, bool m_IsCurrentProjectVersioned is a member variable of the main autoversioning class (global variable) and it should be a member of the project struct.
Oh men, this are really silly things :P
or it is not correctly updated during switching of the projects ... ?
Index: src/plugins/contrib/AutoVersioning/AutoVersioning.cpp
===================================================================
--- src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (revision 5005)
+++ src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (working copy)
@@ -65,7 +65,6 @@
ProjectLoaderHooks::HookFunctorBase* AutoVerHook =
new ProjectLoaderHooks::HookFunctor<AutoVersioning>(this, &AutoVersioning::OnProjectLoadingHook);
m_AutoVerHookId = ProjectLoaderHooks::RegisterHook(AutoVerHook);
- m_IsCurrentProjectVersioned = false;
m_Modified = false;
m_Project = 0;
} // end of constructor
@@ -128,11 +127,11 @@
// TODO (KILLERBOT) : should we have default values, in case something would be missing ?
// OPTI : we could choose not to write out default values in the xml --> smaller cbp
avConfig Config;
- m_IsCurrentProjectVersioned = false; // default not active unless we find xml for it
+ m_IsVersioned[project] = false; // default not active unless we find xml for it
const TiXmlElement* Node = elem->FirstChildElement("AutoVersioning");
if (Node)
{
- m_IsCurrentProjectVersioned = true;
+ m_IsVersioned[project] = true;
TiXmlHandle Handle(const_cast<TiXmlElement*>(Node));
if(const TiXmlElement* pElem = Handle.FirstChildElement("Scheme").ToElement())
{
@@ -215,7 +214,6 @@
}
m_ProjectMap[project] = Config;
m_ProjectMapVersionState[project] = VersionState;
- m_Project = project;
}
else
{
@@ -226,7 +224,7 @@
// if plugins that use that element are not loaded atm).
// so, instead of blindly inserting the element, we must first check it's
// not already there (and if it is, clear its contents)
- if(m_IsCurrentProjectVersioned)
+ if(m_IsVersioned[project])
{
TiXmlElement* node = elem->FirstChildElement("AutoVersioning");
if (!node)
@@ -281,7 +279,8 @@
if (IsAttached())
{
m_ProjectMap.erase(event.GetProject());
- m_ProjectMapVersionState.erase(event.GetProject());
+ m_ProjectMapVersionState.erase(event.GetProject());
+ m_IsVersioned.erase(event.GetProject());
if(m_Project == event.GetProject())
{ // should always be the case (??? we hope ??)
m_Project = 0;
@@ -294,7 +293,7 @@
// be activated and each has the compilerstarted/Finished ?????
void AutoVersioning::OnCompilerStarted(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsCurrentProjectVersioned)
+ if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
{
if (m_Modified)
{
@@ -317,7 +316,7 @@
void AutoVersioning::OnCompilerFinished(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsCurrentProjectVersioned)
+ if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
{
++(GetVersionState().Values.BuildCount);
}
@@ -325,7 +324,7 @@
void AutoVersioning::OnTimerVerify(wxTimerEvent& event)
{
- if (m_Project && IsAttached() && m_IsCurrentProjectVersioned)
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
if (!m_Modified)
{
@@ -348,7 +347,7 @@
{
if (m_Project)
{
- if (m_IsCurrentProjectVersioned)
+ if (m_IsVersioned[m_Project])
{
SetVersionAndSettings(*m_Project, true);
UpdateVersionHeader();
@@ -357,8 +356,20 @@
{
if (wxMessageBox(_("Configure the project \"") + m_Project->GetTitle() + _("\" for Autoversioning?"),_("Autoversioning"),wxYES_NO) == wxYES)
{
+ if(wxFileExists(m_Project->GetBasePath() + _T("version.h")))
+ {
+ wxMessageBox(
+ _T("The header version.h already exist on your projects path. "
+ "The content will be overwritten by the the version info generated code."
+ "\n\nYou can change the default version.h file on the \"Settings\" Tab."
+ ),
+ _T("Warning"),
+ wxICON_EXCLAMATION | wxOK
+ );
+ }
+
// we activated
- m_IsCurrentProjectVersioned = true;
+ m_IsVersioned[m_Project] = true;
// just becasue we activated the project becomes modified
m_Project->SetModified();
@@ -382,7 +393,7 @@
void AutoVersioning::OnMenuCommitChanges(wxCommandEvent&)
{
- if (m_Project && IsAttached() && m_IsCurrentProjectVersioned)
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
if(m_Modified)
{
@@ -406,7 +417,7 @@
{
event.Enable(true);
}
- else if (m_IsCurrentProjectVersioned)
+ else if (m_IsVersioned[m_Project])
{
if (m_Modified)
{
@@ -528,9 +539,15 @@
{
m_timerStatus->Stop();
+ //Declares the header guard to be used based on the filename
+ wxFileName filename(cbC2U(GetConfig().Settings.HeaderPath.c_str()));
+ wxString headerGuard = filename.GetName() + _T("_") + filename.GetExt();
+ headerGuard.Replace(_T(" "), _T("_"), true);
+ headerGuard.UpperCase();
+
wxString headerOutput = _T("");
- headerOutput << _T("#ifndef VERSION_H") << _T("\n");
- headerOutput << _T("#define VERSION_H") << _T("\n");
+ headerOutput << _T("#ifndef ") << headerGuard << _T("\n");
+ headerOutput << _T("#define ") << headerGuard << _T("\n");
headerOutput << _T("\n");
if(cbC2U(GetConfig().Settings.Language.c_str()) == _T("C++"))
@@ -610,9 +627,9 @@
headerOutput << _T("}") << _T("\n");
}
- headerOutput << _T("#endif //VERSION_h\n");
+ headerOutput << _T("#endif //") << headerGuard << _T("\n");
- m_versionHeaderPath = FileNormalize(cbC2U(GetConfig().Settings.HeaderPath.c_str()),m_Project->GetBasePath());;
+ m_versionHeaderPath = FileNormalize(cbC2U(GetConfig().Settings.HeaderPath.c_str()),m_Project->GetBasePath());
wxFile versionHeaderFile(m_versionHeaderPath, wxFile::write);
versionHeaderFile.Write(headerOutput);
versionHeaderFile.Close();
@@ -622,7 +639,7 @@
void AutoVersioning::CommitChanges()
{
- if (m_Project && IsAttached() && m_IsCurrentProjectVersioned)
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
if (m_Modified)
{
Index: src/plugins/contrib/AutoVersioning/AutoVersioning.h
===================================================================
--- src/plugins/contrib/AutoVersioning/AutoVersioning.h (revision 5005)
+++ src/plugins/contrib/AutoVersioning/AutoVersioning.h (working copy)
@@ -56,10 +56,10 @@
wxTimer* m_timerStatus;
int m_AutoVerHookId; //!< project loader hook ID
std::map<cbProject*, avConfig> m_ProjectMap;
- std::map<cbProject*, avVersionState> m_ProjectMapVersionState;
+ std::map<cbProject*, avVersionState> m_ProjectMapVersionState;
+ std::map<cbProject*, bool> m_IsVersioned;
cbProject* m_Project; // keeps track of the last 'activated' project
bool m_Modified; // have some settings been modified
- bool m_IsCurrentProjectVersioned;
/// fires when a project is being loaded / saved
void OnProjectLoadingHook(cbProject* project, TiXmlElement* elem, bool loading);
Index: src/plugins/contrib/AutoVersioning/manifest.xml
===================================================================
--- src/plugins/contrib/AutoVersioning/manifest.xml (revision 5005)
+++ src/plugins/contrib/AutoVersioning/manifest.xml (working copy)
@@ -3,7 +3,7 @@
<SdkVersion major="1" minor="10" release="0" />
<Plugin name="AutoVersioning">
<Value title="AutoVersioning" />
- <Value version="1.1" />
+ <Value version="1.2" />
<Value description="Auto 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 and a change log generator.
Example:
@@ -40,7 +40,7 @@
static const char SVN_REVISION[]
static const char SVN_DATE[]
" />
- <Value author="JGM" />
+ <Value author="Jefferson Gonzalez" />
<Value authorEmail="jgmdev@gmail.com" />
<Value authorWebsite="" />
<Value thanksTo="Killerbot - Code Optimizations, conversion from version.ini to project file and many more...
Index: src/plugins/contrib/AutoVersioning/AutoVersioning.cpp
===================================================================
--- src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (revision 5010)
+++ src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (working copy)
@@ -293,7 +293,7 @@
// be activated and each has the compilerstarted/Finished ?????
void AutoVersioning::OnCompilerStarted(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
if (m_Modified)
{
@@ -316,7 +316,7 @@
void AutoVersioning::OnCompilerFinished(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
++(GetVersionState().Values.BuildCount);
}
Index: src/plugins/contrib/AutoVersioning/manifest.xml
===================================================================
--- src/plugins/contrib/AutoVersioning/manifest.xml (revision 5010)
+++ src/plugins/contrib/AutoVersioning/manifest.xml (working copy)
@@ -3,7 +3,7 @@
<SdkVersion major="1" minor="10" release="0" />
<Plugin name="AutoVersioning">
<Value title="AutoVersioning" />
- <Value version="1.2" />
+ <Value version="1.3" />
<Value description="Auto 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 and a change log generator.
Example:
Should I submit a bug to berlios about the OnCompilerStarted event.GetProject() returning a null pointer?
CodeIndex: src/plugins/contrib/AutoVersioning/AutoVersioning.cpp
===================================================================
--- src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (revision 5010)
+++ src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (working copy)
@@ -293,7 +293,7 @@
// be activated and each has the compilerstarted/Finished ?????
void AutoVersioning::OnCompilerStarted(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
if (m_Modified)
{
@@ -316,7 +316,7 @@
void AutoVersioning::OnCompilerFinished(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
++(GetVersionState().Values.BuildCount);
}
Index: src/plugins/contrib/AutoVersioning/manifest.xml
===================================================================
--- src/plugins/contrib/AutoVersioning/manifest.xml (revision 5010)
+++ src/plugins/contrib/AutoVersioning/manifest.xml (working copy)
@@ -3,7 +3,7 @@
<SdkVersion major="1" minor="10" release="0" />
<Plugin name="AutoVersioning">
<Value title="AutoVersioning" />
- <Value version="1.2" />
+ <Value version="1.3" />
<Value description="Auto 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 and a change log generator.
Example:
Ok, I made a bug report (id: 13676), but until the problem is solved the patch #2444 should be applied i think, since now the autoversioning plugin is not working properly:
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2444&group_id=5358
Index: src/plugins/contrib/AutoVersioning/AutoVersioning.cpp
===================================================================
--- src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (revision 5016)
+++ src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (working copy)
@@ -3,6 +3,7 @@
#include <sdk.h>
#ifndef CB_PRECOMP
+#include <wx/dynarray.h>
#include <wx/file.h>
#include <wx/filefn.h>
#include <wx/ffile.h>
@@ -376,10 +377,12 @@
SetVersionAndSettings(*m_Project);
UpdateVersionHeader();
- for (int i = 1; i < m_Project->GetBuildTargetsCount(); ++i)
+ wxArrayInt target_array;
+ for (int i = 0; i < m_Project->GetBuildTargetsCount(); ++i)
{
- m_Project->AddFile(i, m_versionHeaderPath, true, true, 0);
+ target_array.Add(i);
}
+ Manager::Get()->GetProjectManager()->AddFileToProject(m_versionHeaderPath, m_Project, target_array);
Manager::Get()->GetProjectManager()->RebuildTree();
wxMessageBox(_("Project configured!"));
}
I've fixed the bug. So the patch may not be necessary. :)
* Fixed: Refresh the project tree after AutoVersioning plugin configures a project.
When I add the Autoversioning option to my project, it always autoincrement the build num (when i compile the source) It's ok, but the number's also auto incremented when i click the run button in the IDE (or from "Build->Run") . i think it musn't to that !
Did you mean the Build Count?
And for test we make (builds, runs, debugs), you can name the box "Test count" or "Action Count"
What do you think about the patch?
I didn't commit as I wasn't sure whether you want the plugin to be used only for release targets. :)
What do you think about the patch?
I didn't commit as I wasn't sure whether you want the plugin to be used only for release targets. :)
Now I understand your patch, I'm a moron :oops: sorry for that. Well is needed to only add the version.h once and not multiple times. Sorry again :oops:
version.h:10: digit exceeds base
static const double UBUNTU_VERSION_STYLE = 8.08;
#include <iostream>
#include "version.h"
using namespace std;
int main()
{
cout << "Ubuntu Version: " << AutoVersion::UBUNTU_VERSION_STYLE << endl;
return 0;
}
Ubuntu Version: 8.08
I am using an .rc file with windows, and I would like to be able to put my SVN revision into my output file. Unfortunately, autoversion does not define SVN revision numbers (just declarations)
Could you add a define with the SVN revision?
thanks in advance!
I'm aware of the improved type checking, however there are a number of things I can't do with const values, like conditional compiling and other compile time stuff like string concatenation, etc. Also anything which goes into an .rc file.notte that some things of conditional compiling can be done with regular code (implementation of interfaces). Unless you are at the driver level, it is good practice to avoid #ifdef. And it is possible to do that ;-)
For me it would be really helpful to have these defines.
Maybe it's possible to NOT create them by default, unless some config option is enabled,
Any chance?
notte that some things of conditional compiling can be done with regular code (implementation of interfaces). Unless you are at the driver level, it is good practice to avoid #ifdef. And it is possible to do that ;-)
Index: AutoVersioning.cpp
===================================================================
--- AutoVersioning.cpp (revision 5189)
+++ AutoVersioning.cpp (working copy)
@@ -571,7 +571,7 @@
actualDate.Format(_T("%y")).ToLong(&ubuntuYearNumber);
wxString ubuntuYear;
ubuntuYear.Printf(_T("%d"),ubuntuYearNumber);
- headerOutput << _T("\t") << _T("static const double UBUNTU_VERSION_STYLE = ") << ubuntuYear << actualDate.Format(_T(".%m")) << _T(";\n");
+ headerOutput << _T("\t") << _T("static const char UBUNTU_VERSION_STYLE[] = \"") << ubuntuYear << actualDate.Format(_T(".%m\"")) << _T(";\n");
headerOutput << _T("\t") << _T("\n");
}
@@ -612,7 +612,7 @@
{
wxString revision,date;
if (!QuerySvn(cbC2U(GetConfig().Settings.SvnDirectory.c_str()), revision, date))
- wxMessageBox(_("Svn configuration files not found.\nVerify the Autoversioning svn directory."),_("Error"),wxICON_ERROR);
+ wxMessageBox(_("Possible Causes:\n-You don't have SVN installed.\n-Incompatible version of SVN.\n-SVN configuration files not found.\n\nVerify the Autoversioning svn directory."),_("SVN Error"),wxICON_ERROR);
headerOutput << _T("\t") << _T("\n");
headerOutput << _T("\t") << _T("//SVN Version") << _T("\n");
headerOutput << _T("\t") << _T("static const char SVN_REVISION[] = ") << _T("\"") + revision + _T("\"")<< _T(";\n");
Index: AutoVersioning-unix.cbp
===================================================================
--- AutoVersioning-unix.cbp (revision 5189)
+++ AutoVersioning-unix.cbp (working copy)
@@ -46,7 +46,6 @@
<Unit filename="avSvnRevision.h" />
<Unit filename="avVersionEditorDlg.cpp" />
<Unit filename="avVersionEditorDlg.h" />
- <Unit filename="license.txt" />
<Unit filename="manifest.xml" />
<Extensions>
<code_completion />
#ifndef VERSION_H
#define VERSION_H
namespace AutoVersion{
//Date Version Types
static const char AV_DATE[] = "09";
static const char AV_MONTH[] = "10";
static const char AV_YEAR[] = "2009";
static const char AV_UBUNTU_VERSION_STYLE[] = "9.10";
//Software Status
static const char AV_STATUS[] = "Alpha";
static const char AV_STATUS_SHORT[] = "a";
//Standard Version Type
static const long AV_MAJOR = 1;
static const long AV_MINOR = 0;
static const long AV_BUILD = 2;
static const long AV_REVISION = 11;
//Miscellaneous Version Types
static const long AV_BUILDS_COUNT = 1;
#define AV_RC_FILEVERSION 1,0,2,11
#define AV_RC_FILEVERSION_STRING "1, 0, 2, 11\0"
static const char AV_FULLVERSION_STRING[] = "1.0.2.11";
//These values are to keep track of your versioning state, don't modify them.
static const long AV_BUILD_HISTORY = 2;
}
#endif //VERSION_H
AutoVersioning 1.3Applied in trunk after testing... Thanks! :-)
Hi
Need some help
I have SVN 1.5.5 and TortoiseSVN 1.6.5
I have checked out some code using TortoiseSVN 1.6.5;
SVN.exe is in path
I cannot use svn revision in the version file.
The config dialog always gives me error, svn configuration files not found.
whereas all .svn files and folders are there.
Ajay
Hi
Need some help
I have SVN 1.5.5 and TortoiseSVN 1.6.5
I have checked out some code using TortoiseSVN 1.6.5;
SVN.exe is in path
I cannot use svn revision in the version file.
The config dialog always gives me error, svn configuration files not found.
whereas all .svn files and folders are there.
Ajay
Hi
I'm sorry to have to ask for help with this useful plug-in, but I have the same problem.
I searched in the C::B documentation, search on google, but I didn't find any information.
I think I really don't understand what I have to put in the field "current SVN directory".
I have tried to use the bin directory of subversion, the global directory of subversion, the directory of the project for which I want to try this feature, and the .svn directory in the project's directory, but this is all the time the same error... "Svn configuration files not found. Verify the Autoversioning svn directory."
AutoVersioning 1.3Applied in trunk after testing... Thanks! :-)
//Standard Version Type
static const long AV_MAJOR = 1;
static const long AV_MINOR = 0;
static const long AV_BUILD = 2;
static const long AV_REVISION = 11;