Read PackageDefinitions and PackageDependencies from the cache assets file instead of ResolvePackageDependencies
Fixes #27738
We want to avoid reading the assets file because it is a large file, which can cause performance degradation in design-time builds for large projects when executing ResolvePackageDependencies.
To improve this, the assets cache file in ResolvePackageAssets will now keep track of PackageDefinitions and PackageDependencies.
The change:
Output PackageDefinitions and PackageDependencies items from ResolvePackageAssets, and modified the targets so that ResolvePackageDependencies is only called when EmitLegacyAssetsFileItems is true.
All the code related to EmitLegacyAssetsFileItems in ResolvePackageDependencies was removed since there is case for when the value is false.
Unit-tests were modified to remove EmitLegacyAssetsFileItems in ResolvePackageDependencies.