Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: semver
Fetching contributors…

Cannot retrieve contributors at this time

64 lines (59 sloc) 3.35 kB
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)'=='' ">Release</Configuration>
<OutputPath Condition=" '$(OutputPath)'=='' ">$(MSBuildProjectDirectory)\build\</OutputPath>
<ConfigurationOutputPath>$(OutputPath)\$(Configuration)\</ConfigurationOutputPath>
<CompileOutputPath>$(ConfigurationOutputPath)\out\</CompileOutputPath>
<NupkgPath>$(ConfigurationOutputPath)\nupkg\</NupkgPath>
<NupkgLibPath>$(NupkgPath)\lib\</NupkgLibPath>
<NupkgSpecName>Kayak.nuspec</NupkgSpecName>
</PropertyGroup>
<ItemGroup>
<Projects Include="$(MSBuildProjectDirectory)\Kayak\Kayak.csproj"/>
<Projects Include="$(MSBuildProjectDirectory)\Kayak.Tests\Kayak.Tests.csproj"/>
</ItemGroup>
<!-- all of this for recursively deleting a directory. still doesn't work on any directory that doesn't contain
files. what a load of crap. <\3 MSBuild. -->
<ItemGroup>
<!-- list all files under output path -->
<CleanFiles Include="$(OutputPath)\**\*"/>
</ItemGroup>
<ItemGroup>
<!-- list parent dirs of all files -->
<CleanDirectories Include="@(CleanFiles->'%(RelativeDir)')"/>
</ItemGroup>
<Target Name="RemoveDuplicateCleanDirectories">
<!-- remove duplicates (happens when dir contains more than one file) -->
<RemoveDuplicates Inputs="@(CleanDirectories)">
<Output TaskParameter="Filtered" ItemName="FilteredCleanDirectories"/>
</RemoveDuplicates>
</Target>
<Target Name="Clean" DependsOnTargets="RemoveDuplicateCleanDirectories">
<Delete Files="@(CleanFiles)"/>
<RemoveDir Directories="@(FilteredCleanDirectories)"/>
<RemoveDir Directories="$(OutputPath)" Condition="Exists('$(OutputPath)')"/>
<MSBuild Projects="@(Projects)" Properties="OutputPath=$(CompileOutputPath)" Targets="Clean"/>
</Target>
<Target Name="Build">
<MakeDir Directories="$(CompileOutputPath)"/>
<MSBuild Projects="@(Projects)" Properties="OutputPath=$(CompileOutputPath)" />
</Target>
<Target Name="DistNuget" DependsOnTargets="Build">
<MakeDir Directories="$(NupkgLibPath)"/>
<Copy SourceFiles="$(CompileOutputPath)\Kayak.dll" DestinationFolder="$(NupkgLibPath)"/>
<Copy SourceFiles="$(NupkgSpecName)" DestinationFolder="$(NupkgPath)"/>
<GetAssemblyIdentity AssemblyFiles="$(CompileOutputPath)\Kayak.dll">
<Output TaskParameter="Assemblies" ItemName="AssemblyInfo" />
</GetAssemblyIdentity>
<!-- want just a 3-component version number. GetAssemblyIdentity gives us 4 regardless of
what we specify in AssemblyInfo.cs -->
<PropertyGroup>
<LongVersion>%(AssemblyInfo.Version)</LongVersion>
<ShortVersion>$(LongVersion.Substring(0, $([MSBuild]::Subtract($(LongVersion.Length), 2))))</ShortVersion>
</PropertyGroup>
<XmlPoke XmlInputPath="$(NupkgPath)\$(NupkgSpecName)"
Query="//version"
Value="$(ShortVersion)"/>
<Exec WorkingDirectory="$(NupkgPath)" Command="$(MSBuildProjectDirectory)\tools\nuget pack $(NupkgSpecName)"/>
</Target>
</Project>
Jump to Line
Something went wrong with that request. Please try again.