home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
URGENT - GOOGLE CODE Project repo : will be closed
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="yoavain" data-source="post: 1130619" data-attributes="member: 92067"><p>I've decided to move all my projects to GitHub.</p><p>In order to do this, I had to change stuff related to auto-versioning the builds.</p><p>Since I'm not a Git pro, I'm not sure if there's any convention for that. You might find the following useful.</p><p></p><p>First, I'll start with what I used until now:</p><p></p><p>In my AssemblyInfo.cs I had:</p><p>[code][assembly: AssemblyVersion("1.4.0.$WCREV$")]</p><p>[assembly: AssemblyFileVersion("1.4.0.$WCREV$")][/code]</p><p></p><p>In the project file (.csproj) I had:</p><p>[code]<PropertyGroup></p><p> <PreBuildEvent>subwcrev ..\..\.. ..\..\Properties\AssemblyInfo.cs ..\..\Properties\AssemblyInfo.cs</PreBuildEvent></p><p></PropertyGroup></p><p><PropertyGroup></p><p> <PostBuildEvent>svn revert ..\..\Properties\AssemblyInfo.cs</p><p></PropertyGroup></p><p>[/code]</p><p></p><p>I also had a build.bat running the MSBUILD.exe command with the solution file. </p><p>For example:</p><p>[code]"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBUILD.exe" /target:Rebuild /property:Configuration=RELEASE /fl /flp:logfile=FanartHandler.log;verbosity=diagnostic FanartHandler.sln[/code]</p><p></p><p>The solution I found for GIT is as follows:</p><ol> <li data-xf-list-type="ol">Remove the subwcrev from PreBuildEvent</li> <li data-xf-list-type="ol">Remove the svn revert from the PostBuildEvent</li> <li data-xf-list-type="ol">Edit the build.bat<ul> <li data-xf-list-type="ul">Add the following <u>before </u>the MSBUILD.exe command<br /> [code]setlocal enabledelayedexpansion<br /> for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a <br /> set REVISION=%REVISION: =%<br /> "scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" FanartHandler\Properties\AssemblyInfo.cs<br /> for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a <br /> set REVISION=%REVISION: =%<br /> "scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" FanartHandler\Properties\AssemblyInfo.cs[/code]<br /> </li> </ul></li> </ol> <ol> <li data-xf-list-type="ol"><ul> <li data-xf-list-type="ul">Add the following <u>after </u>the MSBUILD.exe command<br /> [code]git checkout FanartHandler\Properties\AssemblyInfo.cs[/code]</li> </ul></li> </ol></blockquote><p></p>
[QUOTE="yoavain, post: 1130619, member: 92067"] I've decided to move all my projects to GitHub. In order to do this, I had to change stuff related to auto-versioning the builds. Since I'm not a Git pro, I'm not sure if there's any convention for that. You might find the following useful. First, I'll start with what I used until now: In my AssemblyInfo.cs I had: [code][assembly: AssemblyVersion("1.4.0.$WCREV$")] [assembly: AssemblyFileVersion("1.4.0.$WCREV$")][/code] In the project file (.csproj) I had: [code]<PropertyGroup> <PreBuildEvent>subwcrev ..\..\.. ..\..\Properties\AssemblyInfo.cs ..\..\Properties\AssemblyInfo.cs</PreBuildEvent> </PropertyGroup> <PropertyGroup> <PostBuildEvent>svn revert ..\..\Properties\AssemblyInfo.cs </PropertyGroup> [/code] I also had a build.bat running the MSBUILD.exe command with the solution file. For example: [code]"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBUILD.exe" /target:Rebuild /property:Configuration=RELEASE /fl /flp:logfile=FanartHandler.log;verbosity=diagnostic FanartHandler.sln[/code] The solution I found for GIT is as follows: [LIST=1] [*]Remove the subwcrev from PreBuildEvent [*]Remove the svn revert from the PostBuildEvent [*]Edit the build.bat [LIST] [*]Add the following [U]before [/U]the MSBUILD.exe command [code]setlocal enabledelayedexpansion for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a set REVISION=%REVISION: =% "scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" FanartHandler\Properties\AssemblyInfo.cs for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a set REVISION=%REVISION: =% "scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" FanartHandler\Properties\AssemblyInfo.cs[/code] [/LIST] [/LIST] [LIST=1] [LIST] [*]Add the following [U]after [/U]the MSBUILD.exe command [code]git checkout FanartHandler\Properties\AssemblyInfo.cs[/code] [/LIST] [/LIST] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
URGENT - GOOGLE CODE Project repo : will be closed
Contact us
RSS
Top
Bottom