-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildProject.ps1
More file actions
37 lines (31 loc) · 1.21 KB
/
BuildProject.ps1
File metadata and controls
37 lines (31 loc) · 1.21 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
param (
[string]$Project,
[string]$Head,
[string]$Configuration
)
# Calculate the fully qualified project name
if ($Project -eq "Riverside.Extensions.WinUI") {
$FullyQualifiedName = "Riverside.Extensions.$Head"
} else {
$FullyQualifiedName = "$($Project -replace '\.Toolkit\.', ".Toolkit.$Head.")"
}
# Define the project directory
$ScriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
$ProjectRoot = Join-Path -Path $ScriptDirectory -ChildPath "..\.."
$ProjectDirectory = Join-Path -Path $ProjectRoot -ChildPath "src\platforms\$FullyQualifiedName"
# Check if the project directory exists
if (-Not (Test-Path -Path $ProjectDirectory)) {
# Check in src\extensions if not found in src\platforms
$ProjectDirectory = Join-Path -Path $ProjectRoot -ChildPath "src\extensions\$Project"
if (-Not (Test-Path -Path $ProjectDirectory)) {
Write-Output "Project directory '$ProjectDirectory' does not exist, skipping build."
exit 0
}
}
# Navigate to the project directory
Set-Location -Path $ProjectDirectory
# Run MSBuild
msbuild /t:Restore /p:Configuration=$Configuration
msbuild /t:Build /p:Configuration=$Configuration /p:Platform=x64
# Return to the original location
Pop-Location