-
Notifications
You must be signed in to change notification settings - Fork 93
/
pack-all.ps1
50 lines (39 loc) · 2.34 KB
/
pack-all.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$root = Get-Location
$build_dir = "$root\build"
$assembly_version = "9.0.5"
$version = "9.0.5"
$is_pre_release = $true
$pre_release_counter = 9
function CleanAndBuild {
Remove-Item -Force -Recurse $build_dir -ErrorAction SilentlyContinue | Out-Null
if (-not (Test-Path $build_dir)) {
New-Item -ItemType Directory -Path $build_dir | Out-Null
}
& dotnet clean $root\Raygun.CrashReporting.sln -c Release
& dotnet build $root\Raygun.CrashReporting.sln -c Release -p:FileVersion=$version -p:Version=$version -p:assembly_version=$assembly_version
}
function PackAll {
$package_version = $version
if ($is_pre_release) {
$package_version = "$version-pre-$pre_release_counter"
}
# Pack .NET SDK Projects
PackProject -project_path "$root\Mindscape.Raygun4Net.AspNetCore\Mindscape.Raygun4Net.AspNetCore.csproj" -package_version $package_version
PackProject -project_path "$root\Mindscape.Raygun4Net.NetCore\Mindscape.Raygun4Net.NetCore.csproj" -package_version $package_version
PackProject -project_path "$root\Mindscape.Raygun4Net.NetCore.Common\Mindscape.Raygun4Net.NetCore.Common.csproj" -package_version $package_version
PackProject -project_path "$root\Mindscape.Raygun4Net.Core\Mindscape.Raygun4Net.Core.csproj" -package_version $package_version
PackProject -project_path "$root\Mindscape.Raygun4Net.Mvc\Mindscape.Raygun4Net.Mvc.csproj" -package_version $package_version
PackProject -project_path "$root\Mindscape.Raygun4Net.WebApi\Mindscape.Raygun4Net.WebApi.csproj" -package_version $package_version
PackProject -project_path "$root\Mindscape.Raygun4Net4\Mindscape.Raygun4Net4.csproj" -package_version $package_version
PackProject -project_path "$root\Mindscape.Raygun4Net.Azure.WebJob\Mindscape.Raygun4Net.Azure.WebJob.csproj" -package_version $package_version
# count the number of packages produced and write out
$packageCount = (Get-ChildItem -Path $build_dir -Filter *.nupkg).Count
Write-Output "Created $packageCount packages"
Write-Output "Version: $package_version"
}
function PackProject([string]$project_path, [string]$package_version) {
Write-Output "Packing $project_path"
& dotnet pack $project_path -c Release -o $build_dir -p:PackageVersion=$package_version -p:FileVersion=$version -p:Version=$version -p:assembly_version=$assembly_version
}
& CleanAndBuild
& PackAll