News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

AutoVersioning Plugin

Started by JGM, June 27, 2007, 08:18:25 PM

Previous topic - Next topic

Biplab

#150
Quote from: JGM on April 23, 2008, 06:02:30 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.

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!"));
                 }
Be a part of the solution, not a part of the problem.

JGM

Quote from: Biplab on April 23, 2008, 07:29:13 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!

Biplab

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.

JGM

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. :)

rododox


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

JGM

Quote from: rododox on May 25, 2008, 02:23:20 PM
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

rododox

QuoteDid 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"

JGM

Quote from: rododox on May 26, 2008, 07:16:21 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.

JGM

Quote from: Biplab 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. :)

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:

Arjan

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!

Biplab

Quote from: JGM on June 04, 2008, 11:49:08 PM
Quote from: Biplab 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. :)

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.

Belgabor

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...).

Arjan

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

Quoteversion.h:10: digit exceeds base

pointing at this line:

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.

JGM

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.


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

using namespace std;

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


Outputs:
QuoteUbuntu Version: 8.08

Can you give more details?

  • What compiler
  • Operating System
  • Example Code

Maybe is the compiler.

Arjan

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

Quote from: Arjan 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!