2017-01-06 22:48:27 +00:00
|
|
|
<Project ToolsVersion="15.0" DefaultTargets="CopyTemplateToOutput">
|
2017-01-11 09:49:22 +00:00
|
|
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
|
|
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
|
2017-01-06 22:48:27 +00:00
|
|
|
|
|
|
|
<Target Name="CopyTemplateToOutput"
|
|
|
|
DependsOnTargets="PrepareBundledTemplateProps;
|
|
|
|
EnsureTemplateRestored;
|
|
|
|
GetTemplateItemsToCopy"
|
|
|
|
Inputs="@(TemplateContent)"
|
|
|
|
Outputs="@(TemplateContent->'$(TemplateLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')">
|
|
|
|
<Copy SourceFiles="@(TemplateContent)"
|
|
|
|
DestinationFiles="@(TemplateContent->'$(TemplateLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
|
|
|
|
|
|
|
|
<Message Text="Copied template $(TemplatePackageName) from $(TemplateNuPkgPath) to $(TemplateLayoutDirectory)."
|
|
|
|
Importance="High" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="GetTemplateItemsToCopy">
|
|
|
|
<ItemGroup>
|
|
|
|
<TemplateContent Include="$(TemplateNuPkgPath)/$(TemplatePackageName.ToLower()).$(TemplatePackageVersion.ToLower()).nupkg" />
|
|
|
|
</ItemGroup>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="EnsureTemplateRestored"
|
|
|
|
Condition="!Exists('$(TemplateNuPkgPath)/$(TemplatePackageName.ToLower()).nuspec')">
|
|
|
|
<DotNetRestore ToolPath="$(Stage0Directory)"
|
|
|
|
ProjectPath="$(MSBuildThisFileDirectory)/templates/templates.csproj"
|
|
|
|
AdditionalParameters="/p:TemplatePackageName=$(TemplatePackageName) /p:TemplatePackageVersion=$(TemplatePackageVersion)" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="PrepareBundledTemplateProps">
|
|
|
|
<PropertyGroup>
|
|
|
|
<TemplateNuPkgPath>$(NuGetPackagesDir)/$(TemplatePackageName.ToLower())/$(TemplatePackageVersion.ToLower())</TemplateNuPkgPath>
|
|
|
|
</PropertyGroup>
|
|
|
|
</Target>
|
|
|
|
</Project>
|