jennings / SemVerHarvester

SemVerHarvester is a MSBuild task library that harvests version numbers from tags in source control repositories. Eventually I should fold this into MSBuild Community Tasks.
14 stars 7 forks source link

Auto detect GitPath #6

Closed Grynn closed 11 years ago

Grynn commented 11 years ago

Hi,

The attached code auto-detects the GitPath, which allows making the GitPath attribute of the SemVerGitHarvester optional instead of required. This could simplify usage.

Auto-detection is basically just guessing the path - I check the system %PATH% and some well known locations like %ProgramFiles%\git\bin etc.

jennings commented 11 years ago

Wow, I didn't expect to actually get contributions, that's fantastic.

I remember wanting to auto-detect the Git location, so this is great. I do have a couple concerns, though. It looks like this change will behave differently on different frameworks, since we're calling IsNullOrWhitespace on .NET 4.0 and IsNullOrEmpty on other frameworks. I'm also concerned that we no longer test that a missing git.exe leads to Execute() returning false.

Do you have any thoughts? Perhaps I've misunderstood the change.

Grynn commented 11 years ago

What would be great is if we could check for the existence of 'IsNullOrWhitespace' so it would work with say .net 4.5 as well....

jennings commented 11 years ago

@Grynn I just realized I never followed up with this. I don't think I really have the time to work on this anymore, so I made you a collaborator on this repo so you can changes if you want to.

Grynn commented 11 years ago

Kewl! Thanks, I have not looked at this in sometime, but will try and commit ...