Skip to content

Commit

Permalink
Improvement for better binary handling in projects
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Apr 5, 2024
1 parent 71d36b0 commit 8c4d9c9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Private/Start-LibraryBuilding.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,26 @@
Write-Text "[-] Can't read $ModuleProjectFile file. Error: $($_.Exception.Message)" -Color Red
return $false
}

if ($IsLinux) {
$OSVersion = 'Linux'
} elseif ($IsMacOS) {
$OSVersion = 'OSX'
} else {
$OSVersion = 'Windows'
}

$SupportedFrameworks = foreach ($PropertyGroup in $ProjectInformation.Project.PropertyGroup) {
if ($PropertyGroup.TargetFrameworks) {
$PropertyGroup.TargetFrameworks -split ";"
if ($PropertyGroup.TargetFrameworks -is [array]) {
foreach ($Target in $PropertyGroup.TargetFrameworks) {
if ($Target.Condition -like "*$OSVersion*" -and $Target.'#text') {
$Target.'#text'.Trim() -split ";"
}
}
} else {
$PropertyGroup.TargetFrameworks -split ";"
}
} elseif ($PropertyGroup.TargetFrameworkVersion) {
throw "TargetFrameworkVersion is not supported. Please use TargetFrameworks/TargetFramework instead which may require different project profile."
} elseIf ($PropertyGroup.TargetFramework) {
Expand Down

0 comments on commit 8c4d9c9

Please sign in to comment.