SimpleLog/SimpleLog.targets

65 lines
2.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<Producer>Tommy Montgomery</Producer>
<Copyright>Copyright (C) 2009 Tommy Montgomery</Copyright>
<MajorVersion>1</MajorVersion>
<MinorVersion>3</MinorVersion>
<BuildNumber>0</BuildNumber>
<RevisionNumber>0</RevisionNumber>
<PropertiesDir>Properties</PropertiesDir>
<BuildDependsOn>
Clean;
ConfigureVersionNumber;
CreateAssemblyInfo;
$(BuildDependsOn)
</BuildDependsOn>
</PropertyGroup>
<ItemGroup>
<AssemblyFile Include="$(PropertiesDir)\AssemblyInfo.cs"/>
<Compile Include="@(AssemblyFile)"/>
</ItemGroup>
<Target Name="GetSubversionInfo">
<Message Text="Getting revision information..."/>
<SvnInfo RepositoryPath=".">
<Output TaskParameter="LastChangedRevision" PropertyName="RevisionNumber"/>
</SvnInfo>
<Message Text="Last changed revision: $(RevisionNumber)"/>
</Target>
<Target Name="ConfigureVersionNumber" DependsOnTargets="GetSubversionInfo">
<CreateProperty Value="$(MajorVersion).$(MinorVersion).$(BuildNumber).$(RevisionNumber)">
<Output PropertyName="VersionNumber" TaskParameter="Value"/>
</CreateProperty>
<Message Text="Version number set to: $(VersionNumber)"/>
</Target>
<Target Name="CreateAssemblyInfo" DependsOnTargets="ConfigureVersionNumber">
<MakeDir Directories="$(PropertiesDir)"/>
<AssemblyInfo
OutputFile="@(AssemblyFile)"
CodeLanguage="CS"
AssemblyCompany="$(Producer)"
AssemblyConfiguration="$(Configuration)"
AssemblyCopyright="$(Copyright)"
AssemblyFileVersion="$(VersionNumber)"
AssemblyTitle="$(AssemblyName)"
AssemblyVersion="$(VersionNumber)"
/>
</Target>
<Target Name="AfterBuild">
<RemoveDir Directories="$(PropertiesDir)"/>
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(PropertiesDir);bin;obj"/>
</Target>
</Project>