Closed Leogiciel closed 7 years ago
GroupBy followed by Select(p => p.First()) is the same as Distinct(), which is already used by the calling methods, so this should be superfluous here.
They are distinct on the file path, not on the filename.
GroupBy(p=>p.FileName).Select(gp=>gp.First()) permit to do a "DistinctBy" approach.
This PR reverts all the code added during the last weeks, so I don't think it's a good idea to merge it.
It would be more helpful if you could use the tip of the main branch and create issues only for things not working there.
Yes, the distinct on the file path is intended. What is not working?
Also it's not a good idea to start adding workarounds and leave alone wrong code. If you think the distinct is wrong, fix it, not add another one at a different place.
Distinct on the file name is definitely wrong, e.g. all localized resource dlls will have the same file name, but are stored in a different folder each.
It's the only place where we can implement a Distinct on FileName, because some references can come from GetBuildFiles and from GetLocalFileReferences. The only way to avoid that is to make the distinct on FileName after the Concat.
Here is an example :
Ok you're right for the resources... So we have to make a distinct on file destination, not on file source !
NB1 : The PR only reverts changeset b49c60a because we worked on the same bug at the same time, and I implemented my fix in an other way than yours.
Your fix is only partial, because second-tier references are not placed into "bin" output, and can be duplicated.
NB2 : each bug I opened is active on your main branch, maybe my API project contains specificities (eg : references) which disable you to reproduce them.
Then you did not try the latest version, second-tier references are already fixed. I also have changed ProjectOutput to use the target name, so this should work now as expected.
I did dude...
I'll reproduce them immediately on your branch and update the issues with screens.
Yes, a "how to reproduce" would be very helpful!
I just saw your last commit, sorry. It just fixed duplicated references, and some of the duplicated which were going to TargetDir and not "bin". Well done.
The missing ComponentGroupRef is still active, I close the other twos and the PR.
Thank you !
Fix for #26 : Add a GroupBy on FileName to fix duplicated second-tier references
Fix for #22 : This is how I handled ASP.Net architecture, and now Wax behaves exactly how needed