Go to Post In theory, this should work... Oops. - Eldarion [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-16-2012, 11:23 AM
CyberKitsune's Avatar
CyberKitsune CyberKitsune is offline
Lead Programmer for NeoBots
AKA: Sean McClenaghan
FRC #2903 (NeoBots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Arlington, WA
Posts: 2
CyberKitsune is an unknown quantity at this point
Easy way to access SVN revision in code?

Hello Chief-Delphi,

Our team uses a Subversion server to revise and store our code, and I was wondering if anyone knows a good, platform-independent way to access the SVN revision from within the code of the program.

I've seen a ANT build script that uses svnversion, but that would only work properly on Linux or OSX machines, and it doesn't use the SVN client built-in to NetBeans on Windows.

If anyone has a good method of achieving this, I'd love to know It'd be very helpful for the team I'm in, and likely many others that use Version Control.

-Sean "CyberKitsune"
Lead Programmer for the NeoBots
Reply With Quote
  #2   Spotlight this post!  
Unread 02-16-2012, 05:04 PM
BradAMiller BradAMiller is online now
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 587
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Easy way to access SVN revision in code?

For the automated builds of the C++ WPILib libraries we use sliksvn (a command line svn tool) and a .vbs script that executes an svn command and gets the version number. It uses it to name the installer based on the svn version number.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #3   Spotlight this post!  
Unread 02-16-2012, 07:17 PM
CyberKitsune's Avatar
CyberKitsune CyberKitsune is offline
Lead Programmer for NeoBots
AKA: Sean McClenaghan
FRC #2903 (NeoBots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Arlington, WA
Posts: 2
CyberKitsune is an unknown quantity at this point
Re: Easy way to access SVN revision in code?

Quote:
Originally Posted by BradAMiller View Post
For the automated builds of the C++ WPILib libraries we use sliksvn (a command line svn tool) and a .vbs script that executes an svn command and gets the version number. It uses it to name the installer based on the svn version number.

Brad
Thank you for the quick reply, Brad!

Do you know if there is an easy way to do this with Java's build system? (ANT)
Reply With Quote
  #4   Spotlight this post!  
Unread 02-18-2012, 09:57 AM
codedr codedr is offline
Registered User
FRC #0537
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Wisconsin
Posts: 68
codedr will become famous soon enoughcodedr will become famous soon enough
Re: Easy way to access SVN revision in code?

This works for ant:

<condition property="isWindows">
<os family="windows" />
</condition>

<target name="do.run.Windows" if="isWindows">
<exec executable="cmd" dir="${your-target-dir}" >
<arg line="/C command-to-run arg1 arg2 arg3" />
</exec>
</target>
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:35 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi