Author Topic: AutoVersioning Plugin  (Read 211169 times)

Offline mp

  • Single posting newcomer
  • *
  • Posts: 7
Re: AutoVersioning Plugin
« Reply #30 on: July 09, 2007, 12:58:58 am »
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

Windows XP SP2, C::B Nightly Build form 06 July 07 , wxWidgets 2.8.4. MinGW 5.1.3
« Last Edit: July 09, 2007, 01:02:36 am by mp »

Offline The-Kenny

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: AutoVersioning Plugin
« Reply #31 on: July 09, 2007, 03:47:21 am »
I get the same error every Time I try to compile the Plugin:
Windows XP Home, C::B Nightly Build rev4235 (The same as mp), wxWidgets 2.8.4, minGW 5.1.3.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #32 on: July 09, 2007, 03:54:05 am »
Some advice to the code of avSvnRevision.h

Followed almost all your suggestions  :)

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]

I was testing and going to convert that function from standard c++ to wxWidgets and forgot to remove that header and also the defines, thanks for the fact  :D

  - 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

Meennn you really hate #defines  :shock:

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 code
Code
  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();
    }
  }

  - don't use memset when it is not needed, you can easily replace :
Code
        char buf[16384];
        memset(buf, 0, 16384);
by :
Code
        char buf[16384] = {'\0'};
  - 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 !!!)


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.

I just took the code from the codeblocks source code /build_tools/autorevision.cpp and not make any big modifications, but they are now done.

Well at last, updated the source code, everybody can find it in the first post :P

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #33 on: July 09, 2007, 03:56:38 am »
Windows XP SP2, C::B Nightly Build form 06 July 07 , wxWidgets 2.8.4. MinGW 5.1.3

Uploaded a compiled version, you can check if it works with your configuration (link in the first post)

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #34 on: July 09, 2007, 03:54:39 pm »
Man the version.h was compiling find but now it gave me an error while compiling my current project.

The error was declaring the dates variables date and month as long like this:
        static long DATE_VERSION = 09; //Declaration incorrect by the zero
   static long MONTH_VERSION = 07; //The same here

So updated the output to this:
Code
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";

}

As you can see I also shortened the variables names, because while using the plugin noted the unnecessary long names :oops:

So updated source code in the first post as compiled version for windows. And sorry for so many mistakes

Offline mp

  • Single posting newcomer
  • *
  • Posts: 7
Re: AutoVersioning Plugin
« Reply #35 on: July 09, 2007, 05:56:53 pm »
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.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #36 on: July 09, 2007, 06:46:12 pm »
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 right click and save as to download if you want to try it out.
« Last Edit: July 13, 2007, 04:07:52 am by JGM »

Offline mp

  • Single posting newcomer
  • *
  • Posts: 7
Re: AutoVersioning Plugin
« Reply #37 on: July 09, 2007, 08:02:08 pm »
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 right click and save as to download if you want to try it out.

I've defined variable, I've got compiled wxWidgets library, but i don't have compiled c::b by my self, only downloaded form forum.
Thanks for your C::B, i will try it later and post results.

// 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?
« Last Edit: July 10, 2007, 06:18:14 pm by mp »

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #38 on: July 10, 2007, 08:14:36 pm »
// 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?

I don't understand clearly what you mean but:

This variable is for keeping track of all the compilations that we do while working, Is just for our eyes to know how many work we have done, I just thought it will be a nice feature (also for our work reports  :D). But the revision and build (not build_count) increments only when a file had been modified. If you put the mouse pointer on each textbox it shows the scheme that I implemented.

The scheme is the following:

  - Revision increments by a random number up to 10 every time a modification is made.
  - Build number increments when revision increments by 1.
 
If auto increment is marked:
  - Minor is incremented by 1 each time the build number reach a barrier of 100 and reset to 0 on 10.
  - Major is incremented by 1 each time the minor reach 10.

if dates is marked:
  - Generates variables with the current date of compilation.

if svn marked:
  - search in the directory selected for revision number and date and generates the appropriate variables.

I'm thinking of implementing another window for customizing the current scheme but i will work on this later. :D

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #39 on: July 11, 2007, 09:03:57 pm »
Added new version with an option to commit changes before auto-incrementing and some minor fixes. :)

Check first post for download.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #40 on: July 12, 2007, 08:25:04 pm »
Added variables for declaring the software status like beta, etc...

Updated the version editor and added a notebook to divide by categories.

Check the first post for downloads.

New output
Code
#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
« Last Edit: July 12, 2007, 08:27:39 pm by JGM »

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #41 on: July 13, 2007, 04:37:00 am »
Some minor fixes and now going to v0.4.1

Check the first post for downloads.  :lol:

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #42 on: July 18, 2007, 04:21:10 pm »
Added new features for editing the current scheme and new menu entries. Also added project files for the contrib svn codeblocks.

I'm thinking on adding a report generator for each incrementation made by a commitment.  :?:

For example, if you are working on a project and made changes, then you commit, when you commit you will have the option to write the changes that you have made to the project on the actual version incrementation, and software status. Something like the typical CHANGES file like this:

Code
Changes File

v0.3.4a
  - blah blah
  - blah blah

v0.3.3a
  - Some fixes
  - new features

If somebody have suggestions and recommendations, please share them. I don't know if the plugin needs other features, or is useless, share your thoughts.  :)

Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: AutoVersioning Plugin
« Reply #43 on: July 19, 2007, 08:07:15 am »
can i compile it under linux
is it possible

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #44 on: July 19, 2007, 03:22:40 pm »
can i compile it under linux
is it possible

Yes! I have already compile it on ubuntu 7.04 and works fine.