My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-build-hook.sh

42 lines
1.1 KiB

# 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 \
--configuration "@buildType@" \
--no-restore \
${versionFlag-} \
${dotnetBuildFlags[@]} \
${dotnetFlags[@]}
done
runHook postBuild
echo "Finished dotnetBuildHook"
}
if [[ -z "${dontDotnetBuild-}" && -z "${buildPhase-}" ]]; then
buildPhase=dotnetBuildHook
fi