Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > get svn version

Reply
Thread Tools

get svn version

 
 
Alessandro Rossi
Guest
Posts: n/a
 
      06-06-2005
Hi,
Does anybody can help me in this problem?
I have a java project under subversion (I access it from eclipse by
subclipse). I would like that every time I commit some changes (and so
the version number increase) a properties file should be modified with
the actual version number.

Is it possible?
Thank you
Alessandro Rossi

 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      06-06-2005
Alessandro Rossi wrote:
> Hi,
> Does anybody can help me in this problem?
> I have a java project under subversion (I access it from eclipse by
> subclipse). I would like that every time I commit some changes (and so
> the version number increase) a properties file should be modified with
> the actual version number.


In your build system, e.g. in "make", during build time (not earlier),
embed the output of svnversion into a String of a dynamically created
small class source code - probably only holding the string as a public
final static member. Do not place this generated file under version control.


/Thomas

--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
 
Reply With Quote
 
 
 
 
Jan Peter Stotz
Guest
Posts: n/a
 
      06-06-2005
Alessandro Rossi schrieb:

> Does anybody can help me in this problem?
> I have a java project under subversion (I access it from eclipse by
> subclipse). I would like that every time I commit some changes (and so
> the version number increase) a properties file should be modified with
> the actual version number.


You are looking for subversion properties:
http://svnbook.red-bean.com/en/1.0/ch07s02.html

Jan
 
Reply With Quote
 
Alessandro Rossi
Guest
Posts: n/a
 
      06-06-2005
I'm sorry, but I am a newbie...
I don't know if I'm missing but I've found that exist the availability
to execute scripts in certain events, like post-commit.tmpl. Here there
are 2 parameters: The repository path and the actual version number.
That's ok for me, but I haven't understand which language I have to use
in these files (python or whatever...)

Thank you
Alessandro Rossi

 
Reply With Quote
 
Alessandro Rossi
Guest
Posts: n/a
 
      06-06-2005
I'm sorry...I'm a newbie...
I found that exists post-commit.tmpl where it can be execute
"operations" after that commit has been executed.
I tried to modify this file, following the instructions, so I renamed
in post-commit.exe, but I don't know how to add the code I need to
write in a properties file the actual version number.

Thank you
Alessandro Rossi

 
Reply With Quote
 
bugbear
Guest
Posts: n/a
 
      06-06-2005
Thomas Weidenfeller wrote:
> Alessandro Rossi wrote:
>
>> Hi,
>> Does anybody can help me in this problem?
>> I have a java project under subversion (I access it from eclipse by
>> subclipse). I would like that every time I commit some changes (and so
>> the version number increase) a properties file should be modified with
>> the actual version number.

>
>
> In your build system, e.g. in "make", during build time (not earlier),
> embed the output of svnversion into a String of a dynamically created
> small class source code - probably only holding the string as a public
> final static member. Do not place this generated file under version
> control.


Heh. In general, *never* place generated files under
version control.

BugBear (generalising)
 
Reply With Quote
 
Alessandro Rossi
Guest
Posts: n/a
 
      06-06-2005
Hi, I tried this way:
I created a post-commit.bat where I wrote:
C:\java\jdk1.5.0\bin\java it.mypackage.PostCommitSVN %1 %2

If I execute this .bat file from a command windows this works properly,
but if I commit changes from the working copy to the svn repository,
this do nothing...
But I noticed that, if I rename post-commit.bat to post-commit.exe,
when I commit changes, it gives me an error that the post-commit is not
a valid executable file, so, I think, the file is well recognized...but
with .bat extension doesn't happen nothing...

Who can help me?
thank you
Alessandro Rossi

 
Reply With Quote
 
Alessandro Rossi
Guest
Posts: n/a
 
      06-07-2005
Hi,
I have now the following problem:
When a user commit some changes to a repository, after the commit I
execute the post-commit.exe and i see that the second parameter
(repository) is the repository path (c:\svn\repository), but, how can I
know from which branch the version has been increased? e.g. how can I
know if the actual version (version 51) has been created by changes of
branch 1.1 or branch 1.5?

thank you
Alessandro Rossi

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python version and svn Aung Thet Naing Python 2 12-13-2012 11:46 PM
getting svn tag in version Andrea Crotti Python 1 11-25-2011 02:11 PM
Re: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM



Advertisments