mirror of
https://codeberg.org/icewind/mill-scale.git
synced 2026-06-04 02:14:08 +02:00
add examples check
This commit is contained in:
parent
4cd19c5267
commit
248e5485c0
1 changed files with 11 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ let
|
||||||
hasDefaultFeatures = cargoToml ? features && cargoToml.features ? default;
|
hasDefaultFeatures = cargoToml ? features && cargoToml.features ? default;
|
||||||
msrv = assert assertMsg hasMsrv ''"rust-version" not set in Cargo.toml''; tomlPackage.rust-version;
|
msrv = assert assertMsg hasMsrv ''"rust-version" not set in Cargo.toml''; tomlPackage.rust-version;
|
||||||
maybeWorkspace = optionalString hasWorkspace "--workspace";
|
maybeWorkspace = optionalString hasWorkspace "--workspace";
|
||||||
|
hasExamples = pathExists (src + /examples);
|
||||||
|
|
||||||
cargoLockDeps =
|
cargoLockDeps =
|
||||||
if pathExists (src + /Cargo.lock) then
|
if pathExists (src + /Cargo.lock) then
|
||||||
|
|
@ -266,6 +267,16 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
cargoClippyExtraArgs = "--all-targets ${maybeWorkspace} --no-default-features -- --deny warnings";
|
cargoClippyExtraArgs = "--all-targets ${maybeWorkspace} --no-default-features -- --deny warnings";
|
||||||
inherit ((buildDeps pkgs)) buildInputs nativeBuildInputs;
|
inherit ((buildDeps pkgs)) buildInputs nativeBuildInputs;
|
||||||
};
|
};
|
||||||
|
}) // (optionalAttrs hasExamples {
|
||||||
|
examples = craneLibMsrv.buildPackage {
|
||||||
|
src = filteredSrc;
|
||||||
|
pname = "${crateName}-examples";
|
||||||
|
cargoArtifacts = if hasFeatures then cargoArtifactsAllFeatures else cargoArtifacts;
|
||||||
|
strictDeps = true;
|
||||||
|
doCheck = false;
|
||||||
|
cargoExtraArgs = "--examples ${optionalString hasFeatures "--all-features"} ${maybeWorkspace}";
|
||||||
|
inherit ((buildDeps pkgs)) buildInputs nativeBuildInputs;
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
apps = { cargo-miri, cargo-semver-checks, ... }: {
|
apps = { cargo-miri, cargo-semver-checks, ... }: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue