Skip to content

Commit

Permalink
RavenDB-4143 restoring nuget packages before compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ppekrol committed Dec 19, 2015
1 parent df8c483 commit 98b83d0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
Binary file modified .nuget/NuGet.exe
Binary file not shown.
32 changes: 19 additions & 13 deletions default.ps1
Expand Up @@ -20,6 +20,9 @@ properties {
$liveTest_dir = "C:\Sites\RavenDB 3\Web"
$uploader = "..\Uploader\S3Uploader.exe"
$global:configuration = "Release"
$v4_net_version = (ls "$env:windir\Microsoft.NET\Framework\v4.0*").Name
$msbuild = "C:\Windows\Microsoft.NET\Framework\$v4_net_version\MSBuild.exe"
$nowarn = "1591 1573 1591"

$dnxVersion = "1.0.0-rc1-update1"
$dnxArchitecture = "x64"
Expand All @@ -28,6 +31,8 @@ properties {
$dnxRuntimeDir = "$env:USERPROFILE\.dnx\runtimes\dnx-coreclr-win-$dnxArchitecture.$dnxVersion\bin";
$dnu = "$dnxRuntimeDir\dnu.cmd"
$dnx = "$dnxRuntimeDir\dnx.exe"

$nuget = "$base_dir\.nuget\NuGet.exe"
}

task default -depends Test, DoReleasePart1
Expand All @@ -38,13 +43,16 @@ task Verify40 {
}
}


task Clean {
Remove-Item -force -recurse $build_dir -ErrorAction SilentlyContinue
Remove-Item -force -recurse $release_dir -ErrorAction SilentlyContinue
}

task Init -depends Verify40, Clean {
task NuGet {
&"$nuget" restore "$sln_file"
}

task Init -depends Verify40, Clean, NuGet {

$commit = Get-Git-Commit
(Get-Content "$base_dir\CommonAssemblyInfo.cs") |
Expand All @@ -60,11 +68,10 @@ task Init -depends Verify40, Clean {
task Compile -depends Init, CompileHtml5 {

$commit = Get-Git-Commit-Full
$v4_net_version = (ls "$env:windir\Microsoft.NET\Framework\v4.0*").Name


Write-Host "Compiling with '$global:configuration' configuration" -ForegroundColor Yellow

&"C:\Windows\Microsoft.NET\Framework\$v4_net_version\MSBuild.exe" "$sln_file" /p:Configuration=$global:configuration /p:nowarn="1591 1573" /p:VisualStudioVersion=12.0 /maxcpucount
&"$msbuild" "$sln_file" /p:Configuration=$global:configuration /p:nowarn="$nowarn" /p:VisualStudioVersion=12.0 /maxcpucount /verbosity:minimal

Write-Host "msbuild exit code: $LastExitCode"

Expand All @@ -83,10 +90,9 @@ task CompileHtml5 {

"{ ""BuildVersion"": $env:buildlabel }" | Out-File "Raven.Studio.Html5\version.json" -Encoding UTF8

$v4_net_version = (ls "$env:windir\Microsoft.NET\Framework\v4.0*").Name

Write-Host "Compiling HTML5" -ForegroundColor Yellow
exec { &"C:\Windows\Microsoft.NET\Framework\$v4_net_version\MSBuild.exe" "Raven.Studio.Html5\Raven.Studio.Html5.csproj" /p:VisualStudioVersion=12.0 /p:Configuration=$global:configuration /p:nowarn="1591 1573" }

&"$msbuild" "Raven.Studio.Html5\Raven.Studio.Html5.csproj" /p:Configuration=$global:configuration /p:nowarn="$nowarn" /p:VisualStudioVersion=12.0 /maxcpucount /verbosity:minimal

Remove-Item $build_dir\Html5 -Force -Recurse -ErrorAction SilentlyContinue | Out-Null
Remove-Item $build_dir\Raven.Studio.Html5.zip -Force -ErrorAction SilentlyContinue | Out-Null
Expand Down Expand Up @@ -443,7 +449,7 @@ task DoReleasePart1 -depends Compile, `
CopyRootFiles, `
CopyRavenTraffic, `
CopyStorageExporter, `
ZipOutput {
ZipOutput {

Write-Host "Done building RavenDB"
}
Expand Down Expand Up @@ -612,7 +618,7 @@ task PushNugetPackages {
$tries = 0
while ($tries -lt 10) {
try {
&"$base_dir\.nuget\NuGet.exe" push "$($_.BaseName).$global:nugetVersion.nupkg" $accessKey -Source $sourceFeed -Timeout 4800
&"$nuget" push "$($_.BaseName).$global:nugetVersion.nupkg" $accessKey -Source $sourceFeed -Timeout 4800
$tries = 100
} catch {
$tries++
Expand Down Expand Up @@ -723,7 +729,7 @@ task CreateNugetPackages -depends Compile, CompileDnx, CompileHtml5, InitNuget {
}
}
$nuspec.Save($_.FullName);
Exec { &"$base_dir\.nuget\nuget.exe" pack $_.FullName }
Exec { &"$nuget" pack $_.FullName }
}
}

Expand Down Expand Up @@ -754,7 +760,7 @@ task PushSymbolSources -depends InitNuget {
$packages | ForEach-Object {
try {
Write-Host "Publish symbol package $($_.BaseName).$global:nugetVersion.symbols.nupkg"
&"$base_dir\.nuget\NuGet.exe" push "$($_.BaseName).$global:nugetVersion.symbols.nupkg" $accessKey -Source http://nuget.gw.symbolsource.org/Public/NuGet -Timeout 4800
&"$nuget" push "$($_.BaseName).$global:nugetVersion.symbols.nupkg" $accessKey -Source http://nuget.gw.symbolsource.org/Public/NuGet -Timeout 4800
} catch {
Write-Host $error[0]
$LastExitCode = 0
Expand Down Expand Up @@ -909,7 +915,7 @@ task CreateSymbolSources -depends CreateNugetPackages {
Remove-Item "$nuget_dir\$dirName\src\bin" -force -recurse -ErrorAction SilentlyContinue
Remove-Item "$nuget_dir\$dirName\src\obj" -force -recurse -ErrorAction SilentlyContinue

Exec { &"$base_dir\.nuget\nuget.exe" pack $_.FullName -Symbols }
Exec { &"$nuget" pack $_.FullName -Symbols }
}
}

Expand Down

0 comments on commit 98b83d0

Please sign in to comment.