CodeGen.proj 3.2 KB

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