Speed up loading by checking for existing dependency manifest

This commit is contained in:
2024-11-03 16:44:42 -05:00
parent f7c0d65cbc
commit ed4fd11de0

View File

@@ -106,8 +106,13 @@ public class PluginsLifetime : ILoadingStage
{ {
var dir = Path.Join(package.Directory.FullName, "lib", package.ResolvedFramework.GetShortFolderName()); var dir = Path.Join(package.Directory.FullName, "lib", package.ResolvedFramework.GetShortFolderName());
await using (var stream = File.Create(Path.Join(dir, $"{package.Package.Id}.deps.json"))) var path = Path.Join(dir, $"{package.Package.Id}.deps.json");
await manifestBuilder.WriteDependencyManifestAsync(stream, package.Entry, _runtimeFramework); if (!File.Exists(path))
{
await using (var stream = File.Create(path))
await manifestBuilder.WriteDependencyManifestAsync(stream, package.Entry, _runtimeFramework);
}
var client = await sourceMapping.GetClientAsync(package.Package.Id); var client = await sourceMapping.GetClientAsync(package.Package.Id);
var sourceName = packagesConfig.Sources.First(b => b.Url == client.ToString()).Name; var sourceName = packagesConfig.Sources.First(b => b.Url == client.ToString()).Name;