nuget packages script for each project under src/
This commit is contained in:
parent
a5da6dc1ca
commit
fcc6471618
1 changed files with 26 additions and 0 deletions
26
packaging/nuget/package.ps1
Normal file
26
packaging/nuget/package.ps1
Normal 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
|
Loading…
Reference in a new issue