@@ -86,6 +86,16 @@ A target can take any of the following forms:
86
86
- ``tests ``,
87
87
- ``benches ``, ``benchmarks ``.
88
88
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
+
89
99
In component targets, ``package: `` and ``ctype: `` (valid component types
90
100
are ``lib ``, ``flib ``, ``exe ``, ``test `` and ``bench ``) can be used to
91
101
disambiguate when multiple packages define the same component, or the
@@ -99,6 +109,12 @@ Some example targets:
99
109
100
110
$ cabal v2-build lib:foo-pkg # build the library named foo-pkg
101
111
$ 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
102
118
103
119
(There is also syntax for specifying module and file targets, but it
104
120
doesn't currently do anything.)
0 commit comments