about summary refs log tree commit diff
path: root/mkdeps
blob: 96930a610923de709c357d9aba5ba437ab2e7a84 (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
34
35
36
#!/usr/bin/env nix-shell
#!nix-shell -i "bash -x" -p bash nuget-to-nix git dotnet-sdk_8 nix curl jq yq
projects=(
    MatrixMediaGate
)

find . | grep -E '(bin|obj)$' | while read -r d; do rm -rf "$d" & done
wait

execDir=$(pwd)

for p in $projects
do
  (
    set -euo pipefail
    cd "$p" || exit
    pwd
    MSBUILDLIVELOGGER=false dotnet restore --packages=packages -v n --ucr || exit 1

    #for blazor: https://globalcdn.nuget.org/packages/microsoft.netcore.app.runtime.mono.browser-wasm.7.0.10.nupkg
#    if [ -f wwwroot/index.html ]; then
#      curl -L https://globalcdn.nuget.org/packages/microsoft.netcore.app.runtime.mono.browser-wasm.7.0.10.nupkg -o Microsoft.NETCore.App.Runtime.Mono.browser-wasm.7.0.10.nupkg
#      mkdir -p packages/Microsoft.NETCore.App.Runtime.Mono.browser-wasm/7.0.10
#      unzip -d packages/Microsoft.NETCore.App.Runtime.Mono.browser-wasm/7.0.10 Microsoft.NETCore.App.Runtime.Mono.browser-wasm.7.0.10.nupkg
#      rm Microsoft.NETCore.App.Runtime.Mono.browser-wasm.7.0.10.nupkg
#    fi

    "${execDir}"/nuget-to-nix.sh packages | tee deps.nix
    pwd
    du -sh packages
    rm -rf packages
    git add deps.nix
  )
  nix flake update
  git add flake.lock
done