buildDotnetModule: add dontPublish flag (#464749)

This commit is contained in:
David McFarland
2025-11-25 16:11:24 +00:00
committed by GitHub
2 changed files with 10 additions and 7 deletions
@@ -38,6 +38,7 @@ let
# Unfortunately, dotnet has no method for doing this automatically.
# If unset, all executables in the projects root will get installed. This may cause bloat!
executables ? null,
dontPublish ? false,
# Packs a project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`.
packNupkg ? false,
# The packages project file, which contains instructions on how to compile it. This can be an array of multiple project files as well.
@@ -420,13 +420,15 @@ dotnetInstallPhase() {
done
}
if (( ${#projectFiles[@]} == 0 )); then
dotnetPublish
else
local projectFile
for projectFile in "${projectFiles[@]}"; do
dotnetPublish "$projectFile"
done
if [[ -z "${dontPublish-}" ]]; then
if (( ${#projectFiles[@]} == 0 )); then
dotnetPublish
else
local projectFile
for projectFile in "${projectFiles[@]}"; do
dotnetPublish "$projectFile"
done
fi
fi
if [[ -n ${packNupkg-} ]]; then