提交 97ed499d 编写于 作者: T ThomasGoulet73 提交者: Ashish Singh

Fix build when using source generators (#6534)

Fixes dotnet/wpf#6522
上级 939e70b4
......@@ -464,6 +464,7 @@
MSBuildBinPath="$(MSBuildBinPath)"
ReferencePathTypeName="ReferencePath"
CompileTypeName="Compile"
AnalyzerTypeName="Analyzer"
GeneratedCodeFiles="@(_GeneratedCodeFiles)"
ReferencePath="@(ReferencePath)"
BaseIntermediateOutputPath="$(BaseIntermediateOutputPath)"
......@@ -472,7 +473,7 @@
CompileTargetName="$(_CompileTargetNameForLocalType)"
GenerateTemporaryTargetAssemblyDebuggingInformation="$(GenerateTemporaryTargetAssemblyDebuggingInformation)"
IncludePackageReferencesDuringMarkupCompilation="$(IncludePackageReferencesDuringMarkupCompilation)"
Analyzers="$(Analyzers)"
Analyzers="@(Analyzer)"
TemporaryTargetAssemblyProjectName="$(_TemporaryTargetAssemblyProjectName)"
MSBuildProjectExtensionsPath="$(MSBuildProjectExtensionsPath)"
>
......
......@@ -262,6 +262,9 @@ private bool ExecuteGenerateTemporaryTargetAssemblyWithPackageReferenceSupport()
// Add GeneratedCodeFiles to Compile item list.
AddNewItems(xmlProjectDoc, CompileTypeName, GeneratedCodeFiles);
// Add Analyzers to Analyzer item list.
AddNewItems(xmlProjectDoc, AnalyzerTypeName, Analyzers);
// Replace implicit SDK imports with explicit SDK imports
ReplaceImplicitImports(xmlProjectDoc);
......@@ -273,7 +276,6 @@ private bool ExecuteGenerateTemporaryTargetAssemblyWithPackageReferenceSupport()
( nameof(BaseIntermediateOutputPath), BaseIntermediateOutputPath ),
( nameof(MSBuildProjectExtensionsPath), MSBuildProjectExtensionsPath ),
( "_TargetAssemblyProjectName", Path.GetFileNameWithoutExtension(CurrentProject) ),
( nameof(Analyzers), Analyzers )
};
AddNewProperties(xmlProjectDoc, properties);
......@@ -480,9 +482,20 @@ public bool GenerateTemporaryTargetAssemblyDebuggingInformation
/// Required for Source Generator support. May be null.
///
/// </summary>
public string Analyzers
public ITaskItem[] Analyzers
{ get; set; }
/// <summary>
/// AnalyzerTypeName
/// The appropriate item name which can be accepted by managed compiler task.
/// It is "Analyzer" for now.
///
/// Adding this property is to make the type name configurable, if it is changed,
/// No code is required to change in this task, but set a new type name in project file.
/// </summary>
[Required]
public string AnalyzerTypeName { get; set; }
/// <summary>
/// BaseIntermediateOutputPath
///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册