File size: 7,052 Bytes
090629c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!--
***********************************************************************************************

Microsoft.NET.DesignerSupport.targets



WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have

          created a backup copy.  Incorrect changes to this file will make it

          impossible to load or build your projects from the command-line or the IDE.



Copyright (c) .NET Foundation. All rights reserved.

***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup Condition="'$(DesignerRuntimeImplementationProjectOutputGroupDependsOn)' == ''">
    <DesignerRuntimeImplementationProjectOutputGroupDependsOn>

      $(CommonOutputGroupsDependsOn);

    </DesignerRuntimeImplementationProjectOutputGroupDependsOn>

  </PropertyGroup>


  <PropertyGroup>
    <DesignerRuntimeImplementationProjectOutputGroupDependsOn>

      $(DesignerRuntimeImplementationProjectOutputGroupDependsOn);

      _GenerateDesignerDepsFile;

      _GenerateDesignerRuntimeConfigFile;

      GetCopyToOutputDirectoryItems;

      _GatherDesignerShadowCopyFiles;

    </DesignerRuntimeImplementationProjectOutputGroupDependsOn>


    <_DesignerDepsFileName>$(AssemblyName).designer.deps.json</_DesignerDepsFileName>

    <_DesignerRuntimeConfigFileName>$(AssemblyName).designer.runtimeconfig.json</_DesignerRuntimeConfigFileName>


    <_DesignerDepsFilePath>$(IntermediateOutputPath)$(_DesignerDepsFileName)</_DesignerDepsFilePath>

    <_DesignerRuntimeConfigFilePath>$(IntermediateOutputPath)$(_DesignerRuntimeConfigFileName)</_DesignerRuntimeConfigFilePath>

  </PropertyGroup>


  <Target

    Name="DesignerRuntimeImplementationProjectOutputGroup"

    DependsOnTargets="$(DesignerRuntimeImplementationProjectOutputGroupDependsOn)"

    Returns="@(DesignerRuntimeImplementationProjectOutputGroupOutput)"

    />

  <Target

    Name="_GenerateDesignerDepsFile"

    Inputs="$(MSBuildAllProjectFiles);$(ProjectAssetsFile)"

    Outputs="$(_DesignerDepsFilePath)"

    Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"

    >
    <!--

      NOTE: We do not include the main assembly info or non-NuGet dependencies

      in designer deps file as these files may not be built yet at design time.

      Instead, we rely on SetAppPaths in runtimeconfig to allow loading of

      non-NuGet assets from shadow copied app base directory. This further

      allows loading of designer dll(s) that are not seen by the build.

    -->

    <GenerateDepsFile

      AssemblyName="_"

      AssemblyExtension="_"

      AssemblyVersion="_"

      AssetsFilePath="$(ProjectAssetsFile)"

      DepsFilePath="$(_DesignerDepsFilePath)"

      IncludeMainProject="false"

      IncludeRuntimeFileVersions="$(IncludeFileVersionsInDependencyFile)"

      IsSelfContained="false"

      PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"

      ProjectPath="$(MSBuildProjectFullPath)"

      RuntimeFrameworks="@(RuntimeFramework)"

      CompileReferences="@(ResolvedCompileFileDefinitions)"

      ResolvedNuGetFiles="@(NativeCopyLocalItems);@(ResourceCopyLocalItems);@(RuntimeCopyLocalItems)"

      ResolvedRuntimeTargetsFiles="@(RuntimeTargetsCopyLocalItems)"

      TargetFramework="$(TargetFramework)"

      RuntimeGraphPath="$(RuntimeIdentifierGraphPath)"

      IncludeProjectsNotInAssetsFile="$(IncludeProjectsNotInAssetsFileInDepsFile)"

      />


    <ItemGroup>

      <!-- Designer will rename to <surface process name>.deps.json -->

      <DesignerRuntimeImplementationProjectOutputGroupOutput

        Include="$([MSBuild]::NormalizePath($(_DesignerDepsFilePath)))"

        TargetPath="$(_DesignerDepsFileName)"

        />


      <FileWrites Include="$(_DesignerDepsFilePath)" />

    </ItemGroup>

  </Target>


  <Target

    Name="_GenerateDesignerRuntimeConfigFile"

    Inputs="$(MSBuildAllProjectFiles);$(ProjectAssetsFile)"

    Outputs="$(_DesignerRuntimeConfigFilePath)"

    Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"

    >

    <ItemGroup>

      <_DesignerHostConfigurationOption

        Include="Microsoft.NETCore.DotNetHostPolicy.SetAppPaths"

        Value="true"

        />

    </ItemGroup>


    <GenerateRuntimeConfigurationFiles

      AdditionalProbingPaths="@(AdditionalProbingPath)"

      AssetsFilePath="$(ProjectAssetsFile)"

      HostConfigurationOptions="@(RuntimeHostConfigurationOption);@(_DesignerHostConfigurationOption)"

      IsSelfContained="false"

      PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"

      RuntimeConfigPath="$(_DesignerRuntimeConfigFilePath)"

      RuntimeFrameworks="@(RuntimeFramework)"

      TargetFramework="$(TargetFramework)"

      TargetFrameworkMoniker="$(TargetFrameworkMoniker)"

      UserRuntimeConfig="$(UserRuntimeConfig)"

      WriteAdditionalProbingPathsToMainConfig="true"

      AlwaysIncludeCoreFramework="$(AlwaysIncludeCoreFrameworkInRuntimeConfig)"

      />


    <ItemGroup>

      <!-- Designer will rename to <surface process name>.runtimeconfig.json -->

      <DesignerRuntimeImplementationProjectOutputGroupOutput

        Include="$([MSBuild]::NormalizePath($(_DesignerRuntimeConfigFilePath)))"

        TargetPath="$(_DesignerRuntimeConfigFileName)"

        />


      <FileWrites Include="$(_DesignerRuntimeConfigFilePath)" />

    </ItemGroup>

  </Target>


  <Target Name="_GatherDesignerShadowCopyFiles">
    <ItemGroup>

      <_DesignerShadowCopy Include="@(ReferenceCopyLocalPaths)" />


      <!-- For .NET Core, we do not include NuGet package assets, as the designer will load these from the NuGet cache. -->

      <_DesignerShadowCopy

        Remove="@(_ResolvedCopyLocalBuildAssets)"

        Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"

        />


      <!-- For .NET Core runtime pack assets, we do not include them regardless of whether the app is

              self-contained, as they will be loaded from the shared framework.  However, for runtime pack

              assets where RuntimePackAlwaysCopyLocal is true, there is no shared framework, so we still

              include those.  -->

      <_DesignerShadowCopy

        Remove="@(RuntimePackAsset)"

        Condition="'%(RuntimePackAsset.RuntimePackAlwaysCopyLocal)' != 'true'"

        />


      <DesignerRuntimeImplementationProjectOutputGroupOutput

        Include="@(_DesignerShadowCopy->'%(FullPath)')"

        TargetPath="%(_DesignerShadowCopy.DestinationSubDirectory)%(_DesignerShadowCopy.Filename)%(_DesignerShadowCopy.Extension)"

        />


      <!-- Include ijwhost.dll for projects that use it -->

      <DesignerRuntimeImplementationProjectOutputGroupOutput

        Include="@(AllItemsFullPathWithTargetPath->WithMetadataValue('Filename', '$(_DotNetIjwHostLibraryNameWithoutExtension)')->WithMetadataValue('Extension', '$(_IjwHostLibraryExtension)'))"

        />

    </ItemGroup>

  </Target>


</Project>