forked from IdentityServer/IdentityServer4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
38 lines (27 loc) · 1.21 KB
/
build.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
$ErrorActionPreference = "Stop";
New-Item -ItemType Directory -Force -Path ./nuget
dotnet tool restore
$version = dotnet minver || throw 'dotnet minver'
$substitution = '${open}' + $version + '${close}'
Write-Host "Update version by expression: $substitution"
function UpdateVersion($targetFile, $substitution) {
$content = [System.IO.File]::ReadAllText($targetFile) -Replace '(?<open><IdentityServerVersion>)[^<]+(?<close></IdentityServerVersion>)', $substitution || throw "Read from $targetFile"
[System.IO.File]::WriteAllText($targetFile, $content) || throw "Write to $targetFile"
}
UpdateVersion ([System.IO.Path]::GetFullPath('src/Shared/Directory.Build.override.targets')) $substitution
UpdateVersion ([System.IO.Path]::GetFullPath('Directory.Build.override.targets')) $substitution
Push-Location ./src/Storage
Invoke-Expression "./build.ps1 $args"
Pop-Location
Push-Location ./src/IdentityServer4
Invoke-Expression "./build.ps1 $args"
Pop-Location
Push-Location ./src/EntityFramework.Storage
Invoke-Expression "./build.ps1 $args"
Pop-Location
Push-Location ./src/EntityFramework
Invoke-Expression "./build.ps1 $args"
Pop-Location
Push-Location ./src/AspNetIdentity
Invoke-Expression "./build.ps1 $args"
Pop-Location