From 2b4c9767c31d3f2547b4a1aa5a09e7df384d9a09 Mon Sep 17 00:00:00 2001 From: Alan Velasco Date: Thu, 7 Jun 2018 15:47:40 -0700 Subject: [PATCH 1/2] Add the --owner-of= usage on Target Address documentation --- src/docs/target_addresses.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/docs/target_addresses.md b/src/docs/target_addresses.md index ccbeb2980bc..0b1ad9a089f 100644 --- a/src/docs/target_addresses.md +++ b/src/docs/target_addresses.md @@ -37,6 +37,16 @@ The following target addresses all specify the same single target. It's idiomatic to omit the repetition of the target name in this case. +- If the address of the target that owns a certain file is not known, the `--owner-of=` global + option can be passed to run the goal on the target which own that file. + + ::::bash + $ ./pants --owner-of=examples/src/java/org/pantsbuild/example/hello/main/HelloMain.java list + examples/src/java/org/pantsbuild/example/hello/main:main + + It's also worth noting that `owner-of=` can also receive a list of files and it will execute + the goal on all the targets that own those files. + - Relative paths and trailing forward slashes are ignored on the command-line to accommodate tab completion: From b1d385f7e1e8278ae5b518b322427a7736c0798a Mon Sep 17 00:00:00 2001 From: Alan Velasco Date: Fri, 8 Jun 2018 14:51:24 -0700 Subject: [PATCH 2/2] Encourage multiple passes instead of list of files --- src/docs/target_addresses.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs/target_addresses.md b/src/docs/target_addresses.md index 0b1ad9a089f..9a54c7e8fa4 100644 --- a/src/docs/target_addresses.md +++ b/src/docs/target_addresses.md @@ -44,8 +44,8 @@ The following target addresses all specify the same single target. $ ./pants --owner-of=examples/src/java/org/pantsbuild/example/hello/main/HelloMain.java list examples/src/java/org/pantsbuild/example/hello/main:main - It's also worth noting that `owner-of=` can also receive a list of files and it will execute - the goal on all the targets that own those files. + It's also worth noting that multiple passes of `owner-of=` are accepted in order to work with multiple + files and pants will execute the goal on all the targets that own those files. - Relative paths and trailing forward slashes are ignored on the command-line to accommodate tab completion: