forked from chriseldredge/Klondike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntegratedBuild.proj
73 lines (57 loc) · 3.59 KB
/
IntegratedBuild.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
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir>$(MSBuildProjectDirectory)\app\</SolutionDir>
<ProjectDir>$(SolutionDir)</ProjectDir>
<DistDir>$(ProjectDir)</DistDir>
<TestsEnabled>true</TestsEnabled>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
</PropertyGroup>
<Target Name="Build" DependsOnTargets="Clean;RestoreSolutionPackages;BuildSolution;IntegrationTest"/>
<Target Name="Clean">
<ItemGroup>
<Trash Include="build\**\*" />
<Trash Include="$(ProjectDir)bin**\*" />
<Trash Include="$(ProjectDir)obj**\*" />
</ItemGroup>
<Delete Files="@(Trash)"/>
</Target>
<Target Name="RestoreSolutionPackages" DependsOnTargets="DownloadNuGetCommandLineClient">
<Exec Command="$(NuGetCommand) restore $(SolutionDir) -NonInteractive -Source http://www.nuget.org/api/v2/"/>
</Target>
<Target Name="Stage" DependsOnTargets="BuildSolution;TransformWebConfig"/>
<Target Name="TransformWebConfig"
Inputs="$(ProjectDir)Klondike/Web.config;$(ProjectDir)Klondike/Web.$(Configuration).config"
Outputs="$(DistDir)Web.config">
<MakeDir Directories="$(DistDir)"/>
<Exec
Command=""$(SolutionDir)packages\WebConfigTransformRunner.1.0.0.1\Tools\WebConfigTransformRunner.exe" "$(ProjectDir)Web.config" "$(ProjectDir)Web.Release.config" "$(DistDir)Web.config""
Condition="Exists('$(ProjectDir)Web.$(Configuration).config')"/>
<Copy SourceFiles="$(ProjectDir)Web.config" DestinationFolder="$(DistDir)"
Condition="!Exists('$(ProjectDir)Web.$(Configuration).config')"/>
</Target>
<Target Name="BuildSolution" DependsOnTargets="GenerateVersionInfo">
<MSBuild Projects="$(SolutionDir)/Klondike.sln" Targets="Build" Properties="RestorePackages=false;Configuration=$(Configuration)"/>
</Target>
<Target Name="IntegrationTest" Condition=" '$(TestsEnabled)' == 'true' ">
<MSBuild Projects="$(MSBuildProjectDirectory)\integration-tests\test.proj" Properties="DistDir=$(DistDir)"/>
</Target>
<Target Name="GenerateVersionInfo">
<PropertyGroup>
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">0.9</VersionPrefix>
<VersionControlInfo Condition=" '$(VersionControlInfo)' == '' ">$(VersionPrefix) (unknown version control revision)</VersionControlInfo>
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
<AssemblyInformationalVersion>$(VersionControlInfo)</AssemblyInformationalVersion>
</PropertyGroup>
<ItemGroup>
<VersionInfoContent Include="[assembly: global::System.Reflection.AssemblyVersionAttribute("$(AssemblyVersion)")]"/>
<VersionInfoContent Include="[assembly: global::System.Reflection.AssemblyFileVersionAttribute("$(AssemblyVersion)")]"/>
<VersionInfoContent Include="[assembly: global::System.Reflection.AssemblyInformationalVersionAttribute("$(AssemblyInformationalVersion)")]"/>
</ItemGroup>
<MakeDir Directories="build/artifacts"/>
<WriteLinesToFile File="build/VersionInfo.cs" Lines="@(VersionInfoContent)" Overwrite="true"/>
<Message Text="AssemblyVersion: $(AssemblyVersion)"/>
<Message Text="AssemblyInformationalVersion: $(AssemblyInformationalVersion)"/>
</Target>
<Import Project="NuGet.targets"/>
</Project>