Permalink
Browse files

Fixed automatic versioning, it doesn't cause merge conflicts and work…

…s all the time.
  • Loading branch information...
1 parent 2e42d31 commit dd59e4a66d29217ba73e4ce2e3823720be9937cc @anakryiko anakryiko committed Jan 21, 2013
View
@@ -16,6 +16,8 @@ ipch/
/src/Public/ipch/
/research/ci/CompatibilityInfo
+src/EventStore/EventStore.Common/Properties/AssemblyVersion.cs
+
*.o
*.ii
*.s
@@ -65,6 +65,10 @@
<Project>{a794d3fb-06ac-471f-ab8d-6e98cbfa0021}</Project>
<Name>EventStore.BufferManagement</Name>
</ProjectReference>
+ <ProjectReference Include="..\EventStore.Common\EventStore.Common.csproj">
+ <Project>{b4c9be3d-43b1-4049-a23a-5dc53db3f0b0}</Project>
+ <Name>EventStore.Common</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -166,6 +166,16 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
+ <PreBuildEvent >
+$(MSBuildProjectDirectory)\..\Scripts\version\update-version.cmd $(MSBuildProjectDirectory)
+ </PreBuildEvent>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
+ <PreBuildEvent>
+$(MSBuildProjectDirectory)\..\Scripts\version\update-version.sh $(MSBuildProjectDirectory)
+ </PreBuildEvent>
+ </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
@@ -96,12 +96,12 @@
<Content Include="Properties\ESVersion.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <PropertyGroup Condition=" '$(Configuration)|$(OS)' == 'Release|Windows_NT' ">
+ <PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<PreBuildEvent >
$(MSBuildProjectDirectory)\..\Scripts\version\update-version.cmd $(MSBuildProjectDirectory)
</PreBuildEvent>
</PropertyGroup>
- <PropertyGroup Condition=" ('$(OS)' != 'Windows_NT') And ('$(Configuration)' == 'Release') ">
+ <PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<PreBuildEvent>
$(MSBuildProjectDirectory)\..\Scripts\version\update-version.sh $(MSBuildProjectDirectory)
</PreBuildEvent>
@@ -1,3 +0,0 @@
-[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
-[assembly: System.Reflection.AssemblyFileVersion("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersion("1.0.0.dev@d2ed681a28f4932df7bf3fcf2f0a7f5889ce11c2@Fri, 18 Jan 2013 21:01:06 +0200")]
@@ -64,6 +64,10 @@
<Project>{c7c0a3c2-a0eb-4ff4-a0cd-67eadf3f553f}</Project>
<Name>EventStore.ClientAPI</Name>
</ProjectReference>
+ <ProjectReference Include="..\EventStore.Common\EventStore.Common.csproj">
+ <Project>{b4c9be3d-43b1-4049-a23a-5dc53db3f0b0}</Project>
+ <Name>EventStore.Common</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="padmin.esconfig">
@@ -45,6 +45,10 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\EventStore.Common\EventStore.Common.csproj">
+ <Project>{b4c9be3d-43b1-4049-a23a-5dc53db3f0b0}</Project>
+ <Name>EventStore.Common</Name>
+ </ProjectReference>
<ProjectReference Include="..\EventStore.Web\EventStore.Web.csproj">
<Project>{68065B8C-0FDC-473F-9C32-54078E32FD5C}</Project>
<Name>EventStore.Web</Name>
@@ -233,7 +233,12 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
- <ItemGroup />
+ <ItemGroup>
+ <ProjectReference Include="..\EventStore.Common\EventStore.Common.csproj">
+ <Project>{b4c9be3d-43b1-4049-a23a-5dc53db3f0b0}</Project>
+ <Name>EventStore.Common</Name>
+ </ProjectReference>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -1,17 +1,17 @@
@echo off
-if not exist %1\Properties\ESVersion.txt goto VERSION_NOT_FOUND
+if not exist %1\..\EventStore.Common\Properties\ESVersion.txt goto VERSION_NOT_FOUND
-set /p _es_version=<%1\Properties\ESVersion.txt
+set /p _es_version=<%1\..\EventStore.Common\Properties\ESVersion.txt
for /f "delims=" %%a in ('git rev-parse --abbrev-ref HEAD') do @set _es_branch=%%a
for /f "delims=" %%a in ('call git log -n1 --pretty^=format:"%%H@%%aD" HEAD') do @set _es_log=%%a
echo [assembly: System.Reflection.AssemblyVersion("%_es_version: =%.0")] > %TEMP%\es-ver.tmp
echo [assembly: System.Reflection.AssemblyFileVersion("%_es_version: =%.0")] >> %TEMP%\es-ver.tmp
echo [assembly: System.Reflection.AssemblyInformationalVersion("%_es_version: =%.%_es_branch: =%@%_es_log%")] >> %TEMP%\es-ver.tmp
-fc %TEMP%\es-ver.tmp %1\Properties\AssemblyVersion.cs > nul && goto IDENTICAL
-copy /y %TEMP%\es-ver.tmp %1\Properties\AssemblyVersion.cs
+fc %TEMP%\es-ver.tmp %1\..\EventStore.Common\AssemblyVersion.cs > nul && goto IDENTICAL
+copy /y %TEMP%\es-ver.tmp %1\..\EventStore.Common\Properties\AssemblyVersion.cs
:IDENTICAL
del %TEMP%\es-ver.tmp
exit /b 0
@@ -8,20 +8,20 @@ function err() {
MSBuildProjectDirectory=$1
-if [ ! -e $MSBuildProjectDirectory/Properties/ESVersion.txt ] ; then err "No ESVersion.txt file found with current version!"; fi
+if [ ! -e $MSBuildProjectDirectory/../EventStore.Common/Properties/ESVersion.txt ] ; then err "No ESVersion.txt file found with current version!"; fi
-_es_version=`cat $MSBuildProjectDirectory/Properties/ESVersion.txt`
+_es_version=`cat $MSBuildProjectDirectory/../EventStore.Common/Properties/ESVersion.txt`
_es_branch=`git rev-parse --abbrev-ref HEAD`
_es_log=`git log -n1 --pretty=format:"%H@%aD" HEAD`
echo '[assembly: System.Reflection.AssemblyVersion("'"$_es_version.0"'")]' > /tmp/es-ver.tmp
echo '[assembly: System.Reflection.AssemblyFileVersion("'"$_es_version.0"'")]' >> /tmp/es-ver.tmp
echo '[assembly: System.Reflection.AssemblyInformationalVersion("'"$_es_version.$_es_branch@$_es_log"'")]' >> /tmp/es-ver.tmp
-if diff /tmp/es-ver.tmp $MSBuildProjectDirectory/Properties/AssemblyVersion.cs >/dev/null ; then
+if diff /tmp/es-ver.tmp $MSBuildProjectDirectory/../EventStore.Common/Properties/AssemblyVersion.cs >/dev/null ; then
echo "Skip, version is the same"
else
- cp -f /tmp/es-ver.tmp $MSBuildProjectDirectory/Properties/AssemblyVersion.cs
+ cp -f /tmp/es-ver.tmp $MSBuildProjectDirectory/../EventStore.Common/Properties/AssemblyVersion.cs
fi
if [ -e "/tmp/es-ver.tmp" ] ; then rm /tmp/es-ver.tmp; fi

0 comments on commit dd59e4a

Please sign in to comment.