This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
forked from chriseldredge/Klondike
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Ciao.targets
79 lines (64 loc) · 3.91 KB
/
Ciao.targets
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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<KlondikeWebHostDir>$([System.IO.Path]::Combine('$(ProjectDirectory)', 'src', 'Klondike.WebHost'))$([System.IO.Path]::DirectorySeparatorChar)</KlondikeWebHostDir>
<KlondikeWebHostOutputDir>$([System.IO.Path]::Combine('$(ProjectDirectory)', 'build', 'Klondike.WebHost'))$([System.IO.Path]::DirectorySeparatorChar)</KlondikeWebHostOutputDir>
<KlondikeSelfHostDir>$([System.IO.Path]::Combine('$(ProjectDirectory)', 'src', 'Klondike.SelfHost'))$([System.IO.Path]::DirectorySeparatorChar)</KlondikeSelfHostDir>
<KlondikeSelfHostOutputDir>$([System.IO.Path]::Combine('$(ProjectDirectory)', 'build', 'Klondike.SelfHost'))$([System.IO.Path]::DirectorySeparatorChar)</KlondikeSelfHostOutputDir>
<StagingDir Condition=" '$(DistDir)' != '' ">$([System.IO.Path]::Combine('$(ProjectDirectory)', '$(DistDir)'))$([System.IO.Path]::DirectorySeparatorChar)</StagingDir>
<Configuration>Debug</Configuration>
</PropertyGroup>
<PropertyGroup>
<TransformExe>$(SolutionDirectory)packages\WebConfigTransformRunner.1.1.16\Tools\WebConfigTransformRunner.exe</TransformExe>
<TransformCommand Condition=" '$(OS)' == 'Windows_NT' ">"$(TransformExe)"</TransformCommand>
<TransformCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(TransformExe)</TransformCommand>
</PropertyGroup>
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
CopyOutputsToDistDir;
TransformWebConfig;
TransformSelfHostConfig
</BuildDependsOn>
<TestDependsOn>
$(TestDependsOn);
IntegrationTest
</TestDependsOn>
</PropertyGroup>
<Target Name="CopyOutputsToDistDir"
Condition=" '$(StagingDir)' != '' ">
<ItemGroup>
<WebHostBinContent Include="$(KlondikeWebHostOutputDir)bin\$(Configuration)\**\*"/>
<WebHostContent Include="$(KlondikeWebHostDir)**\Settings.config"/>
<SelfHostContent Include="$(KlondikeSelfHostOutputDir)bin\$(Configuration)\**\*"/>
<SelfHostContent Remove="$(KlondikeSelfHostOutputDir)bin\$(Configuration)\**\*.config"/>
</ItemGroup>
<Copy SourceFiles="@(WebHostBinContent)" DestinationFolder="$(StagingDir)bin\%(RecursiveDir)"
SkipUnchangedFiles="true"/>
<Copy SourceFiles="@(WebHostContent)" DestinationFolder="$(StagingDir)%(RecursiveDir)"
SkipUnchangedFiles="true"/>
<Copy SourceFiles="@(SelfHostContent)" DestinationFolder="$(StagingDir)bin\%(RecursiveDir)"
SkipUnchangedFiles="true"/>
</Target>
<Target Name="TransformWebConfig"
Condition=" '$(StagingDir)' != '' "
Inputs="$(KlondikeWebHostDir)Web.config;$(KlondikeWebHostDir)Web.$(Configuration).config"
Outputs="$(StagingDir)Web.config">
<Exec
Command="$(TransformCommand) "$(KlondikeWebHostDir)Web.config" "$(KlondikeWebHostDir)Web.$(Configuration).config" "$(StagingDir)Web.config""
Condition="Exists('$(KlondikeWebHostDir)Web.$(Configuration).config')"/>
<Copy SourceFiles="$(KlondikeWebHostDir)Web.config" DestinationFolder="$(StagingDir)"
Condition="!Exists('$(KlondikeWebHostDir)Web.$(Configuration).config')"
SkipUnchangedFiles="true"/>
</Target>
<Target Name="TransformSelfHostConfig"
Condition=" '$(StagingDir)' != '' "
Inputs="$(KlondikeSelfHostDir)App.config;$(KlondikeSelfHostDir)App.Dist.config"
Outputs="$(StagingDir)bin\Klondike.SelfHost.exe.config">
<Exec
Command="$(TransformCommand) "$(KlondikeSelfHostDir)App.config" "$(KlondikeSelfHostDir)App.Dist.config" "$(StagingDir)bin\Klondike.SelfHost.exe.config""/>
</Target>
<Target Name="IntegrationTest" Condition=" '$(TestsEnabled)' == 'true' ">
<MSBuild Projects="$(ProjectDirectory)\integration-tests\test.proj" Properties="DistDir=$(StagingDir)"/>
</Target>
</Project>