Created
July 8, 2012 00:07
-
-
Save mseankelly/3068663 to your computer and use it in GitHub Desktop.
Subvert NuGet 2.0's insistence that the developer explicitly enable package restore.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites"> | |
<!--Update the NuGet.target file that is generated when you enable NuGet package restore with the following tweak.--> | |
<!--This will make it so that everyone pulling the project from source control will automatically pull the requisite NuGet packages the first time they build.--> | |
<!--While I understand why MS put this in place, it really doesn't make sense in the context of my current team (or any other team I've ever worked on).--> | |
<SetEnvironmentVariable EnvKey="EnableNuGetPackageRestore" EnvValue="true" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " /> | |
<Exec Command="$(RestoreCommand)" | |
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" /> | |
<Exec Command="$(RestoreCommand)" | |
LogStandardErrorAsError="true" | |
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" /> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice! I did something VERY similar except made it a nuget package for all http://nuget.org/packages/NuGetEnablePackageRestore