crane/lib/cargoTarpaulin.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
576 B
Nix
Raw Normal View History

2022-01-17 05:16:21 +03:00
{ buildDepsOnly
, cargoBuild
, cargo-tarpaulin
}:
{ cargoExtraArgs ? ""
, cargoTarpaulinExtraArgs ? "--skip-clean --out Xml --output-dir $out"
, ...
}@origArgs:
let
args = builtins.removeAttrs origArgs [ "cargoTarpaulinExtraArgs" ];
in
cargoBuild (args // {
cargoArtifacts = args.cargoArtifacts or (buildDepsOnly args);
cargoBuildCommand = "cargoWithProfile tarpaulin";
2022-01-17 05:16:21 +03:00
cargoExtraArgs = "${cargoExtraArgs} ${cargoTarpaulinExtraArgs}";
doCheck = false;
pnameSuffix = "-tarpaulin";
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cargo-tarpaulin ];
})