wifisetup/nix/update-locks.nix
Raito Bezarius a759cc912f chore(nix): nixify
This does almost everything until the final build and fails there
because we are using too modern software with a too old project, I
think.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-05 16:57:52 +02:00

17 lines
614 B
Nix

{ lib
, writeShellScriptBin
, gradle
, jq
, yq-go
}:
writeShellScriptBin "update-locks" ''
set -eu -o pipefail
set -x
${gradle}/bin/gradle dependencies --write-locks
${gradle}/bin/gradle --write-verification-metadata sha256 dependencies
${yq-go}/bin/yq -p=xml -o=json gradle/verification-metadata.xml \
| ${jq}/bin/jq '."verification-metadata".components.component' \
| ${jq}/bin/jq '[ .[] | { group: ."+@group", name: ."+@name", version: ."+@version", artifacts: [([.artifact] | flatten | .[] | {(."+@name"): .sha256."+@value"})] | add } ]' > deps.json
rm gradle/verification-metadata.xml
''