Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@
MSBuildBinPath="$(MSBuildBinPath)"
ReferencePathTypeName="ReferencePath"
CompileTypeName="Compile"
AnalyzerTypeName="Analyzer"
GeneratedCodeFiles="@(_GeneratedCodeFiles)"
ReferencePath="@(ReferencePath)"
BaseIntermediateOutputPath="$(BaseIntermediateOutputPath)"
Expand All @@ -472,7 +473,7 @@
CompileTargetName="$(_CompileTargetNameForLocalType)"
GenerateTemporaryTargetAssemblyDebuggingInformation="$(GenerateTemporaryTargetAssemblyDebuggingInformation)"
IncludePackageReferencesDuringMarkupCompilation="$(IncludePackageReferencesDuringMarkupCompilation)"
Analyzers="$(Analyzers)"
Analyzers="@(Analyzer)"
TemporaryTargetAssemblyProjectName="$(_TemporaryTargetAssemblyProjectName)"
MSBuildProjectExtensionsPath="$(MSBuildProjectExtensionsPath)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -273,7 +276,6 @@ private bool ExecuteGenerateTemporaryTargetAssemblyWithPackageReferenceSupport()
( nameof(BaseIntermediateOutputPath), BaseIntermediateOutputPath ),
( nameof(MSBuildProjectExtensionsPath), MSBuildProjectExtensionsPath ),
( "_TargetAssemblyProjectName", Path.GetFileNameWithoutExtension(CurrentProject) ),
( nameof(Analyzers), Analyzers )
};

AddNewProperties(xmlProjectDoc, properties);
Expand Down Expand Up @@ -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
///
Expand Down