Author Topic: AutoVersioning Plugin  (Read 185727 times)

Offline riban

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: AutoVersioning Plugin
« Reply #165 on: August 06, 2008, 09:07:55 pm »
I also suffer from the problem described where the Ubuntu style date of 8.08 gives a compile error of "digit exceeds base". If I recompile immediately afterwards, the error does not occur. This is using gcc 3.4.5 (mingw-vista special) on winxp inside CodeBlocks 8.02. The problem does seem to have started in August. It is as if the compiler sees this as an ocatal value hence a vaule of 8 is too high (0 - 7). It is very odd that this error occurs only the first time after each edit. Second compile is always okay.
Further investigation show it is windres that is throwing up the error. I haven't yet found how to deal with this. It seems that including version.h in resources.rc upsets windres when there is a number defined with a leading 0 which I guess windres is interpreting as an octal number. I am currently trying to remove the Ubuntu style stuff from the plugin as I don't need it anyway.
« Last Edit: August 07, 2008, 01:01:45 am by riban »

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #166 on: August 07, 2008, 01:35:04 am »
Thanks!

I will change the code to generate the declaration as a string instead of a numeric value.
That should fix it i think.

Offline MaxLondon

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: AutoVersioning Plugin
« Reply #167 on: August 09, 2008, 11:44:32 pm »
Hi,

AutoVersioning is a really useful plugin for me. So, thanks for having developed it :)


How difficult would it be to include Preprocessor #define's of the values, especially of the version and build numbers and status?

e.g.:

#define DEF_MAJOR "1"
#define DEF_MINOR "2"
#define DEF_BUILD "3"
#define DEF_REVISION "4"

#define DEF_BUILDS_COUNT "5"

#define DEF_STATUS "Beta"
#define DEF_STATUS_SHORT "b"

It would be also nice to have the date as preprocessor defines:

#define DEF_DATE "09"
#define DEF_MONTH "08"
#define DEF_YEAR "2008"


Well that's basically all of the other values, just specified as preprocessor defines :).
For some values it would also be nice, to have them defined as numbers instead of strings.

For me these defines would be really helpful, and it shouldn't really hurt anyone.

So, let me know what you think.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: AutoVersioning Plugin
« Reply #168 on: August 10, 2008, 09:56:56 am »
that was really done on purpose.

Remember pp-defines are kind of bad. The circumvent the entire type system of C++.

The const values are really much better ;-)

Offline MaxLondon

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: AutoVersioning Plugin
« Reply #169 on: August 11, 2008, 03:48:03 pm »
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.

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?

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #170 on: August 12, 2008, 03:40:34 am »
Sorry i have been out of c++ programming these days since im running my own business and lot of work. I want to make some changes to the plugin, also some one emailed me that the DATE variable is declared on some linux headers with the same name and is having conflicts. I have all in my todo list.

I will try to work on it this week or the next one. I will try to add the defines as a option also. Also i want to work on codepacks plugin, I need to write some documentation for codepacks and reorganize some sources since i should work in conjunction with other good developer that contacted me to join forces  :D

Sorry for being so lazy  :cry:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: AutoVersioning Plugin
« Reply #171 on: August 12, 2008, 07:47:28 am »
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.

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

Offline MaxLondon

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: AutoVersioning Plugin
« Reply #172 on: August 12, 2008, 01:42:13 pm »
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 ;-)

I have to maintain several slightly different versions of an application. For me conditional compiling is a decent way to handle this, with reasonable amount of additional effort.

Also, how would you handle Logging functions or anything you need in your debug build but don't want in your release build without using #ifdef's or PP macros? Also as mentioned before, how would you do this with .rc files?

I'm not aware of a elegant way to implement this in C++ without using the PP directives. If there's a better way please let me know. ;-)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: AutoVersioning Plugin
« Reply #173 on: August 12, 2008, 03:02:19 pm »
IMO there should be an option to generate code in C/C++ style.

PP directives, if used carefully can produce better code. But if anyone uses it to write functions which require type checking, it's the fault of that programmer; not of pre-processor. A good programmer shall be aware of such limitations and use the available features accordingly.

Would any one stop using pointers just because it may produce fatal crash in some cases (deleting null pointer)?? A good programmer should go for a check of null pointer wherever required; not avoiding the pointers all together.

C/C++ both can't provide automated garbage collection. I don't think people are going to stop using it in future because of this. Rather people will code accordingly keeping this limitation in mind.

I disagree with the philosophy that anything related to C should be avoided.
« Last Edit: August 12, 2008, 03:04:24 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: AutoVersioning Plugin
« Reply #174 on: August 12, 2008, 05:49:15 pm »
say you create a log interface 'ILoggingInterface'. For simplicity say only 1method Log(std::string Something)

==> void ILoggingInterface::Log(std::string Something)


==>make abstract class ILoggingInterface;


Implement in 1 set of files which actually do something., say a.cpp, and a dummy empty version :b.cpp.

In your Debug target you say to use a.cpp, and in the Release you say to use b.cpp.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #175 on: August 19, 2008, 08:24:16 pm »
I have made a little patch for autoversioning.

-Ubuntu style version now declared as string instead of double.
-Added more possible causes to the svn error message box.
-Removed license file from unix project file.

I will work later to add an AV_ prefix to the declarations on C mode, since somebody wrote about conflicts with some linux headers or something like that with the date declaration.

Code
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 />

[attachment deleted by admin]

PathFinder_Cate

  • Guest
Re: AutoVersioning Plugin
« Reply #176 on: February 02, 2009, 08:09:32 pm »
I'm having a small problem compiling with AutoVersioning turned on (while compiling in Windows).
AutoVersioning uses "DATE" to refer to the day of the month while the Windows include file
"wtypes.h" defines DATE as:

typedef double DATE;

The AutoVersioning plugin should use either "DAY" or a user-selected
variable to avoid this conflict:

   //Date Version Types
   static const char DAY[]   = "02";
   static const char MONTH[] = "01";
   static const char YEAR[]  = "2009";

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: AutoVersioning Plugin
« Reply #177 on: February 05, 2009, 01:37:20 am »
thats when generating the header file on c instead of c++?

Offline riban

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: AutoVersioning Plugin
« Reply #178 on: July 24, 2009, 12:42:00 am »
Is there a way to trigger AutoVersion to start working when a new project is created from a wizard? I have a wizard that creates a project. The wizard adds AutoVersion info to the project but this is not used until the project is closed and re-opened. I want to be able to run the wizard and then for AutoVersion to start working straight away. I can't find a way to trigger this from the wizard script.

Offline ajaywazir

  • Single posting newcomer
  • *
  • Posts: 6
Re: AutoVersioning Plugin
« Reply #179 on: September 03, 2009, 06:19:21 pm »
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