msbuild: add script to generate nuget dependencies

This commit is contained in:
David McFarland 2020-12-24 09:37:39 -04:00
parent 8d327040c0
commit a213145db8
2 changed files with 1357 additions and 1129 deletions

View File

@ -0,0 +1,32 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p msbuild
set -euo pipefail
cat << EOL
{ fetchurl }: [
EOL
tmpdir="$(mktemp -d -p "$(pwd)")" # must be under source root
trap 'rm -rf $tmpdir' EXIT
(
ulimit -n 8192 # https://github.com/NuGet/Home/issues/8571
export HOME="$tmpdir"
msbuild -noAutoRsp -t:restore -p:RestoreNoCache=true MSBuild.sln
msbuild -noAutoRsp -t:restore -p:RestoreNoCache=true "$tmpdir"/.nuget/packages/microsoft.dotnet.arcade.sdk/*/tools/Tools.proj
) | \
sed -nr 's/^ *OK *(.*\.nupkg).*$/\1/p' | \
sort -u | \
while read url; do
sha256=$(nix-prefetch-url "$url" 2>/dev/null)
cat << EOL
(fetchurl {
url = "$url";
sha256 = "$sha256";
})
EOL
done
cat << EOL
]
EOL

File diff suppressed because it is too large Load Diff