-
Notifications
You must be signed in to change notification settings - Fork 1
/
packs.ps1
32 lines (24 loc) · 844 Bytes
/
packs.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Paths
$packFolder = (Get-Item -Path "./" -Verbose).FullName
$slnPath = Join-Path $packFolder "../"
$srcPath = Join-Path $slnPath "src"
# List of projects
$projects = (
"Dapper.TableValuedParameter"
)
# Rebuild solution
Set-Location $slnPath
& dotnet restore
# Copy all nuget packages to the pack folder
foreach($project in $projects) {
$projectFolder = Join-Path $srcPath $project
# Create nuget pack
Set-Location $projectFolder
# Remove-Item -Recurse (Join-Path $projectFolder "bin/Release")
& dotnet msbuild /t:pack /p:Configuration=Release /p:IncludeSymbols=true /p:SourceLinkCreate=true
# Copy nuget package
$projectPackPath = Join-Path $projectFolder ("/bin/Release/" + $project + ".*.nupkg")
Move-Item $projectPackPath $packFolder
}
# Go back to the pack folder
Set-Location $packFolder