In vs2005 and vs2008, how does one use SVN's subwcrev to increase the revision number.

Source: Internet
Author: User
Tags svn client tortoisesvn

In order to make the last digit of the software version number, that is, the revision number is consistent with the revision number of the svn-managed code base and automatically updated, you can use vs2005 to generate events and subwcrev programs in SVN, the steps are as follows: Tools/Raw Materials
    • Visual Studio 2005
    • SVN client (tortoisesvn or other)
STEP/Method
  1. Compile a template file, for example, version_template.h. The content is as follows:

    # Ifndef _ version_h _
    # DEFINE _ version_h _

    # Define ver_major 1
    # Define ver_minor 0
    # Define ver_revision $ wcrev $

    # Endif //! _ Version_h _
  2. Find the subwcrev.exe executable file, which is generally located in the svn Client installation directory. For example, tortoisesvn is located in the bin folder of its installation directory. Here, I copied subwcrev.exe to the Code project directory for ease of use.
  3. On the project properties page of vs2005-> pre-generated events-> command line, add the following sentence:

    $ (Solutiondir) \ subwcrev.exe $ (solutiondir) \ SRC \ qmlv \ version_template.h $ (solutiondir) \ SRC \ qmlv \ version. h



    Subwcrev call Syntax:
    Subwcrev workingcopypath [srcversionfile dstversionfile]
  4. After the code is compiled, the pre-generated event is triggered. vs2005 calls the subwcrev.exe program, replaces the macro $ wcrev $ in version_template.h with the current SVN revision number, and saves it as version. h file, version. h will be similar:

    # Ifndef _ version_h _
    # DEFINE _ version_h _

    # Define ver_major 1
    # Define ver_minor 0
    # Define ver_revision 2821

    # Endif //! _ Version_h _
    1. To display the version number in the program, reference the ver_revision macro.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.