Skip to content

Commit 3fe7219

Browse files
committed
Add filepath and module target syntax to readthedocs
1 parent ff4d6e5 commit 3fe7219

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Cabal/doc/cabal-commands.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ 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.
91+
92+
- A filepath target: ``[package:][ctype:]filepath``, which specifies that the
93+
component of which the given filepath is a part of will be built.
94+
8995
In component targets, ``package:`` and ``ctype:`` (valid component types
9096
are ``lib``, ``flib``, ``exe``, ``test`` and ``bench``) can be used to
9197
disambiguate when multiple packages define the same component, or the
@@ -99,6 +105,12 @@ Some example targets:
99105

100106
$ cabal v2-build lib:foo-pkg # build the library named foo-pkg
101107
$ cabal v2-build foo-pkg:foo-tests # build foo-tests in foo-pkg
108+
$ cabal v2-build src/Lib.s # build the library component to
109+
# which "src/Lib.hs" belongs
110+
$ cabal v2-build app/Main.hs # build the executable component of
111+
# "app/Main.hs"
112+
$ cabal v2-build Lib # build the library component to
113+
# which the module "Lib" belongs
102114

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

0 commit comments

Comments
 (0)