Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuspec diff noise due to lack of sorting #22

Open
AArnott opened this issue Apr 6, 2016 · 2 comments
Open

nuspec diff noise due to lack of sorting #22

AArnott opened this issue Apr 6, 2016 · 2 comments

Comments

@AArnott
Copy link
Contributor

AArnott commented Apr 6, 2016

I am frequently seeing changes to my .nuspec source file from a build because the ReferenceGenerator reorders dependencies, such as this one:

-        <dependency id="Microsoft.VisualStudio.Threading" version="14.1.114" />
-        <dependency id="Newtonsoft.Json" version="6.0.6" />
         <dependency id="System.AppContext" version="4.0.0" />
         <dependency id="System.Collections" version="4.0.10" />
         <dependency id="System.Diagnostics.Debug" version="4.0.10" />
         <dependency id="System.Diagnostics.Process" version="4.0.0-beta-23409" />
         <dependency id="System.Globalization" version="4.0.10" />
         <dependency id="System.IO" version="4.0.10" />
         <dependency id="System.IO.FileSystem" version="4.0.0" />
         <dependency id="System.Linq" version="4.0.0" />
         <dependency id="System.Net.Primitives" version="4.0.10" />
         <dependency id="System.Runtime" version="4.0.20" />
         <dependency id="System.Runtime.Extensions" version="4.0.10" />
         <dependency id="System.Security.Claims" version="4.0.0" />
         <dependency id="System.Security.Cryptography.Algorithms" version="4.0.0-beta-23409" />
         <dependency id="System.Security.Cryptography.Primitives" version="4.0.0-beta-23409" />
         <dependency id="System.Security.Principal.Windows" version="4.0.0-beta-23409" />
         <dependency id="System.Text.Encoding" version="4.0.10" />
         <dependency id="System.Threading" version="4.0.10" />
         <dependency id="System.Threading.Tasks" version="4.0.10" />
+        <dependency id="Microsoft.VisualStudio.Threading" version="14.1.114" />
+        <dependency id="Newtonsoft.Json" version="6.0.6" />

If I let that get checked in, the next build may switch it back. And so it goes, back and forth.

Can this build step please consistently sort?

@clairernovotny
Copy link
Owner

It's supposed to be sorting alphabetically by package id, so I'm not sure what's going on. I have seen this a few times but can't repro it:

https://github.com/onovotny/ReferenceGenerator/blob/master/src/ReferenceGenerator/Program.cs#L98

@AArnott
Copy link
Contributor Author

AArnott commented Apr 6, 2016

It looks like you don't sort the whole list. You only sort your insertion into the list. So your list's position relative to other elements (that I've added myself) evidently is undefined?

https://github.com/onovotny/ReferenceGenerator/blob/master/src/ReferenceGenerator/Program.cs#L157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants