mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-27 02:52:02 +03:00
a56b6d1c56
* This allows potentially chaining `cargoTarpaulin` invocations with other derivations
23 lines
565 B
Nix
23 lines
565 B
Nix
{ 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 = "cargo tarpaulin";
|
|
cargoExtraArgs = "${cargoExtraArgs} ${cargoTarpaulinExtraArgs}";
|
|
|
|
doCheck = false;
|
|
pnameSuffix = "-tarpaulin";
|
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cargo-tarpaulin ];
|
|
})
|