msbuild: add script to generate nuget dependencies
This commit is contained in:
parent
8d327040c0
commit
a213145db8
32
pkgs/development/tools/build-managers/msbuild/create-deps.sh
Executable file
32
pkgs/development/tools/build-managers/msbuild/create-deps.sh
Executable 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
Loading…
x
Reference in New Issue
Block a user