-
Notifications
You must be signed in to change notification settings - Fork 32
/
build.proj
63 lines (49 loc) · 2.77 KB
/
build.proj
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="default">
<PropertyGroup>
<BaseDir>$(MSBuildProjectDirectory)</BaseDir>
<Configuration Condition="'$(Configuration)'==''" >Release</Configuration>
<BuildDir>$(BaseDir)\build</BuildDir>
<SolutionFile>$(BaseDir)\SagePayMvc.sln</SolutionFile>
<TestAssemblies>
$(BaseDir)\src\SagePayMvc.Tests\bin\$(Configuration)\SagePayMvc.Tests.dll
</TestAssemblies>
<MSBuildExtensions>$(BaseDir)\lib\msbuild\msbuild.community.tasks.dll</MSBuildExtensions>
</PropertyGroup>
<UsingTask AssemblyFile="$(MSBuildExtensions)" TaskName="MSBuild.Community.Tasks.NUnit" Condition="'$(teamcity_version)' == ''" />
<UsingTask AssemblyFile="$(MSBuildExtensions)" TaskName="MSBuild.Community.Tasks.Zip" />
<UsingTask AssemblyFile="$(MSBuildExtensions)" TaskName="MSBuild.Community.Tasks.XmlUpdate" />
<Target Name="default" DependsOnTargets="PackageRestore; Compile; Test; Deploy; Package" />
<Target Name="PackageRestore">
<Exec Command="$(BaseDir)\.nuget\nuget.exe restore $(SolutionFile)" WorkingDirectory="$(BaseDir)" />
</Target>
<Target Name="Compile">
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(Configuration)" Targets="Rebuild" />
</Target>
<Target Name="Test">
<NUnit Assemblies="$(TestAssemblies)" ToolPath="$(BaseDir)\packages\nunit.runners.2.6.3\tools" Framework="net-4.0" />
</Target>
<Target Name="Deploy">
<RemoveDir Directories="$(BuildDir)" />
<ItemGroup>
<MainBinaries Include="$(BaseDir)\src\SagePayMvc\bin\$(Configuration)\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(MainBinaries)" DestinationFolder="$(BuildDir)\SagePayMvc\%(RecursiveDir)" />
</Target>
<Target Name="Package">
<Copy SourceFiles="$(MSBuildProjectDirectory)\SagePayMvc.nuspec" DestinationFolder="$(BuildDir)\temp\SagePayMvc" />
<Copy SourceFiles="@(MainBinaries)" DestinationFolder="$(BuildDir)\temp\SagePayMvc\lib\Net40\%(RecursiveDir)" />
<!-- Get the version number of the main assembly to insert into the nuspec files -->
<GetAssemblyIdentity AssemblyFiles="$(BuildDir)\SagePayMvc\SagePayMvc.dll">
<Output TaskParameter="Assemblies" ItemName="AsmInfo" />
</GetAssemblyIdentity>
<!-- insert the version number into the nuspec files -->
<XmlUpdate
Namespace="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
XmlFileName="$(BuildDir)\temp\SagePayMvc\SagePayMvc.nuspec"
XPath="/package/metadata/version"
Value="%(AsmInfo.Version)" />
<Exec WorkingDirectory="$(BuildDir)"
Command="$(BaseDir)\.nuget\nuget.exe pack $(BuildDir)\temp\SagePayMvc\SagePayMvc.nuspec" />
<RemoveDir Directories="$(BuildDir)\temp" />
</Target>
</Project>