2022-04-25 16:58:19 +00:00
|
|
|
declare -a projectFile testProjectFile
|
|
|
|
|
2022-05-21 13:33:02 +00:00
|
|
|
# Inherit arguments from derivation
|
2022-04-25 16:58:19 +00:00
|
|
|
dotnetFlags=( ${dotnetFlags[@]-} )
|
|
|
|
dotnetRestoreFlags=( ${dotnetRestoreFlags[@]-} )
|
2022-01-13 06:39:44 +00:00
|
|
|
|
|
|
|
dotnetConfigureHook() {
|
|
|
|
echo "Executing dotnetConfigureHook"
|
|
|
|
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
if [ -z "${enableParallelBuilding-}" ]; then
|
2022-09-08 22:00:49 +00:00
|
|
|
local -r parallelFlag="--disable-parallel"
|
2022-01-13 06:39:44 +00:00
|
|
|
fi
|
|
|
|
|
2022-09-08 22:14:04 +00:00
|
|
|
dotnetRestore() {
|
|
|
|
local -r project="${1-}"
|
|
|
|
env dotnet restore ${project-} \
|
|
|
|
-p:ContinuousIntegrationBuild=true \
|
|
|
|
-p:Deterministic=true \
|
2022-09-26 17:35:14 +00:00
|
|
|
--runtime "@runtimeId@" \
|
2022-09-08 22:14:04 +00:00
|
|
|
--source "@nugetSource@/lib" \
|
|
|
|
${parallelFlag-} \
|
|
|
|
${dotnetRestoreFlags[@]} \
|
|
|
|
${dotnetFlags[@]}
|
|
|
|
}
|
|
|
|
|
|
|
|
(( "${#projectFile[@]}" == 0 )) && dotnetRestore
|
|
|
|
|
2022-11-25 01:45:05 +00:00
|
|
|
# Generate a NuGet.config file to make sure everything,
|
|
|
|
# including things like <Sdk /> dependencies, is restored from the proper source
|
|
|
|
cat <<EOF > "./NuGet.config"
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<configuration>
|
|
|
|
<packageSources>
|
|
|
|
<clear />
|
|
|
|
<add key="nugetSource" value="@nugetSource@/lib" />
|
|
|
|
</packageSources>
|
|
|
|
</configuration>
|
|
|
|
EOF
|
|
|
|
|
2022-09-08 22:00:49 +00:00
|
|
|
for project in ${projectFile[@]} ${testProjectFile[@]-}; do
|
2022-09-08 22:14:04 +00:00
|
|
|
dotnetRestore "$project"
|
2022-01-13 06:39:44 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
|
|
|
|
echo "Finished dotnetConfigureHook"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [[ -z "${dontDotnetConfigure-}" && -z "${configurePhase-}" ]]; then
|
|
|
|
configurePhase=dotnetConfigureHook
|
|
|
|
fi
|