From 585c884489832fb79351fb9849a67bf453d2e6c3 Mon Sep 17 00:00:00 2001 From: amaitland Date: Thu, 2 Oct 2014 20:24:49 +1000 Subject: [PATCH] Add NugetPackageRestore method to restore packages if they don't exist (no need to open VS to build cefsharp3 now) --- build.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.ps1 b/build.ps1 index 8488d08b8..4db47b3ac 100644 --- a/build.ps1 +++ b/build.ps1 @@ -194,6 +194,19 @@ function VSX Write-Diagnostic "Finished build targeting toolchain $Toolchain" } +function NugetPackageRestore +{ + $nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe + if(-not (Test-Path $nuget)) { + Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget" + } + + Write-Diagnostic "Restore Nuget Packages" + + # Restore packages + . $nuget restore $CefSln +} + function Nupkg { $nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe @@ -209,6 +222,8 @@ function Nupkg . $nuget pack nuget\CefSharp.WinForms.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget } +NugetPackageRestore + switch -Exact ($Target) { "nupkg" {