buildDotnetModule: properly inherit arguments from drv

Previously buildDotnetModule did not properly inherit some arguments from
derivations, take for example this expression:

dotnetFlags = [
    "--runtime linux-x64"
];

It would error out as follows: "MSBUILD : error MSB1001: Unknown switch.".
Setting the same flag from bash would work fine. This fixes that, all
arguments should now be properly interpreted :)
This commit is contained in:
= 2022-04-25 18:58:19 +02:00 committed by Jonathan Ringer
parent f69de108fb
commit f0af1ef49c
5 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,5 @@
declare -a projectFile testProjectFile dotnetBuildFlags dotnetFlags
# inherit arguments from derivation
dotnetBuildFlags=( ${dotnetBuildFlags[@]-} )
dotnetBuildHook() {
echo "Executing dotnetBuildHook"

View File

@ -1,4 +1,5 @@
declare -a testProjectFile dotnetTestFlags dotnetFlags
# inherit arguments from derivation
dotnetTestFlags=( ${dotnetTestFlags[@]-} )
dotnetCheckHook() {
echo "Executing dotnetCheckHook"

View File

@ -1,4 +1,8 @@
declare -a projectFile testProjectFile dotnetRestoreFlags dotnetFlags
declare -a projectFile testProjectFile
# inherit arguments from derivation
dotnetFlags=( ${dotnetFlags[@]-} )
dotnetRestoreFlags=( ${dotnetRestoreFlags[@]-} )
dotnetConfigureHook() {
echo "Executing dotnetConfigureHook"

View File

@ -1,4 +1,5 @@
declare -a makeWrapperArgs gappsWrapperArgs
# Inherit arguments from the derivation
makeWrapperArgs=( ${makeWrapperArgs-} )
# First argument is the executable you want to wrap,
# the second is the destination for the wrapper.
@ -15,9 +16,9 @@ wrapDotnetProgram() {
dotnetFixupHook() {
echo "Executing dotnetFixupPhase"
if [ "${executables-}" ]; then
if [ "${executables}" ]; then
for executable in ${executables[@]}; do
execPath="$out/lib/${pname-}/$executable"
execPath="$out/lib/${pname}/$executable"
if [[ -f "$execPath" && -x "$execPath" ]]; then
wrapDotnetProgram "$execPath" "$out/bin/$(basename "$executable")"
@ -27,7 +28,7 @@ dotnetFixupHook() {
fi
done
else
for executable in $out/lib/${pname-}/*; do
for executable in $out/lib/${pname}/*; do
if [[ -f "$executable" && -x "$executable" && "$executable" != *"dll"* ]]; then
wrapDotnetProgram "$executable" "$out/bin/$(basename "$executable")"
fi

View File

@ -1,4 +1,5 @@
declare -a projectFile dotnetInstallFlags dotnetFlags
# inherit arguments from derivation
dotnetInstallFlags=( ${dotnetInstallFlags[@]-} )
dotnetInstallHook() {
echo "Executing dotnetInstallHook"