CodeGen.proj 3.3 KB

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