nuget packages script for each project under src/

This commit is contained in:
Krzysztof Wicher 2015-11-30 16:51:07 -08:00
parent a5da6dc1ca
commit fcc6471618

View file

@ -0,0 +1,26 @@
Push-Location $PSScriptRoot
[Environment]::CurrentDirectory = $PWD
$ProjectsDir = "..\..\src"
$IntermediatePackagesDir = "..\..\artifacts\packages\intermediate"
$PackagesDir = "..\..\artifacts\packages"
New-Item -ItemType Directory -Force -Path $IntermediatePackagesDir
foreach ($file in [System.IO.Directory]::EnumerateFiles($ProjectsDir, "project.json", "AllDirectories")) {
& dotnet restore "$file"
if (!$?) {
Write-Host "dotnet restore failed for: $file"
Exit 1
}
& dotnet pack "$file" --output "$IntermediatePackagesDir"
if (!$?) {
Write-Host "dotnet pack failed for: $file"
Exit 1
}
}
Get-ChildItem $IntermediatePackagesDir -Filter *.nupkg | Copy-Item -Destination $PackagesDir
Pop-Location
[Environment]::CurrentDirectory = $PWD