Skip to content

Instantly share code, notes, and snippets.

@nkolev92
Last active May 23, 2017 21:33
Show Gist options
  • Save nkolev92/812a3b84ff8eff1012a34b0749ee0a3e to your computer and use it in GitHub Desktop.
Save nkolev92/812a3b84ff8eff1012a34b0749ee0a3e to your computer and use it in GitHub Desktop.
NuGet Client Development Productivity Tips & Tricks
$nugetClientRoot="C:\Code\Nuget.Client"
Function Run-NuGetTargetsCustom($projectPath, $target, $extra)
{
$buildPath = Join-Path $nugetClientRoot "src\NuGet.Core\NuGet.Build.Tasks"
$publishDllPath = Join-Path $nugetClientRoot "artifacts\NuGet.Build.Tasks\15.0\bin\Debug\net45\NuGet.Build.Tasks.dll"
$targetsPath = Join-Path $nugetClientRoot "src\NuGet.Core\NuGet.Build.Tasks\NuGet.targets"
Write-Host "msbuild $projectPath /t:$target /p:NuGetRestoreTargets=$targetsPath /p:RestoreTaskAssemblyFile=$publishDllPath $extra"
& msbuild $projectPath /t:$target /p:NuGetRestoreTargets=$targetsPath /p:RestoreTaskAssemblyFile=$publishDllPath $extra
}
#Example usage:
# Run-NuGetTargetsCustom solution.sln GenerateRestoreGraphFile /p:RestoreGraphOutputPath="out.dg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment