diff options
author | mdarocha <git@mdarocha.pl> | 2022-11-25 02:45:05 +0100 |
---|---|---|
committer | mdarocha <git@mdarocha.pl> | 2022-11-25 18:50:44 +0100 |
commit | 8e7296e984b6a4627ff04c4337a28933a442d95a (patch) | |
tree | 3a383461f08c3f67f952902a5393cac28af16c73 /pkgs/build-support/dotnet | |
parent | dcaa4a9982eede1b0e8f9e5bc515c8e21c492f42 (diff) |
buildDotnetModule: generate a NuGet.config with source
Some references, like <Sdk />, ignore the --source argument. To fix that, we generate a simple NuGet.config containing only the given nuget source.
Diffstat (limited to 'pkgs/build-support/dotnet')
-rw-r--r-- | pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh index 10067cf088244..3479f58bb38c5 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh +++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh @@ -26,6 +26,18 @@ dotnetConfigureHook() { (( "${#projectFile[@]}" == 0 )) && dotnetRestore + # 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 + for project in ${projectFile[@]} ${testProjectFile[@]-}; do dotnetRestore "$project" done |