Author Topic: AutoVersioning Plugin  (Read 185730 times)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: AutoVersioning Plugin
« Reply #150 on: April 23, 2008, 07:29:13 pm »
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

I've fixed the bug. So the patch may not be necessary. :)

I've fixed another minor bug in AutoVersioning plugin.



I think this patch is also necessary. If there are more than 2 targets, then the version.h will be added more than once.

Code
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!"));
                 }
« Last Edit: April 23, 2008, 07:31:25 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #151 on: April 23, 2008, 08:00:15 pm »
I've fixed the bug. So the patch may not be necessary. :)

That was fast :D

Quote
* Fixed: Refresh the project tree after AutoVersioning plugin configures a project.

Nice! Thanks!

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: AutoVersioning Plugin
« Reply #152 on: April 24, 2008, 01:38:55 pm »
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. :)
Be a part of the solution, not a part of the problem.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #153 on: April 24, 2008, 05:19:40 pm »
Um, the only problem is that the plugin would need to be completely modified to be able to handle multiple targets and save a different header file path for multiple targets, then store different autoversioning configurations on the project file for each target. Ask the user which target to configure, what is not capable since it's working on a project global manner.  I think is more than that patch. :?

But maybe I don't completely understand what you say and I'm wrong. :)

Offline rododox

  • Single posting newcomer
  • *
  • Posts: 7
Re: AutoVersioning Plugin
« Reply #154 on: May 25, 2008, 02:23:20 pm »

Hi

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 !

I'm using codeblocks under windows xp sp2, and i tried the autoversioning with the 8.02 release and the nightly build of 19/05/2008

thanks

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #155 on: May 26, 2008, 05:18:21 am »
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?
if yes then this value is to keep track of all test we make (builds, runs, debugs).

For the exact number of builds you should use Build Number.

I should change the Build Count label to something else (Concurrent Builds?) any suggestions are welcome since this is causing confusion :P

Offline rododox

  • Single posting newcomer
  • *
  • Posts: 7
Re: AutoVersioning Plugin
« Reply #156 on: May 26, 2008, 07:16:21 pm »
Quote
Did you mean the Build Count?

Yes, I mean "Build Count". I'm just a student and my english is not perfect but I think "Build Count" means the number of times we have build a project or , at least the number of times we have used the "make" command
I think it can be useful to have a box that autoincrement everytime we build (just building or rebuilding, without cleaning) the project , and his name can be... Build Count!!
And for test we make (builds, runs, debugs), you can name the box "Test count" or "Action Count"

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #157 on: June 04, 2008, 11:44:34 pm »
And for test we make (builds, runs, debugs), you can name the box "Test count" or "Action Count"

Sorry for the delay, I have been busy developing 3 newspaper website with drupal and programming with php  :D
Didn't answered you since I really want to update the autoversioning plugin before, but didn't have the time to checkout some sources to create the appropriate patch. But well, thats a nice suggestion, "Action Count"  :) I have to update somethings as the documentation.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #158 on: June 04, 2008, 11:49:08 pm »
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:

Offline Arjan

  • Single posting newcomer
  • *
  • Posts: 3
Re: AutoVersioning Plugin
« Reply #159 on: June 23, 2008, 02:17:31 pm »
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!

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: AutoVersioning Plugin
« Reply #160 on: June 23, 2008, 05:15:38 pm »
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:

Sorry I didn't notice your reply. I have applied it in SVN. :)
Be a part of the solution, not a part of the problem.

Offline Belgabor

  • Multiple posting newcomer
  • *
  • Posts: 91
Re: AutoVersioning Plugin
« Reply #161 on: July 13, 2008, 05:28:56 am »
I recommend clarifying the svn error message. In many cases the directory isn't set wrong, but the user has not installed svn.exe (or forgot to update it to 1.5 along with TortoiseSVN as in my case...).

Offline Arjan

  • Single posting newcomer
  • *
  • Posts: 3
Re: AutoVersioning Plugin
« Reply #162 on: August 01, 2008, 02:37:39 pm »
As of today I got a problem with the autoversioning plugin.
Since it is now august, the Ubuntu version style has bumped up to 8.08;
I now get the following error message

Quote
version.h:10: digit exceeds base

pointing at this line:

Code
static const double UBUNTU_VERSION_STYLE = 8.08;

If I change the date back to July, the problem disappears again (ie. the version becomes 8.07). I can't explain this, but since it is related to the autoversioning plugin, I thought I should post it here.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #163 on: August 01, 2008, 06:26:48 pm »
Hi,

I made a test on linux (ubuntu hardy) with gcc 4.2.3 and it worked as expected, here is the code I used.

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

using namespace std;

int main()
{
    cout << "Ubuntu Version: " << AutoVersion::UBUNTU_VERSION_STYLE << endl;
    return 0;
}

Outputs:
Quote
Ubuntu Version: 8.08

Can you give more details?
  • What compiler
  • Operating System
  • Example Code

Maybe is the compiler.

Offline Arjan

  • Single posting newcomer
  • *
  • Posts: 3
Re: AutoVersioning Plugin
« Reply #164 on: August 05, 2008, 11:41:30 am »
compiler: $ ./g++.exe --version
g++.exe (GCC) 4.3.0 20080305 (alpha-testing) mingw-20080502
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

not sure how 4.3.0 got into my standard compile path, but this was indeed the problem.
With gcc 3.4.2 everything compiles as it should.

OS is windows btw.

So it's probably a compiler bug, but I would like to point out my previous post

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!