-
Notifications
You must be signed in to change notification settings - Fork 224
"kpm build" shows detailed dependency information by default #736
"kpm build" shows detailed dependency information by default #736
Conversation
|
||
private void ShowDependencyInformation(IReport report) | ||
{ | ||
foreach (var projectDependency in _applicationHostContext.ProjectDepencyProvider.Dependencies) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, walk over DependencyWalker.Libraries. You can use the NuGetDependencyProvider to figure out what assemblies are used for package dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the suggestion, the code is much simpler now.
df99406
to
5fc00b1
Compare
|
||
if (library.Type == "Package") | ||
{ | ||
var libraryKey = new LibraryKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is right. I believe you need logic similar to this:
And:
Can you verify that the assemblies used in the compilations are the same, I have a feeling it might be different.
8d954d7
to
05a85ba
Compare
var metadataFileRefs = projectExport.MetadataReferences | ||
.OfType<IMetadataFileReference>(); | ||
|
||
var resolver = new DefaultPackagePathResolver(_applicationHostContext.PackagesDirectory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this? Library.Path is the package path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Can you show the output with --quiet, with and without errors. It should say building {project name} for {target framework} |
private void ShowDependencyInformation(IReport report) | ||
{ | ||
// Make lookup for actual package dependency assemblies | ||
var projectExport = _applicationHostContext.LibraryManager.GetAllExports(_project.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this end up causing things to build twice? Or does it work because the cache is shared across these 2 calls to GetAllExports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By turning on KRE_TRACE
, I find that the project is only compiled once. So I guess we only build things once here. The caching logic is not obvious and I am still looking at code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProjectLibraryExportProvider
is caching build results, so this doesn't cause things to build twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we reuse the project export?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exports reusing was added in the latest commmit
|
|
Latest sample output:
|
|
- Make output format of "kpm pack" consistent with "kpm build" - Use assembly paths from metadata references - Add "Building {project} for {framework}" - Reuse exports produced by LibraryManager
d8e332b
to
8ad36f8
Compare
parent #305