clairernovotny / ReferenceGenerator

MIT License
75 stars 13 forks source link

Targets file requires SolutionDir to be set #7

Closed dsplaisted closed 8 years ago

dsplaisted commented 8 years ago

The targets file uses SolutionDir as the root to find the NuSpec files if there's nothing in the NuSpecFile ItemGroup. In the MSBuild and CoreFx repos (and maybe others), we don't use a solution file for our command-line build, so this property isn't set.

If the SolutionDir property isn't set, it would be nice if the targets file would do something like just use the project folder or one level up from it.

clairernovotny commented 8 years ago

Pull requests welcome ;)

clairernovotny commented 8 years ago

Seriously though, what do you think are the best options -- you prob know MSBuild better than I do.... the only catch is that a full path is required, though ....\ should be ok.

dsplaisted commented 8 years ago

I would use $(MSBuildProjectDirectory)\..\ if the SolutionDir isn't defined. I don't think it needs to be a full path, but if it does need to be you can call Path.GetFullPath using this syntax:

$([System.IO.Path]::GetFullPath($(MSBuildProjectDirectory)\..\)

clairernovotny commented 8 years ago

How many level's up should I search? And what's the best way? Multiple NuSpecFile conditional on the previous one being blank?

It is just a default/convention; it can always be directly specified.

dsplaisted commented 8 years ago

Since it's just the default, I would go with just one level up until someone else complains :-)

clairernovotny commented 8 years ago

fixed in 1.3.2