ploeh / ZeroToNine

A tool for maintaining .NET Assembly versions across multiple files.
MIT License
147 stars 16 forks source link

Features #23

Closed Mike-E-angelo closed 8 years ago

Mike-E-angelo commented 8 years ago

I hate to suggest ideas because that makes me fodder to for signing up for them. :) But I was thinking it would be really nice to have this as a VSIX/Gui at the SLN level in Visual Studio. That way you can right-click and set the new version across the board. Of course. It would be nice to maybe auto-increment versions with each build (or commit) as well. :)

These are two features... I wanted to throw them out there to see how they stick (or ensure I understand everything correctly) before splitting them up.

ploeh commented 8 years ago

Thank you for writing these suggestions.

It's been more than ten years since I dabbled in writing Visual Studio extensions, but that experience left me with a desire to avoid doing that in the future. It's possible that the experience has improved since then, but what I gather from e.g. my Twitter stream, I get the impression that it's still painful.

Unless someone can prove to me that writing this as a Visual Studio extension is not painful, I don't want to take on the maintenance burden in ZeroToNine.

This ought not to prevent other people from creating such an extension. While Zero29 is a command-line tool, ZeroToNine is a library. It ought to be possible to build a GUI on top of it.

When it comes to auto-incrementing, does Visual Studio have some sort of commit hook you can use to call Zero29?

Mike-E-angelo commented 8 years ago

Well that is a good point. I haven't seen a lot of positive praise for VSIX, either, to be honest. There is definitely a lot of friction involved with it, so unless you have taken the dive to round out the rough edges, it is probably quite the unpleasant adventure.

Visual Studio does indeed have pre & post build hooks, but they are per-project. Ideally this is a task that would be solution-wide and would be configurable as such. The other component here (if I understand correctly) is ensuring a storage mechanism for the current version. Essentially, creating the version, storing it, and then incrementing it after it has been stored on subsequent runs.

I have run into this problem before, can't you tell? :smile: It's especially compounded in CI/CD scenarios and you have to elegantly (good luck with that!) inject it within the automated build pipeline. There are tasks for that, but they are about as fun to work with as VSIX. :stuck_out_tongue:

ploeh commented 8 years ago

The entire purpose of Zero29 is to make all of that painless, which I find that it is:

Mike-E-angelo commented 8 years ago

Ah you know what Mark... I have to admit there were some neurons firing off in the back of my mind that you had written an article about this and I had read it before. thank you for appealing to my laziness. :angel:

Also... I just now had another thought... Wouldn't it be possible to tie into the External Tools dialog?

(Seen here without Zero29... yet. :smile: )

Looks like you can also prompt for arguments as well. I imagine it would be as simple as creating a .bat file and point it to that. I have never used it, but it might be worth exploring as the poor developer's VSIX. :sunglasses:

ploeh commented 8 years ago

Sounds good. Is there any work left regarding this issue, or should we close it?

Mike-E-angelo commented 8 years ago

Oh yeah... that. :smile: Thanks again!

Mike-E-angelo commented 8 years ago

FWIW I was finally able to get this installed and got it working really quickly, and of course it works like a champ! In case anyone else is interested, I set up four commands via External Tools:

Here's what it looks like in my Tools menu now:

For each command I have the following settings:

Zero29 Increment Patch C:\Users\.nuget\packages\Zero29\1.0.0\tools\Zero29.exe -i patch $(SolutionDir)

Zero29 Increment Minor C:\Users\.nuget\packages\Zero29\1.0.0\tools\Zero29.exe -i minor $(SolutionDir)

Zero29 Increment Major C:\Users\.nuget\packages\Zero29\1.0.0\tools\Zero29.exe -i major $(SolutionDir) (I also Prompt for arguments in case this command is accidentally selected)

Zero29 Assign C:\Users\.nuget\packages\Zero29\1.0.0\tools\Zero29.exe -a 0.1.0.0 $(SolutionDir)

Hopefully this might help out those who are adverse/fear the CLI and prefer the pretty menus/UI. :)

ploeh commented 8 years ago

Nice 👍 I turned it into a tweet 😄 https://twitter.com/ploeh/status/781928926067195908

Mike-E-angelo commented 8 years ago

Very cool! Thank you @ploeh!