summary refs log tree commit diff
path: root/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh
blob: e0522dc95ce57b08dcbae9438a3f2e938da5765f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
declare -a projectFile testProjectFile dotnetRestoreFlags dotnetFlags

dotnetConfigureHook() {
    echo "Executing dotnetConfigureHook"

    runHook preConfigure

    if [ -z "${enableParallelBuilding-}" ]; then
        parallelFlag="--disable-parallel"
    fi

    export HOME=$(mktemp -d)

    for project in ${projectFile[@]} ${testProjectFile[@]}; do
        env \
            dotnet restore "$project" \
                -p:ContinuousIntegrationBuild=true \
                -p:Deterministic=true \
                -p:RestoreUseStaticGraphEvaluation=true \
                --source "@nugetSource@/lib" \
                ${parallelFlag-} \
                "${dotnetRestoreFlags[@]}" \
                "${dotnetFlags[@]}"
    done

    runHook postConfigure

    echo "Finished dotnetConfigureHook"
}

if [[ -z "${dontDotnetConfigure-}" && -z "${configurePhase-}" ]]; then
    configurePhase=dotnetConfigureHook
fi