@@ -86,6 +86,12 @@ 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.
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
+
89
95
In component targets, ``package: `` and ``ctype: `` (valid component types
90
96
are ``lib ``, ``flib ``, ``exe ``, ``test `` and ``bench ``) can be used to
91
97
disambiguate when multiple packages define the same component, or the
@@ -99,6 +105,12 @@ Some example targets:
99
105
100
106
$ cabal v2-build lib:foo-pkg # build the library named foo-pkg
101
107
$ 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
102
114
103
115
(There is also syntax for specifying module and file targets, but it
104
116
doesn't currently do anything.)
0 commit comments