Repository navigation
Expand file tree
/
Copy pathbuild.ps1
More file actions
70 lines (55 loc) · 2.11 KB
/
Copy pathbuild.ps1
File metadata and controls
70 lines (55 loc) · 2.11 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
$ErrorActionPreference = "Stop";
New-Item -ItemType Directory -Force -Path ./nuget
Write-Host "Explicit shutdown dotnet build-server to avoid cache issues"
dotnet build-server shutdown
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
function UpdateVersion($targetFile, $version) {
$content = @"
<Project>
<PropertyGroup>
<IdentityServerVersion>$version</IdentityServerVersion>
</PropertyGroup>
</Project>
"@
[System.IO.File]::WriteAllText($targetFile, $content) || throw "Write to $targetFile"
}
UpdateVersion ([System.IO.Path]::GetFullPath('Directory.Build.version.targets')) $version
Push-Location ./src/Storage
$global:LASTEXITCODE = 0
Invoke-Expression "./build.ps1 $args"
$success = $global:LASTEXITCODE
Pop-Location
if($success -ne 0) { exit 1 }
Push-Location ./src/IdentityServer4
$global:LASTEXITCODE = 0
Invoke-Expression "./build.ps1 $args"
$success = $global:LASTEXITCODE
Pop-Location
if($success -ne 0) { exit 1 }
Push-Location ./src/EntityFramework.Storage
$global:LASTEXITCODE = 0
Invoke-Expression "./build.ps1 $args"
$success = $global:LASTEXITCODE
Pop-Location
if($success -ne 0) { exit 1 }
Push-Location ./src/EntityFramework
$global:LASTEXITCODE = 0
Invoke-Expression "./build.ps1 $args"
$success = $global:LASTEXITCODE
Pop-Location
if($success -ne 0) { exit 1 }
Push-Location ./src/AspNetIdentity
$global:LASTEXITCODE = 0
Invoke-Expression "./build.ps1 $args"
$success = $global:LASTEXITCODE
Pop-Location
if($success -ne 0) { exit 1 }