forked from tomhunter-gh/SourceLog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UpdateVersion.proj.xml
41 lines (39 loc) · 2.45 KB
/
UpdateVersion.proj.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="UpdateVersion" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="Lib\MSBuildExtensionPack\4.0.6.0\MSBuild.ExtensionPack.dll" TaskName="MSBuild.ExtensionPack.Framework.AssemblyInfo"/>
<UsingTask AssemblyFile="Lib\MSBuildExtensionPack\4.0.6.0\MSBuild.ExtensionPack.dll" TaskName="MSBuild.ExtensionPack.Xml.XmlFile"/>
<PropertyGroup>
<AssemblyMajorVersion>$([System.DateTime]::Now.ToString(`yyyy`))</AssemblyMajorVersion>
<AssemblyMinorVersion>$([System.DateTime]::Now.ToString(`MM`))</AssemblyMinorVersion>
<AssemblyBuildNumber>$([System.DateTime]::Now.ToString(`dd`))</AssemblyBuildNumber>
<AssemblyRevision>$([System.DateTime]::Now.ToString(`HHmm`))</AssemblyRevision>
<AssemblyFileMajorVersion>$(AssemblyMajorVersion)</AssemblyFileMajorVersion>
<AssemblyFileMinorVersion>$(AssemblyMinorVersion)</AssemblyFileMinorVersion>
<AssemblyFileBuildNumber>$(AssemblyBuildNumber)</AssemblyFileBuildNumber>
<AssemblyFileRevision>$(AssemblyRevision)</AssemblyFileRevision>
</PropertyGroup>
<Target Name="UpdateVersion" Condition="'$(USERNAME.StartsWith(`apphb`))'=='True'">
<AssemblyInfo AssemblyInfoFiles="$(MSBuildThisFileDirectory)\SourceLog.UI\Properties\GlobalAssemblyInfo.cs"
AssemblyMajorVersion="$(AssemblyMajorVersion)"
AssemblyMinorVersion="$(AssemblyMinorVersion)"
AssemblyBuildNumber="$(AssemblyBuildNumber)"
AssemblyRevision="$(AssemblyRevision)"
AssemblyFileMajorVersion="$(AssemblyFileMajorVersion)"
AssemblyFileMinorVersion="$(AssemblyFileMinorVersion)"
AssemblyFileBuildNumber="$(AssemblyFileBuildNumber)"
AssemblyFileRevision="$(AssemblyFileRevision)"
/>
<ItemGroup>
<Namespaces Include="ns">
<Prefix>ns</Prefix>
<Uri>http://schemas.microsoft.com/developer/msbuild/2003</Uri>
</Namespaces>
</ItemGroup>
<MSBuild.ExtensionPack.Xml.XmlFile TaskAction="UpdateElement"
File="$(MSBuildThisFileDirectory)\SourceLog.UI\SourceLog.UI.csproj"
Namespaces="@(Namespaces)"
XPath="/ns:Project/ns:PropertyGroup/ns:ApplicationVersion"
InnerText="$(AssemblyMajorVersion).$(AssemblyMinorVersion).$(AssemblyBuildNumber).$(AssemblyRevision)"/>
<XmlPoke XmlInputPath="$(MSBuildThisFileDirectory)\SourceLog.UI\App.Config" Query="configuration/appSettings/add[@key = 'build_server']/@value" Value="$(COMPUTERNAME)" />
</Target>
</Project>