You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: provide options to refer to a group of targets (#20522)
I believe the docs would benefit from having `cli` subsystem mentioned
when explaining how to address targets. Also, the generic `target` is
not referred anywhere, but is a powerful technique to provide a proxy to
address multiple targets.
Copy file name to clipboardexpand all lines: docs/docs/using-pants/key-concepts/targets-and-build-files.mdx
+44
Original file line number
Diff line number
Diff line change
@@ -166,6 +166,50 @@ You can use the prefix `!!` to transitively exclude a dependency, meaning that e
166
166
Transitive excludes can only be used in target types that conventionally are not depended upon by other targets, such as `pex_binary`, `python_distribution`, and `python_test` / `python_tests`. This is meant to limit confusion, as using `!!` in something like a `python_source` / `python_sources` target could result in surprising behavior for everything that depends on it. (Pants will print a helpful error when using `!!` when it's not legal.)
167
167
:::
168
168
169
+
## Using the generic `target`
170
+
171
+
[`target`](../../..reference/targets/target) is a generic target with no specific type.
172
+
It can be used as a generic collection of targets to group related, but distinct targets into one single target.
173
+
174
+
### Referring to a group of targets
175
+
176
+
You could use the generic `target` when you need to group multiple targets to refer to them as a unit
As mentioned above in [BUILD files](./targets-and-build-files.mdx#build-files), most target fields have sensible defaults. And it's easy to override those values on a specific target. But applying the same non-default value on many targets can get unwieldy, error-prone and hard to maintain. Enter `__defaults__`.
0 commit comments