-
Notifications
You must be signed in to change notification settings - Fork 28
Remove duplicate files instead of throwing an exception. #151
Conversation
@thorgeir, |
Maybe we can make sure of that by also comparing the actual files? (maybe a quick size+update time?) Because picking multiple different source files and attempting to package them to the same location is most definitely an authoring error that you'd want to flag and make very obvious, I think. Would need adjusting the unit test that verifies this behavior:
(current CI failure) |
Sure, I'll try to add that. |
You need to install the .NET Core SDK which brings in the SDK-style projects/imports. The updated implementation looks 👍 |
I can't see how this change affected the |
hm, that's weird, since there were no other code changes between the last successful build and this one :( |
The package cache lower cases all paths, which no longer matches the package id as we were previously doing. We need to match in a case- insensitive way therefore for private assets matching to succeed. This fixes a broken unit test that was blocking two PRs NuGet#151 and NuGet#150. Also, fix the nuget package versions at the time of this test authoring, so we don't accidentally break if newer packages ever change and cause the expectations to fail.
The package cache lower cases all paths, which no longer matches the package id as we were previously doing. We need to match in a case- insensitive way therefore for private assets matching to succeed. This fixes a broken unit test that was blocking two PRs #151 and #150. Also, fix the nuget package versions at the time of this test authoring, so we don't accidentally break if newer packages ever change and cause the expectations to fail.
4b2db2f
to
6712abc
Compare
Fixed spelling
Throw exception for files with conflicting package path
6712abc
to
67160f3
Compare
Consider easy scenarios like assuming same package path and source full path, same package path, different source file but same length and file size (i.e. same source file added as Content and copied to each project output and added from there). But also add de-duplication of files where even if the last write is different, they still have the same contents, which could be the case for generated files whose source is shared across projects (i.e. in a shared project, or generated via MSBuild, etc.). This covers all de-duplication scenarios we could think of, and only reports the true duplicates that can't be disambiguated by any of the above means, and are truly authoring errors.
67160f3
to
9557076
Compare
When the _PackageContent variable contains duplicates I think it should not result in an exception, maybe a warning but not an exception. Because form my experience the duplicates are not different files but the same file referenced twice.
Removing duplicates in the CreatePackage task works and the package contains all the files it should.
Maybe the duplicates could be resolved earlier in the AssignPackagePath task?