File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -281,17 +281,21 @@ Assorted functions for operating on [Haskell.nix][] data. This is
281
281
distinct from ` pkgs.haskell.lib ` in the current Nixpkgs Haskell
282
282
Infrastructure.
283
283
284
- ### collectComponents
284
+ ### collectComponents and collectComponents'
285
285
286
286
Extracts a selection of components from a Haskell [ package set] ( #package-set ) .
287
287
288
288
This can be used to filter out all test suites or benchmarks of
289
289
your project, so that they can be built in Hydra (see check if you
290
- waht to run the tests as well as build them).
290
+ want to run the tests as well as build them).
291
+
292
+ ` collectComponents' ` is an alias of ` collectComponents ` without
293
+ predicate for filtering.
291
294
292
295
```
293
296
collectComponents =
294
297
group: packageSel: haskellPackages: ...
298
+ collectComponents' = group: collectComponents (_: true)
295
299
```
296
300
297
301
@@ -321,7 +325,7 @@ This function turns a derivation that builds a test into one to run it.
321
325
| ` drv ` | Derivation | One of ` $pkg.components.tests.$test ` . |
322
326
323
327
For convenience ` $pkg.components.tests ` are mapped with this function
324
- to ` $pkg.components. checks ` .
328
+ to ` $pkg.checks ` .
325
329
326
330
This function is intended for use with ` tests ` but it should also work
327
331
for ` exes ` and ` benchmarks ` if you just want to run them to make sure
Original file line number Diff line number Diff line change @@ -143,6 +143,15 @@ with haskellLib;
143
143
( lib . filterAttrs ( name : package : ( package . isHaskell or false ) && packageSel package ) haskellPackages ) )
144
144
// { recurseForDerivations = true ; } ;
145
145
146
+ # Equivalent to collectComponents with (_: true) as selection function.
147
+ # Useful for pre-filtered package-set.
148
+ #
149
+ # For example:
150
+ #
151
+ # myHaskellPackages = selectProjectPackages hsPkgs;
152
+ # myTests = collectComponents' "tests" myHaskellPackages;
153
+ collectComponents' = group : collectComponents group ( _ : true ) ;
154
+
146
155
# Replacement for lib.cleanSourceWith that has a subDir argument.
147
156
inherit ( import ./clean-source-with.nix { inherit lib ; } ) cleanSourceWith canCleanSource ;
148
157
You can’t perform that action at this time.
0 commit comments