Author Topic: Build Versioning Plugin  (Read 7446 times)

Offline tekel

  • Single posting newcomer
  • *
  • Posts: 5
Build Versioning Plugin
« on: November 06, 2006, 05:02:49 pm »
I just wanted to see if there was any intrest in a new plugin to Automatically add build information to
Files, and Incorporate that into the building of projects, much like Dev's Project Version Info.

currently I use a small Python script I hacked together. Would it be worth it to port it to a full fledged plugin ?

python script attached


[attachment deleted by admin]

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Build Versioning Plugin
« Reply #1 on: November 06, 2006, 05:18:49 pm »
I already thought about such plugin, but never found time to make it (well, actually to finish it, because I already started..)

So I am still interesting when such plugin will come.
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: Build Versioning Plugin
« Reply #2 on: November 06, 2006, 05:50:52 pm »
i'd also be interested in such a plugin.
i currently use a tool called AutoBuildNumber in a pre-build step, it doesn't do everything that you're suggesting, but perhaps the source would help.

http://code.google.com/p/autobuildnumber

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Build Versioning Plugin
« Reply #3 on: November 06, 2006, 06:05:18 pm »
To me, such a functionality is quite useless, as you are normally not interested in a number for every build, but in a number for a certain change set. Or, in other words, you don't count a "build" every time you hit the gear icon after changing one line, but for every milestone that you pass.

But, that's exactly what every decent revision control set offers for free. If you do anything serious, you don't get aroud using a revision control system anyway.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline tekel

  • Single posting newcomer
  • *
  • Posts: 5
Re: Build Versioning Plugin
« Reply #4 on: November 06, 2006, 06:35:41 pm »
Well if you look at my script it integrates with SVN and updates the files as per their SVN revision number. Also it only runs during special build targets (pre-build of release). It actually quite useful for working with third party's that don't necessarily have access to the source tree

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Build Versioning Plugin
« Reply #5 on: November 06, 2006, 08:45:46 pm »
My capability of reading perl scripts without getting fits of agony is limited (at least you are one of the few perl programmers that know that the language actually supports line breaks and indentation :) ), so please be patient with me if I don't understand correctly what it's doing. ;)

Isn't it that this script opens a source file, parses it line by line, and fills in the revision number that it got from svn?

That's exactly what keyword substitution does. However, keyword substitution is portable and reliable, unlike all home-made implementations.

If you regularly read the forums, then you'll have read how much pain we are having with the autorevision tool. This is another home-brewn tool doing stuff that actually the revision control system should do, and would probably do better in many places.
The reason why I made autorevision in the first place was that we wanted to have one revision number for the whole project which is the latest revision of all files. Keyword substitution takes the per-file revision number (as your tool does, too), which is unluckily not the best thing to use for displaying a revision number in the about box (to work around, one would have to mark one file dirty in every commit, but that's even worse!).
Also, autorevision provides a fallback functionality for users who don't have svn installed, which is causing more problems than it is actually worth (because of localisation/languages/encodings).

All in all, I can only say that there are many good reasons for using keyword substitution, and few good reason to use anything else. And if you use anything else, my experience is that it causes problems sooner or later.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Build Versioning Plugin
« Reply #6 on: November 06, 2006, 10:56:21 pm »
First Thomas, he is talking about python :P
Second, I didn't read well :P I never readed anything about an autobuild number.
But a nice thing that such a plugin can do is creating a rc file with file information (like the DevCPP one ;))
It is easier then creating by hand, especialy when you don't know how it works.
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Build Versioning Plugin
« Reply #7 on: November 07, 2006, 10:03:24 am »
First Thomas, he is talking about python :P Second, I didn't read well :P
Me neither, as has been shown :P  But it could as well have been perl or ruby, to me they're all widely the same, I have difficulties reading either and don't ever use them because of that.

But seriously, if you think such a plugin is a good thing, then go ahead :)
It's just that I want to warn you of the grief that is ahead. I've already got myself a bloody nose on autorevision, which basically does the same (gets a number from svn and writes it into a file).
Such a thing may be a little less pain when writing a python script because python libraries probably have a native subversion binding, so you have nothing to parse, but in C++, it is a nightmare.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Build Versioning Plugin
« Reply #8 on: November 08, 2006, 12:37:34 am »
Python is more readable than C++ once you have a little practice (have you tried reading template meta programs), but he used plenty of nested conditions, and unusual #end type style for blocks (never seen that before), and no standard python main.  He is also using the subversion libraries directly (which I suggested above) through pysvn, no nasty string parsing needed.  So if you goal is not to use the subversion libraries then this won't help.  That said, pysvn is a very nice binding for subversion, makes it quite easy to automate SVN related tasks.  I use it to keep things like firefox and thunderbird profiles checked in without having to do lots of manual work.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6995
    • My Best Post
Re: Build Versioning Plugin
« Reply #9 on: November 08, 2006, 01:00:35 am »
Have you looked at rapidsvn svncpp classes? I have but I am just starting on C++ and it was too hard to follow for me. Note: They have NOT released a 1.4 compatible version yet.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Build Versioning Plugin
« Reply #10 on: November 08, 2006, 06:18:44 am »
That is quite odd considering subversion 1.4 is not supposed to make any API breaking changes only add new functions.  I don't think the problem is the C api is to hard to use (it should be quite easy to accomplish this task) its that I think Thomas wants to be able to do it without the libraries or he had trouble getting to work properly.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6995
    • My Best Post
Re: Build Versioning Plugin
« Reply #11 on: November 08, 2006, 09:34:00 am »
That is quite odd considering subversion 1.4 is not supposed to make any API breaking changes only add new functions.  I don't think the problem is the C api is to hard to use (it should be quite easy to accomplish this task) its that I think Thomas wants to be able to do it without the libraries or he had trouble getting to work properly.

Correction, I followed wrong link, the bug is still open.

http://rapidsvn.tigris.org/issues/show_bug.cgi?id=446

Tim S
« Last Edit: November 08, 2006, 09:38:15 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Build Versioning Plugin
« Reply #12 on: November 08, 2006, 02:17:53 pm »
Yes, but the bug is "make use of the new stuff in 1.4", not "It won't work with 1.4!!11!!" ;).

Online stahta01

  • Lives here!
  • ****
  • Posts: 6995
    • My Best Post
Re: Build Versioning Plugin
« Reply #13 on: November 09, 2006, 11:11:41 pm »
Yes, but the bug is "make use of the new stuff in 1.4", not "It won't work with 1.4!!11!!" ;).

I use more than one SVN client, to use one with 1.4 they all must support 1.4 if you wish to work on the same folders. (RapidSVN and TortoiseSVN)

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org