Welcome to mirror list, hosted at ThFree Co, Russian Federation.

GenerateContent.targets « eng - github.com/dotnet/spa-templates.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8a45413b2e229c704a0791bee9b54652f22d8ad8 (plain)
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
<!-- 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>