Version Editor 04/06/2016

Version Editor

  1. CKY
    <p>I have been using MSBuild for a while to auto build and move everything into a nice compressible package once its finished..<br />
    One issue I ran into was I wanted controlled version numbers and not use wildcards that every time I ran the application it would increment...</p><p>&nbsp;</p><p>
    To work around this I wrote a version application that reads from 4 different files and you run it in your build bat auto increment the number in the file and then write it to the assembly.cs before running your MSbuild script.....</p><p>&nbsp;</p><p>
    A sample of the build bat could like like this...
    Code:
    set /p pv=< Planed.txt
    set /p sv=< Stable.txt 
    set /p bv=< Beta.txt 
    set /p av=< Alpha.txt 
    set /a sum1=%av%+1
    echo %sum1%>"Alpha.txt"
    echo %pv%.%sv%.%bv%.%sum1%>"Update.xml"
    versioneditor Major="planed.txt" Minor="stable.txt" Build="beta.txt" Revision="alpha.txt" AssemblyInfo="..\Application\properties\AssemblyInfo.cs"
    versioneditor Major="planed.txt" Minor="stable.txt" Build="beta.txt" Revision="alpha.txt" AssemblyInfo="..\uidll\properties\AssemblyInfo.cs"
    versioneditor Major="planed.txt" Minor="stable.txt" Build="beta.txt" Revision="alpha.txt" AssemblyInfo="..\gameinfodll\properties\AssemblyInfo.cs"
    call "%VS100COMNTOOLS%vsvars32.bat"
    rmdir /s /q "MyApplication"
    mkdir "MyApplication"
    msbuild "..\MyApplication.sln" /p:OutputPath="%cd%\MyApplication"
    
    </p>
    lakshmi likes this.
Close