From 19f453039839e5492ce6d5ed831499b41cc1318f Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Wed, 14 Feb 2018 14:29:47 +0100
Subject: [PATCH] Include Mail-Templates as links to Solution Items.

Add the template files as links to the ATxService project, pointing to
the central "Solution Items" files and mark them for copying to the
build output location. Update the Make-Package script accordingly.
---
 ATxService/ATxService.csproj | 14 ++++++++++++++
 Scripts/Make-Package.ps1     |  2 --
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ATxService/ATxService.csproj b/ATxService/ATxService.csproj
index f799eb1..b9c7e86 100644
--- a/ATxService/ATxService.csproj
+++ b/ATxService/ATxService.csproj
@@ -152,6 +152,20 @@
       <Name>ATxCommon</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="..\Resources\Mail-Templates\DiskSpace-Low.txt">
+      <Link>Mail-Templates\DiskSpace-Low.txt</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="..\Resources\Mail-Templates\Transfer-Interrupted.txt">
+      <Link>Mail-Templates\Transfer-Interrupted.txt</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="..\Resources\Mail-Templates\Transfer-Success.txt">
+      <Link>Mail-Templates\Transfer-Success.txt</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
     <PreBuildEvent>PowerShell -NoProfile -ExecutionPolicy RemoteSigned $(SolutionDir)\Scripts\Prepare-Build.ps1 $(ProjectDir)</PreBuildEvent>
diff --git a/Scripts/Make-Package.ps1 b/Scripts/Make-Package.ps1
index 687d29f..6ffddf7 100644
--- a/Scripts/Make-Package.ps1
+++ b/Scripts/Make-Package.ps1
@@ -1,5 +1,4 @@
 $ResourceDir = "..\ATxService\Resources"
-$TemplateDir = "$($ResourceDir)\Mail-Templates"
 $RsrcDirCommon = "..\Resources"
 
 
@@ -49,7 +48,6 @@ $dir = New-Item -ItemType Container -Name $PkgDir
 $dir = New-Item -ItemType Container -Path $PkgDir -Name "AutoTx"
 $tgt = $dir.FullName
 
-Copy-Item -Recurse "$TemplateDir" $tgt
 Copy-Item -Exclude *.pdb -Recurse "$($BinariesDirService)\*" $tgt
 Copy-Item -Exclude *.pdb -Recurse "$($BinariesDirTrayApp)\*" $tgt -EA Ignore
 Copy-Item -Exclude *.pdb -Recurse "$($BinariesDirCfgTest)\*" $tgt -EA Ignore
-- 
GitLab