/
Deploy.build
executable file
·84 lines (67 loc) · 3.79 KB
/
Deploy.build
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="BuildPackage">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''" >Release</Configuration>
<ProjectName>Niles</ProjectName>
<SolutionDir>$(MSBuildProjectDirectory)</SolutionDir>
<SolutionFile>$(SolutionDir)\$(ProjectName).sln</SolutionFile>
<OutputDir>$(SolutionDir)\$(ProjectName)\bin\$(Configuration)</OutputDir>
<BuildDir>$(SolutionDir)\Build</BuildDir>
<ToolsDir>$(SolutionDir)\Tools</ToolsDir>
<MSBuildExtensions>$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll</MSBuildExtensions>
<AssemblyInfoTask>$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.targets</AssemblyInfoTask>
<NugetPath>$(SolutionDir)\.nuget\nuget.exe</NugetPath>
<NUnitPath>$(SolutionDir)\packages\NUnit.2.5.10.11092\tools</NUnitPath>
</PropertyGroup>
<ItemGroup>
<AssemblyInfoFiles Include="**\AssemblyInfo.cs" />
<IntermediateAssembly Include="$(OutputDir)\Niles.dll"/>
</ItemGroup>
<ItemGroup>
<MainAssemblies Include="$(OutputDir)\Niles.dll" />
<TestAssemblies Include="$(SolutionDir)\Niles.Test\bin\$(Configuration)\Niles.Test.dll" />
</ItemGroup>
<Import Project="$(AssemblyInfoTask)" />
<UsingTask AssemblyFile="$(MSBuildExtensions)" TaskName="MSBuild.Community.Tasks.XmlUpdate" />
<UsingTask AssemblyFile="$(MSBuildExtensions)" TaskName="MSBuild.Community.Tasks.NUnit" />
<PropertyGroup>
<AssemblyCopyright>Copyright 2012 Jason Walker</AssemblyCopyright>
<AssemblyProduct>Niles</AssemblyProduct>
<AssemblyMajorVersion>1</AssemblyMajorVersion>
<AssemblyMinorVersion>1</AssemblyMinorVersion>
<AssemblyBuildNumberType>NoIncrement</AssemblyBuildNumberType>
<AssemblyBuildNumberFormat>0</AssemblyBuildNumberFormat>
<AssemblyRevisionType>AutoIncrement</AssemblyRevisionType>
<AssemblyRevisionFormat>000</AssemblyRevisionFormat>
<AssemblyFileMajorVersion>1</AssemblyFileMajorVersion>
<AssemblyFileMinorVersion>1</AssemblyFileMinorVersion>
<AssemblyFileBuildNumberType>NoIncrement</AssemblyFileBuildNumberType>
<AssemblyFileBuildNumberFormat>0</AssemblyFileBuildNumberFormat>
<AssemblyFileRevisionType>AutoIncrement</AssemblyFileRevisionType>
<AssemblyFileRevisionFormat>000</AssemblyFileRevisionFormat>
</PropertyGroup>
<Target Name="Compile" DependsOnTargets="UpdateAssemblyInfoFiles">
<MSBuild Projects="$(SolutionFile)" Targets="Rebuild" Properties="Configuration=$(Configuration)" />
</Target>
<Target Name="Test" DependsOnTargets="Compile">
<NUnit Assemblies="@(TestAssemblies)"
WorkingDirectory="$(SolutionDir)"
ToolPath="$(NUnitPath)"
ContinueOnError="False" />
</Target>
<Target Name="BuildPackage" DependsOnTargets="Test">
<!-- First copy the nuspec template files to the package dir -->
<Copy SourceFiles="$(SolutionDir)\$(ProjectName).nuspec" DestinationFolder="$(BuildDir)" />
<!-- Copy the source files to the package dir -->
<Copy SourceFiles="@(MainAssemblies)" DestinationFolder="$(BuildDir)\lib\net40\%(RecursiveDir)" />
<Message Text="Test: $(MaxAssemblyVersion)" />
<!-- insert the version number into the nuspec files -->
<XmlUpdate
XmlFileName="$(BuildDir)\$(ProjectName).nuspec"
XPath="//version"
Value="$(MaxAssemblyVersion)" />
<Exec WorkingDirectory="$(BuildDir)" Command="$(NugetPath) pack $(BuildDir)\$(ProjectName).nuspec" />
</Target>
<Target Name="DeployPackage" DependsOnTargets="BuildPackage">
<Exec WorkingDirectory="$(BuildDir)" Command="$(NugetPath) push $(BuildDir)\$(ProjectName).$(MaxAssemblyVersion).nupkg" />
</Target>
</Project>