forked from abpframework/abp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.ps1
33 lines (25 loc) · 923 Bytes
/
pack.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
33
. ".\common.ps1"
# Rebuild all solutions
foreach($solution in $solutions) {
$solutionFolder = Join-Path $rootFolder $solution
Set-Location $solutionFolder
& dotnet restore
}
# Create all packages
foreach($project in $projects) {
$projectFolder = Join-Path $rootFolder $project
# Create nuget pack
Set-Location $projectFolder
Remove-Item -Recurse (Join-Path $projectFolder "bin/Release")
& dotnet msbuild /t:pack /p:Configuration=Release /p:SourceLinkCreate=true
if (-Not $?) {
Write-Host ("Packaging failed for the project: " + $projectFolder)
exit $LASTEXITCODE
}
# Copy nuget package
$projectName = $project.Substring($project.LastIndexOf("/") + 1)
$projectPackPath = Join-Path $projectFolder ("/bin/Release/" + $projectName + ".*.nupkg")
Move-Item $projectPackPath $packFolder
}
# Go back to the pack folder
Set-Location $packFolder