Skip to content

Commit 267b0d6

Browse files
committed
Add filepath and module target syntax to readthedocs
1 parent ff4d6e5 commit 267b0d6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Cabal/doc/cabal-commands.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ A target can take any of the following forms:
8686
- ``tests``,
8787
- ``benches``, ``benchmarks``.
8888

89+
- A module target: ``[package:][ctype:]module``, which specifies that the
90+
component of which the given module is a part of will be built. If the
91+
target is ambiguous, e.g. only ``module`` is specified and the module name
92+
is part of multiple components, all of these component will be built.
93+
94+
- A filepath target: ``[package:][ctype:]filepath``, which specifies that the
95+
component of which the given filepath is a part of will be built. If the
96+
target is ambiguous, e.g. only ``filepath`` is specified and the filepath
97+
is part of multiple components, all of these component will be built.
98+
8999
In component targets, ``package:`` and ``ctype:`` (valid component types
90100
are ``lib``, ``flib``, ``exe``, ``test`` and ``bench``) can be used to
91101
disambiguate when multiple packages define the same component, or the
@@ -99,6 +109,12 @@ Some example targets:
99109

100110
$ cabal v2-build lib:foo-pkg # build the library named foo-pkg
101111
$ cabal v2-build foo-pkg:foo-tests # build foo-tests in foo-pkg
112+
$ cabal v2-build src/Lib.s # build the library component to
113+
# which "src/Lib.hs" belongs
114+
$ cabal v2-build app/Main.hs # build the executable component of
115+
# "app/Main.hs"
116+
$ cabal v2-build Lib # build the library component to
117+
# which the module "Lib" belongs
102118

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

0 commit comments

Comments
 (0)