See https://github.com/dotnet/source-build-reference-packages/blob/f216638d3d6324b6ec140f826b92a7f853dbdfb7/src/packageSourceGenerator/PackageSourceGenerator.proj#L53 for the background. dotnet/sdk#48030 should enable the replacing the in-lined task with a task defined in the PackageSourceGeneratorTask project (requires rebootstrap). This will improve the maintainability of this code.