-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.ps1
49 lines (42 loc) · 1.19 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
39
40
41
42
43
44
45
46
47
48
49
param(
[ValidateSet('Debug', 'Release')]
[string] $Configuration = 'Debug'
)
$target = Join-Path $PSScriptRoot 'bin'
if (Test-Path $target) {
Remove-Item $target -Recurse -Force
}
$null = New-Item -ItemType Directory $target
try {
$higherDeps = Join-Path $PSScriptRoot 'src' 'HigherDependencyConflict'
Push-Location $higherDeps
dotnet publish -c $Configuration
if ($LASTEXITCODE -eq 0) {
$source = Join-Path $higherDeps 'bin' 'HigherConflict'
Copy-Item $source -Recurse $target
} else {
return
}
} finally {
Pop-Location
}
try {
$lowerDeps = Join-Path $PSScriptRoot 'src' 'LowerDependencyConflict'
Push-Location -Path $lowerDeps
dotnet publish -c $Configuration
if ($LASTEXITCODE -eq 0) {
$source = Join-Path $lowerDeps 'bin' 'LowerConflict'
Copy-Item $source -Recurse $target
} else {
return
}
} finally {
Pop-Location
}
$sampleModule = Join-Path $PSScriptRoot 'src' 'SampleModule'
& "$sampleModule/build.ps1"
if ($?) {
$source = Join-Path $sampleModule 'bin' 'SampleModule'
Copy-Item $source -Recurse $target
}
Write-Host "`nAll modules are published to '$target'" -ForegroundColor Green