CodeGen.proj 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <Project>
  2. <PropertyGroup>
  3. <BuildManaged>true</BuildManaged>
  4. <RepoRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..'))</RepoRoot>
  5. </PropertyGroup>
  6. <Import Project="Build.props" />
  7. <Target Name="GenerateProjectList">
  8. <Message Importance="High" Text="Analyzing @(ProjectToBuild->Count()) projects" />
  9. <MSBuild Projects="@(ProjectToBuild)"
  10. Targets="GetReferencesProvided"
  11. BuildInParallel="true"
  12. SkipNonexistentTargets="true"
  13. SkipNonexistentProjects="true" >
  14. <Output TaskParameter="TargetOutputs" ItemName="_ProjectReferenceProvider"/>
  15. </MSBuild>
  16. <ItemGroup>
  17. <_SharedFrameworkAndPackageRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsShippingPackage', 'true')->Distinct())" />
  18. <_SharedFrameworkRef Include="@(_ProjectReferenceProvider->WithMetadataValue('IsAspNetCoreApp','true')->WithMetadataValue('IsShippingPackage', 'false')->Distinct())" />
  19. <_ProjectReferenceProviderWithRefAssembly Include="@(_ProjectReferenceProvider->HasMetadata('ReferenceAssemblyProjectFileRelativePath'))" />
  20. <_ProjectReferenceProvider Remove="@(_ProjectReferenceProviderWithRefAssembly)" />
  21. </ItemGroup>
  22. <PropertyGroup>
  23. <ProjectListFile>$(MSBuildThisFileDirectory)ProjectReferences.props</ProjectListFile>
  24. <ProjectListContent><![CDATA[<!--
  25. This file is automatically generated. Run `./eng/scripts/GenerateProjectList.ps1` to update.
  26. This file contains a map of assembly names to the projects that build them.
  27. -->
  28. <Project>
  29. <ItemGroup>
  30. @(_ProjectReferenceProvider->'<ProjectReferenceProvider Include="%(Identity)" ProjectPath="%24(RepoRoot)%(ProjectFileRelativePath)" />', '%0A ')
  31. @(_ProjectReferenceProviderWithRefAssembly->'<ProjectReferenceProvider Include="%(Identity)" ProjectPath="%24(RepoRoot)%(ProjectFileRelativePath)" RefProjectPath="%24(RepoRoot)%(ReferenceAssemblyProjectFileRelativePath)" />', '%0A ')
  32. </ItemGroup>
  33. </Project>
  34. ]]></ProjectListContent>
  35. </PropertyGroup>
  36. <!-- Workaround https://github.com/Microsoft/msbuild/issues/1024 -->
  37. <WriteLinesToFile Condition="'$(OS)' == 'Windows_NT'"
  38. File="$(ProjectListFile)" Lines="$([MSBuild]::Escape($(ProjectListContent)))" Overwrite="true" />
  39. <Exec Condition="'$(OS)' != 'Windows_NT'"
  40. Command="echo '$(ProjectListContent.Replace('\t','\\t'))' > $(ProjectListFile)" />
  41. <Message Importance="High" Text="Generated $(ProjectListFile)" />
  42. <PropertyGroup>
  43. <SharedFxDepList>$(MSBuildThisFileDirectory)SharedFramework.Local.props</SharedFxDepList>
  44. <SharedFxDepListContent>
  45. <![CDATA[
  46. <!--
  47. This file is automatically generated. Run `./eng/scripts/GenerateProjectList.ps1` to update.
  48. This file contains a complete list of the assemblies which are part of the shared framework.
  49. This project is generated using the <IsAspNetCoreApp> and <IsShippingPackage> properties from each .csproj in this repository.
  50. -->
  51. <Project>
  52. <ItemGroup>
  53. <!-- These assemblies are available as both a NuGet package and in the shared framework -->
  54. @(_SharedFrameworkAndPackageRef->'<AspNetCoreAppReferenceAndPackage Include="%(Identity)" />', '%0A ')
  55. <!-- These assemblies are only in the shared framework -->
  56. @(_SharedFrameworkRef->'<AspNetCoreAppReference Include="%(Identity)" />', '%0A ')
  57. </ItemGroup>
  58. </Project>
  59. ]]>
  60. </SharedFxDepListContent>
  61. </PropertyGroup>
  62. <WriteLinesToFile File="$(SharedFxDepList)" Lines="$(SharedFxDepListContent)" Overwrite="true" />
  63. <Message Importance="High" Text="Generated $(SharedFxDepList)" />
  64. </Target>
  65. <Target Name="GenerateReferenceSources">
  66. <MSBuild
  67. Projects="@(ProjectToBuild)"
  68. Targets="GenerateReferenceSource"
  69. SkipNonexistentTargets="true"
  70. SkipNonexistentProjects="true" />
  71. </Target>
  72. </Project>