-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild-linux.ps1
More file actions
56 lines (46 loc) · 1.48 KB
/
Copy pathbuild-linux.ps1
File metadata and controls
56 lines (46 loc) · 1.48 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
Param( $buildconf="Release" )
$framework = "net8.0"
function ReplaceTargetPlatform
{
Param( [string]$csprojFileName, [string]$newPlatform )
(Get-Content -path $csprojFileName) | % {
$_ -Replace '<TargetFramework>[^\<]*</TargetFramework>', "<TargetFramework>$newPlatform</TargetFramework>"
} |
Out-File -encoding utf8 $csprojFileName
}
function ReplaceOutputType
{
Param( [string]$csprojFileName, [string]$newPlatform )
(Get-Content -path $csprojFileName) | % {
$_ -Replace '<OutputType>[^\<]*</OutputType>', "<OutputType>$newPlatform</OutputType>"
} |
Out-File -encoding utf8 $csprojFileName
}
$projects = @(
"src\Dirigent.Common\Dirigent.Common.csproj"
"src\Dirigent.Agent.Core\Dirigent.Agent.Core.csproj"
"src\Dirigent.Agent.Console\Dirigent.Agent.Console.csproj"
"src\Dirigent.Gui.ImGui\Dirigent.Gui.ImGui.csproj"
"src\Dirigent.CLI.Core\Dirigent.CLI.Core.csproj"
"src\Dirigent.CLI\Dirigent.CLI.csproj"
)
Foreach ($proj in $projects)
{
"Retargetting $proj => $framework"
ReplaceTargetPlatform $proj $framework
}
# switch to classic console app (linux build does not support WinExe output)
ReplaceOutputType "src\Dirigent.Gui.ImGui\Dirigent.Gui.ImGui.csproj" "Exe"
if( $clean )
{
Foreach ($proj in $projects)
{
"Cleaning $proj"
dotnet clean --nologo -c $buildconf -f $framework -v m $proj
}
}
Foreach ($proj in $projects)
{
"Building $proj"
dotnet build --nologo -c $buildconf -f $framework $proj
}