mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-15 09:23:37 +00:00
98db245db7
On macOS, the native executable is not generated by default on Catalina and above. See https://github.com/dotnet/sdk/issues/10780
44 lines
1.1 KiB
Bash
44 lines
1.1 KiB
Bash
# inherit arguments from derivation
|
|
dotnetBuildFlags=( ${dotnetBuildFlags[@]-} )
|
|
|
|
dotnetBuildHook() {
|
|
echo "Executing dotnetBuildHook"
|
|
|
|
runHook preBuild
|
|
|
|
if [ "${enableParallelBuilding-}" ]; then
|
|
maxCpuFlag="$NIX_BUILD_CORES"
|
|
parallelBuildFlag="true"
|
|
else
|
|
maxCpuFlag="1"
|
|
parallelBuildFlag="false"
|
|
fi
|
|
|
|
if [ "${version-}" ]; then
|
|
versionFlag="-p:Version=${version-}"
|
|
fi
|
|
|
|
for project in ${projectFile[@]} ${testProjectFile[@]}; do
|
|
env \
|
|
dotnet build "$project" \
|
|
-maxcpucount:$maxCpuFlag \
|
|
-p:BuildInParallel=$parallelBuildFlag \
|
|
-p:ContinuousIntegrationBuild=true \
|
|
-p:Deterministic=true \
|
|
-p:UseAppHost=true \
|
|
--configuration "@buildType@" \
|
|
--no-restore \
|
|
${versionFlag-} \
|
|
${dotnetBuildFlags[@]} \
|
|
${dotnetFlags[@]}
|
|
done
|
|
|
|
runHook postBuild
|
|
|
|
echo "Finished dotnetBuildHook"
|
|
}
|
|
|
|
if [[ -z "${dontDotnetBuild-}" && -z "${buildPhase-}" ]]; then
|
|
buildPhase=dotnetBuildHook
|
|
fi
|