mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-22 23:17:15 +03:00
Merge pull request #9 from ipetkov/install-by-default
`cargoClippy` and `cargoTarpaulin`: change behavior to install cargo artifacts by default
This commit is contained in:
commit
9ea3e03efe
@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
* `cargoClippy` and `cargoTarpaulin` will install cargo artifacts by default (or
|
||||
install an empty `target` directory if there are none). This allows for more
|
||||
easily chaining derivations if doing so is desired.
|
||||
- This can be disabled by setting `doInstallCargoArtifacts = false;` in the
|
||||
derivation
|
||||
|
||||
## [0.3.0] - 2022-02-11
|
||||
|
||||
### Added
|
||||
|
@ -19,6 +19,15 @@ onlyDrvs (lib.makeScope myLib.newScope (self:
|
||||
src = ./simple;
|
||||
};
|
||||
|
||||
# https://github.com/ipetkov/crane/issues/6
|
||||
cargoClippyThenBuild = myLib.buildPackage {
|
||||
src = ./simple;
|
||||
cargoArtifacts = myLib.cargoClippy {
|
||||
cargoArtifacts = null;
|
||||
src = ./simple;
|
||||
};
|
||||
};
|
||||
|
||||
# https://github.com/ipetkov/crane/issues/6
|
||||
cargoFmtThenClippy = myLib.cargoClippy {
|
||||
src = ./simple;
|
||||
|
@ -255,9 +255,6 @@ Except where noted below, all derivation attributes are delegated to
|
||||
* `cargoExtraArgs`: additional flags to be passed in the cargo invocation (e.g.
|
||||
enabling specific features)
|
||||
- Default value: `""`
|
||||
* `doInstallCargoArtifacts`: controls whether cargo's `target` directory should
|
||||
be copied as an output
|
||||
- Default value: `false`
|
||||
|
||||
#### Native build dependencies
|
||||
The `clippy` package is automatically appended as a native build input to any
|
||||
|
@ -20,9 +20,4 @@ cargoBuild (args // {
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ clippy ];
|
||||
|
||||
doCheck = false; # We don't need to run tests to benefit from `cargo check`
|
||||
|
||||
# The existence of the build completing without error is enough to ensure
|
||||
# the checks have passed, so we do not strictly need to install the cargo artifacts.
|
||||
# However, we allow the caller to retain them if needed.
|
||||
doInstallCargoArtifacts = args.doInstallCargoArtifacts or false;
|
||||
})
|
||||
|
@ -16,7 +16,6 @@ cargoBuild (args // {
|
||||
cargoExtraArgs = "${cargoExtraArgs} ${cargoTarpaulinExtraArgs}";
|
||||
|
||||
doCheck = false;
|
||||
doInstallCargoArtifacts = args.doInstallCargoArtifacts or false;
|
||||
pnameSuffix = "-tarpaulin";
|
||||
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cargo-tarpaulin ];
|
||||
|
Loading…
Reference in New Issue
Block a user