Results 1 to 6 of 6
  1. #1
    Kjartan is offline Member
    Join Date
    Mar 2011
    Posts
    3
    Rep Power
    0

    Default Version tagging CVS repository files from Java or ANT

    Let me give you the rundown first:

    - Our code is stored on remote CVS repository. (Accessed from Eclipse IDE)
    - Each person on the team can check out a project, compile a product release locally (using an ANT built script) and distribute it to a file server.

    At the moment, after building a new release, we have to manually update the Version tags on the CVS repository to match the newly released build. We do this in Eclipse by right-clicking on the project root > Team > Tag as Version.... and then typing in the incremented version number.

    I would like to automate this so that after a new release is built, the new version number is automatically applied to files on the CVS repository. An ANT script solution or Java coded solution (defined as an ANT task) will do.

    I have spent hours searching forums for a solution but nothing matches my exact problem. I have looked at both JCVS and Netbeans' JavaCVS but they seem to be orientated more towards a GUI than allowing their classes to be used for a single tag-as-version command. PLEASE HELP!

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    From your description, it sounds like you're doing things backward. You should be doing the tag prior to the build and distribution. How do you even know what you're building otherwise?

    But, if for some reason you can't change that process, I suggest adding a file who's only purpose in life is to contain a $Version tag. Then you could easily read that in and spawn the appropriate CVS command.

  3. #3
    Kjartan is offline Member
    Join Date
    Mar 2011
    Posts
    3
    Rep Power
    0

    Default

    You assume correctly. We are doing things slightly backward... but this is they way it has been done for years apparently. I only recently joined the company so I can't change the process. :D

    We already have a file keeping track of the current version as you suggested. It's the way of using that to tag the CVS with java that is the mystery. I don't know what java library to use and how to use it. There is Jcvs but it's GUI based.

  4. #4
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    It's difficult to give much advice, because I really don't understand what you're trying to do. If the files have not already been tagged, then assigning a tag is arbitrary. Use whatever standard your company uses and do a 1 up counter, or something like that, from the previous tag.

    You can read in the previous version tag from the magic file using a script or java, and parse it to find the previous tag. Then apply whatever transformation you want to create a new tag name, and call the appropriate 'cvs tag' command using that name. As opposed to doing in a build script, I'd write a checkout script/program that does this, so everything is tagged an ready to go before you even start editing.

  5. #5
    Kjartan is offline Member
    Join Date
    Mar 2011
    Posts
    3
    Rep Power
    0

    Default

    All I want to know is how to issue the cvs-command from within my java code.

  6. #6
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Well, you could use a package such as jcvs for that purpose, but for something as simple as what you're trying to do, I'd be inclined to use Runtime.exec.

Similar Threads

  1. Version of java
    By waqar100 in forum New To Java
    Replies: 3
    Last Post: 06-04-2010, 05:29 AM
  2. java -version pointing to older version
    By deepakts in forum New To Java
    Replies: 4
    Last Post: 05-06-2010, 10:59 AM
  3. Creating my own plug-in repository
    By mark.bramnik in forum Eclipse
    Replies: 0
    Last Post: 07-05-2009, 01:06 PM
  4. Adding recieved items to Server repository.
    By nel636 in forum New To Java
    Replies: 1
    Last Post: 11-28-2008, 02:46 PM
  5. version of java????
    By j2vdk in forum New To Java
    Replies: 6
    Last Post: 09-07-2008, 05:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •