Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Generating version header file with SVN on server
Generating version header file with SVN on server [message #23340] Mon, 12 October 2009 10:26 Go to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Some time ago we had wiscussion how could we determine version number on server and include it into U++ code automatically.

Recently I came across some site and saw a kind of solution:

1) Use svnlook utility to get the string containing revision number:
> svnlook youngest <path_to_repository>

2) get it to generate simple header file (actual call depends on OS you use). Actually we may have something like:

revision.h
----------
#define UPP_REVISION 1650
Re: Generating version header file with SVN on server [message #23341 is a reply to message #23340] Mon, 12 October 2009 10:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Mon, 12 October 2009 04:26

Some time ago we had wiscussion how could we determine version number on server and include it into U++ code automatically.

Recently I came across some site and saw a kind of solution:

1) Use svnlook utility to get the string containing revision number:
> svnlook youngest <path_to_repository>

2) get it to generate simple header file (actual call depends on OS you use). Actually we may have something like:

revision.h
----------
#define UPP_REVISION 1650



Or you can use svnversion to the same effect. But that was not the problem..
Re: Generating version header file with SVN on server [message #23342 is a reply to message #23341] Mon, 12 October 2009 11:17 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Sorry, looks like I disremembered. What was the main problem?
Re: Generating version header file with SVN on server [message #23402 is a reply to message #23342] Fri, 16 October 2009 21:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Mon, 12 October 2009 05:17

Sorry, looks like I disremembered. What was the main problem?


The problem is "build from sources in theide". Something has to create that header. Should it be the build process or what?

If the build process, another problem is that the thing should be universal, working for your projects too. But in that case you have more than single repo and more than single version. Etc...

Mirek
Re: Generating version header file with SVN on server [message #23403 is a reply to message #23402] Fri, 16 October 2009 22:58 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

luzr wrote on Fri, 16 October 2009 23:35

1. The problem is "build from sources in theide". Something has to create that header. Should it be the build process or what?

If the build process, another problem is that the thing should be universal, working for your projects too. But in that case you have more than single repo and more than single version. Etc...

Mirek

1. I suppose it could be something like cron utility calling script which calls svnversion and generates .h-file.

2. If you want portable solution, you may use optional .rc file and rc.exe with /inc switch, which will autoincrement build number (TheIDE could do it automatically).
Specifically ide package could take build number from svnversion generated .h file and put it into .rc to make solution compatible (server generates .h, client copy just uses it; or if it is not present, just use autoincrement from build 0001).

[Updated on: Fri, 16 October 2009 23:02]

Report message to a moderator

Re: Generating version header file with SVN on server [message #23422 is a reply to message #23403] Sun, 18 October 2009 20:31 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Fri, 16 October 2009 16:58

luzr wrote on Fri, 16 October 2009 23:35

1. The problem is "build from sources in theide". Something has to create that header. Should it be the build process or what?

If the build process, another problem is that the thing should be universal, working for your projects too. But in that case you have more than single repo and more than single version. Etc...

Mirek

1. I suppose it could be something like cron utility calling script which calls svnversion and generates .h-file.



Cron running where?

BTW, note that nightly builds HAVE this version stuff working. version.h is created before building.

In fact, it would not be that hard to add a simple script that updates version.h in svn after each commit. Maybe I am just too selfish there, demanding "actual" version of theide, not the last svn version.... Smile

Mirek
Previous Topic: German language added to Docking.t of bazar/Docking
Next Topic: Debug and Build U++ from existing code
Goto Forum:
  


Current Time: Sat Apr 20 11:50:26 CEST 2024

Total time taken to generate the page: 1.05172 seconds