37 строки
1.7 KiB
XML
37 строки
1.7 KiB
XML
<!-- Copied from https://github.com/dotnet/aspnetcore/blob/0c5456afe95096db6ac5400cecd3440299b42714/src/ProjectTemplates/GenerateContent.targets. -->
|
|
<Project>
|
|
<PropertyGroup>
|
|
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
|
|
|
<!-- Use for incremental builds. When versions or dependencies of templates change, this file is updated and causes a re-build. -->
|
|
<_GenerateContentPropertiesHashFile>$(IntermediateOutputPath)$(MSBuildProjectName).content.g.cache</_GenerateContentPropertiesHashFile>
|
|
</PropertyGroup>
|
|
|
|
<!--
|
|
Generates the content properties hash file.
|
|
-->
|
|
<Target Name="GetGeneratedContentPropertiesHash">
|
|
<Hash ItemsToHash="$(GeneratedContentProperties)">
|
|
<Output TaskParameter="HashResult" PropertyName="_GeneratedContentPropertiesHash" />
|
|
</Hash>
|
|
|
|
<WriteLinesToFile Overwrite="true" Lines="$(_GeneratedContentPropertiesHash)" File="$(_GenerateContentPropertiesHashFile)" WriteOnlyWhenDifferent="true" />
|
|
</Target>
|
|
|
|
<Target Name="GenerateContent"
|
|
DependsOnTargets="GetGeneratedContentPropertiesHash"
|
|
BeforeTargets="CoreCompile"
|
|
Inputs="$(MSBuildAllProjects);$(_GenerateContentPropertiesHashFile);@(GeneratedContent)"
|
|
Outputs="@(GeneratedContent->'%(OutputPath)')">
|
|
|
|
<GenerateFileFromTemplate
|
|
TemplateFile="%(GeneratedContent.Identity)"
|
|
Properties="$(GeneratedContentProperties);%(GeneratedContent.AdditionalProperties)"
|
|
OutputPath="%(GeneratedContent.OutputPath)">
|
|
|
|
<Output TaskParameter="ResolvedOutputPath" ItemName="FileWrites" />
|
|
<Output TaskParameter="ResolvedOutputPath" ItemName="Content" />
|
|
</GenerateFileFromTemplate>
|
|
</Target>
|
|
</Project>
|