mikefourie-zz / MSBuildExtensionPack

MIT License
366 stars 104 forks source link

Update NuGet package to automatically add import to your targets file #17

Closed polewskm closed 9 years ago

polewskm commented 9 years ago

http://docs.nuget.org/docs/release-notes/nuget-2.5#Automatic_import_of_msbuild_targets_and_props_files

With the latest version of NuGet, you can create your NuGet package so that it automatically adds an import to your targets file. This would eliminate the need us to guess where the targets file is located and be able to immediately use your custom MSBuild tasks within a project.

swn1 commented 9 years ago

7 is similar, Mike closed it in November but has not pushed a new package to the public NuGet repository since July 2014. I've not yet taken the time to understand how to build it but I've got a team about to start using it so I may have to. I'll update here when I do.

mikefourie-zz commented 9 years ago

Hi, not sure why I closed #7 with that change. Anyway I'll look at this issue now and see if we can get a release out to tie up all the loose ends. Sorry for the extremely long delay on a new release...

mikefourie-zz commented 9 years ago

@polewskm so you are referring to the following right?

Automatic import of msbuild targets and props files A new conventional folder has been created at the top level of the NuGet package. As a peer to \lib, \content, and \tools, you can now include a '\build' folder in your package. Under this folder, you can place two files with fixed names, {packageid}.targets or {packageid}.props. These two files can be either directly under \build or under framework-specific folders just like the other folders. The rule for picking the best-matched framework folder is exactly the same as in those.

When NuGet installs a package with \build files, it will add an MSBuild element in the project file pointing to the .targets and .props files. The .props file is added at the top, whereas the .targets file is added to the bottom.

mikefourie-zz commented 9 years ago

This is implemented in the 1.6.0 nuget package. Let me know if you have any issues