buildDotnetModule: allow selfContainedBuild property to be omitted with null

Fixes #351892
This commit is contained in:
David McFarland 2024-10-28 22:00:57 -03:00
parent bcd669f23f
commit 5b462ef57a
3 changed files with 21 additions and 15 deletions

View File

@ -27,10 +27,12 @@ dotnetBuildHook() {
local -r parallelBuildFlag="false"
fi
if [[ -n ${dotnetSelfContainedBuild-} ]]; then
dotnetBuildFlagsArray+=("-p:SelfContained=true")
else
dotnetBuildFlagsArray+=("-p:SelfContained=false")
if [[ -v dotnetSelfContainedBuild ]]; then
if [[ -n $dotnetSelfContainedBuild ]]; then
dotnetBuildFlagsArray+=("-p:SelfContained=true")
else
dotnetBuildFlagsArray+=("-p:SelfContained=false")
fi
fi
if [[ -n ${dotnetUseAppHost-} ]]; then

View File

@ -24,10 +24,12 @@ dotnetConfigureHook() {
local -r parallelFlag="--disable-parallel"
fi
if [[ -n ${dotnetSelfContainedBuild-} ]]; then
dotnetRestoreFlagsArray+=("-p:SelfContained=true")
else
dotnetRestoreFlagsArray+=("-p:SelfContained=false")
if [[ -v dotnetSelfContainedBuild ]]; then
if [[ -n $dotnetSelfContainedBuild ]]; then
dotnetRestoreFlagsArray+=("-p:SelfContained=true")
else
dotnetRestoreFlagsArray+=("-p:SelfContained=false")
fi
fi
dotnetRestore() {

View File

@ -20,13 +20,15 @@ dotnetInstallHook() {
local dotnetRuntimeIdsArray=($dotnetRuntimeIds)
fi
if [[ -n ${dotnetSelfContainedBuild-} ]]; then
dotnetInstallFlagsArray+=("--self-contained")
else
dotnetInstallFlagsArray+=("--no-self-contained")
# https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained
# Trimming is only available for self-contained build, so force disable it here
dotnetInstallFlagsArray+=("-p:PublishTrimmed=false")
if [[ -v dotnetSelfContainedBuild ]]; then
if [[ -n $dotnetSelfContainedBuild ]]; then
dotnetInstallFlagsArray+=("--self-contained")
else
dotnetInstallFlagsArray+=("--no-self-contained")
# https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained
# Trimming is only available for self-contained build, so force disable it here
dotnetInstallFlagsArray+=("-p:PublishTrimmed=false")
fi
fi
if [[ -n ${dotnetUseAppHost-} ]]; then