forked from mccalltd/AttributeRouting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
67 lines (55 loc) · 3.11 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0"?>
<Project DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="AttributeRouting.targets" />
<PropertyGroup>
<Configuration>Release</Configuration>
</PropertyGroup>
<Target Name="Default" DependsOnTargets="Test;NugetPack"></Target>
<Target Name="Build">
<ItemGroup>
<Tests Include="src\AttributeRouting.Specs\AttributeRouting.Specs.csproj"/>
</ItemGroup>
<PropertyGroup>
<OutputPath>..\..\build\bin</OutputPath>
</PropertyGroup>
<!-- Only need to build test projects as dependent projects will be automatically built. -->
<MSBuild Projects="@(Tests)" Targets="Clean;Build"
Properties="Configuration=$(Configuration);OutputPath=$(OutputPath)"/>
</Target>
<Target Name="Test" DependsOnTargets="Build">
<Exec Command="tools\nunit-console-x86.exe build\bin\AttributeRouting.Specs.dll /noresult" />
</Target>
<Target Name="NugetPack" DependsOnTargets="Build">
<ItemGroup>
<MainNuspec Include="nuget\AttributeRouting.Web.Mvc\AttributeRouting.nuspec"/>
<MainNuspec Include="nuget\AttributeRouting.Web.Http.WebHost\AttributeRouting.WebApi.nuspec"/>
<MainNuspec Include="nuget\AttributeRouting.Web.Http.SelfHost\AttributeRouting.WebApi.Hosted.nuspec"/>
<SymbolsNuspec Include="nuget\AttributeRouting.Web.Mvc\AttributeRouting.symbols.nuspec"/>
<SymbolsNuspec Include="nuget\AttributeRouting.Web.Http.WebHost\AttributeRouting.WebApi.symbols.nuspec"/>
<SymbolsNuspec Include="nuget\AttributeRouting.Web.Http.SelfHost\AttributeRouting.WebApi.Hosted.symbols.nuspec"/>
<Transforms Include="nuget\**\*.nutrans" />
</ItemGroup>
<PropertyGroup>
<OutputDir>build\nuget</OutputDir>
</PropertyGroup>
<!-- Get shared assembly version -->
<GetAssemblyInformationalVersion Assembly="build\bin\AttributeRouting.dll">
<Output PropertyName="Version" TaskParameter="Version" />
</GetAssemblyInformationalVersion>
<Message Text="Building Nuget packages for v$(Version)" />
<!-- Transform Nuspecs -->
<TransformXmlHierarchy
Source="%(Transforms.Identity)"
Destination="nuget\%(Transforms.RecursiveDir)%(Transforms.Filename).nuspec"
TaskDirectory="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\" />
<MakeDir Directories="$(OutputDir)"/>
<Exec Command="src\.nuget\nuget pack %(MainNuspec.Identity) -Version $(Version) -OutputDirectory $(OutputDir)"/>
<Exec Command="src\.nuget\nuget pack %(SymbolsNuspec.Identity) -Version $(Version) -Symbols -OutputDirectory $(OutputDir)"/>
</Target>
<Target Name="NugetPush" DependsOnTargets="NugetPack">
<ItemGroup>
<Packages Include="build\nuget\*.nupkg" Exclude="build\nuget\*.symbols.nupkg"/>
</ItemGroup>
<Exec Command="nuget push %(Packages.Identity)" />
</Target>
</Project>