@@ -50,6 +50,21 @@ Copyright (c) .NET Foundation. All rights reserved.
5050 <PrimaryOutputFrameworkSpecific >@(_PrimaryOutputKind)</PrimaryOutputFrameworkSpecific >
5151 </PropertyGroup >
5252
53+ <!-- Ensure TargetPath -->
54+ <AssignTargetPath Files =" @(Content)" RootFolder =" $(MSBuildProjectDirectory)"
55+ Condition =" '%(Content.Pack)' == 'true' or
56+ '%(Content.Kind)' != '' or
57+ ('$(IncludeContentInPackage)' == 'true' and '%(Content.Pack)' != 'false')" >
58+ <Output TaskParameter =" AssignedFiles" ItemName =" _ContentToInfer" />
59+ </AssignTargetPath >
60+
61+ <AssignTargetPath Files =" @(None)" RootFolder =" $(MSBuildProjectDirectory)"
62+ Condition =" '%(None.Pack)' == 'true' or
63+ '%(None.Kind)' != '' or
64+ ('$(IncludeNoneInPackage)' == 'true' and '%(None.Pack)' != 'false')" >
65+ <Output TaskParameter =" AssignedFiles" ItemName =" _NoneToInfer" />
66+ </AssignTargetPath >
67+
5368 <ItemGroup >
5469 <_InferredPackageFile Include =" @(BuiltProjectOutputGroupOutput -> '%(FinalOutputPath)');@(BuiltProjectOutputGroupKeyOutput -> '%(FinalOutputPath)')"
5570 Condition =" '$(IncludeOutputsInPackage)' == 'true' and '$(IsPackagingProject)' != 'true'" >
@@ -85,51 +100,28 @@ Copyright (c) .NET Foundation. All rights reserved.
85100 <FrameworkSpecific >$(PrimaryOutputFrameworkSpecific)</FrameworkSpecific >
86101 </_InferredPackageFile >
87102
103+
88104 <!-- NOTE: Content is opt-out (must have Pack=false to exclude if IncludeContentInPackage=true) -->
89105 <!-- Stuff that is copied to output should be included from that output location -->
90- <_InferredPackageFile Include =" @(ContentWithTargetPath->'$(OutputPath)%(TargetPath)')"
91- Condition ="
92- '%(ContentWithTargetPath.CopyToOutputDirectory)' != '' and
93- (
94- '%(ContentWithTargetPath.Pack)' == 'true' or
95- '%(ContentWithTargetPath.Kind)' != '' or
96- ('$(IncludeContentInPackage)' == 'true' and '%(ContentWithTargetPath.Pack)' != 'false')
97- )" >
98- <Kind Condition =" '%(ContentWithTargetPath.Kind)' == '' and '%(ContentWithTargetPath.CopyToOutputDirectory)' != ''" >$(PrimaryOutputKind)</Kind >
106+ <_InferredPackageFile Include =" @(_ContentToInfer->'$(OutputPath)%(TargetPath)')"
107+ Condition =" '%(_ContentToInfer.CopyToOutputDirectory)' != ''" >
108+ <Kind Condition =" '%(_ContentToInfer.Kind)' == ''" >$(PrimaryOutputKind)</Kind >
99109 </_InferredPackageFile >
100- <!-- Otherwise, include from source location -->
101- <_InferredPackageFile Include =" @(ContentWithTargetPath->'%(FullPath)')"
102- Condition ="
103- '%(ContentWithTargetPath.CopyToOutputDirectory)' == '' and
104- (
105- '%(ContentWithTargetPath.Pack)' == 'true' or
106- '%(ContentWithTargetPath.Kind)' != '' or
107- ('$(IncludeContentInPackage)' == 'true' and '%(ContentWithTargetPath.Pack)' != 'false')
108- )" >
109- <Kind Condition =" '%(ContentWithTargetPath.Kind)' == ''" >Content</Kind >
110+ <!-- Otherwise, include from source location and default to content -->
111+ <_InferredPackageFile Include =" @(_ContentToInfer->'%(FullPath)')"
112+ Condition =" '%(_ContentToInfer.CopyToOutputDirectory)' == ''" >
113+ <Kind Condition =" '%(_ContentToInfer.Kind)' == ''" >Content</Kind >
110114 </_InferredPackageFile >
111115
112116 <!-- NOTE: None is also opt-out (must have Pack=false to exclude if IncludeNoneInPackage=true, but this property defaults to false) -->
113117 <!-- Likewise, include from target path if it's copied, from source path otherwise -->
114- <_InferredPackageFile Include =" @(_NoneWithTargetPath->'$(OutputPath)%(TargetPath)')"
115- Condition ="
116- '%(_NoneWithTargetPath.CopyToOutputDirectory)' != '' and
117- (
118- '%(_NoneWithTargetPath.Pack)' == 'true' or
119- '%(_NoneWithTargetPath.Kind)' != '' or
120- ('$(IncludeNoneInPackage)' == 'true' and '%(_NoneWithTargetPath.Pack)' != 'false')
121- )" >
122- <Kind Condition =" '%(_NoneWithTargetPath.Kind)' == '' and '%(_NoneWithTargetPath.CopyToOutputDirectory)' != ''" >$(PrimaryOutputKind)</Kind >
118+ <_InferredPackageFile Include =" @(_NoneToInfer->'$(OutputPath)%(TargetPath)')"
119+ Condition =" '%(_NoneToInfer.CopyToOutputDirectory)' != ''" >
120+ <Kind Condition =" '%(_NoneToInfer.Kind)' == ''" >$(PrimaryOutputKind)</Kind >
123121 </_InferredPackageFile >
124- <_InferredPackageFile Include =" @(_NoneWithTargetPath->'%(FullPath)')"
125- Condition ="
126- '%(_NoneWithTargetPath.CopyToOutputDirectory)' == '' and
127- (
128- '%(_NoneWithTargetPath.Pack)' == 'true' or
129- '%(_NoneWithTargetPath.Kind)' != '' or
130- ('$(IncludeNoneInPackage)' == 'true' and '%(_NoneWithTargetPath.Pack)' != 'false')
131- )" >
132- <Kind Condition =" '%(_NoneWithTargetPath.Kind)' == ''" >None</Kind >
122+ <_InferredPackageFile Include =" @(_NoneToInfer->'%(FullPath)')"
123+ Condition =" '%(_NoneToInfer.CopyToOutputDirectory)' == ''" >
124+ <Kind Condition =" '%(_NoneToInfer.Kind)' == ''" >None</Kind >
133125 </_InferredPackageFile >
134126
135127
0 commit comments