@@ -262,6 +262,9 @@ private bool ExecuteGenerateTemporaryTargetAssemblyWithPackageReferenceSupport()
262262 // Add GeneratedCodeFiles to Compile item list.
263263 AddNewItems ( xmlProjectDoc , CompileTypeName , GeneratedCodeFiles ) ;
264264
265+ // Add Analyzers to Analyzer item list.
266+ AddNewItems ( xmlProjectDoc , AnalyzerTypeName , Analyzers ) ;
267+
265268 // Replace implicit SDK imports with explicit SDK imports
266269 ReplaceImplicitImports ( xmlProjectDoc ) ;
267270
@@ -273,7 +276,6 @@ private bool ExecuteGenerateTemporaryTargetAssemblyWithPackageReferenceSupport()
273276 ( nameof ( BaseIntermediateOutputPath ) , BaseIntermediateOutputPath ) ,
274277 ( nameof ( MSBuildProjectExtensionsPath ) , MSBuildProjectExtensionsPath ) ,
275278 ( "_TargetAssemblyProjectName" , Path . GetFileNameWithoutExtension ( CurrentProject ) ) ,
276- ( nameof ( Analyzers ) , Analyzers )
277279 } ;
278280
279281 AddNewProperties ( xmlProjectDoc , properties ) ;
@@ -480,9 +482,20 @@ public bool GenerateTemporaryTargetAssemblyDebuggingInformation
480482 /// Required for Source Generator support. May be null.
481483 ///
482484 /// </summary>
483- public string Analyzers
485+ public ITaskItem [ ] Analyzers
484486 { get ; set ; }
485487
488+ /// <summary>
489+ /// AnalyzerTypeName
490+ /// The appropriate item name which can be accepted by managed compiler task.
491+ /// It is "Analyzer" for now.
492+ ///
493+ /// Adding this property is to make the type name configurable, if it is changed,
494+ /// No code is required to change in this task, but set a new type name in project file.
495+ /// </summary>
496+ [ Required ]
497+ public string AnalyzerTypeName { get ; set ; }
498+
486499 /// <summary>
487500 /// BaseIntermediateOutputPath
488501 ///
0 commit comments