Skip to content

Commit

Permalink
Add filepath and module target syntax to readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Apr 6, 2020
1 parent ff4d6e5 commit 267b0d6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Cabal/doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ A target can take any of the following forms:
- ``tests``,
- ``benches``, ``benchmarks``.

- A module target: ``[package:][ctype:]module``, which specifies that the
component of which the given module is a part of will be built. If the
target is ambiguous, e.g. only ``module`` is specified and the module name
is part of multiple components, all of these component will be built.

- A filepath target: ``[package:][ctype:]filepath``, which specifies that the
component of which the given filepath is a part of will be built. If the
target is ambiguous, e.g. only ``filepath`` is specified and the filepath
is part of multiple components, all of these component will be built.

In component targets, ``package:`` and ``ctype:`` (valid component types
are ``lib``, ``flib``, ``exe``, ``test`` and ``bench``) can be used to
disambiguate when multiple packages define the same component, or the
Expand All @@ -99,6 +109,12 @@ Some example targets:

$ cabal v2-build lib:foo-pkg # build the library named foo-pkg
$ cabal v2-build foo-pkg:foo-tests # build foo-tests in foo-pkg
$ cabal v2-build src/Lib.s # build the library component to
# which "src/Lib.hs" belongs
$ cabal v2-build app/Main.hs # build the executable component of
# "app/Main.hs"
$ cabal v2-build Lib # build the library component to
# which the module "Lib" belongs

(There is also syntax for specifying module and file targets, but it
doesn't currently do anything.)
Expand Down

0 comments on commit 267b0d6

Please sign in to comment.