diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands/target-syntax.txt')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/commands/target-syntax.txt | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/target-syntax.txt b/src/main/java/com/google/devtools/build/lib/runtime/commands/target-syntax.txt new file mode 100644 index 0000000000..1fac4981db --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/target-syntax.txt @@ -0,0 +1,64 @@ + +Target pattern syntax +===================== + +The BUILD file label syntax is used to specify a single target. Target +patterns generalize this syntax to sets of targets, and also support +working-directory-relative forms, recursion, subtraction and filtering. +Examples: + +Specifying a single target: + + //foo/bar:wiz The single target '//foo/bar:wiz'. + foo/bar/wiz Equivalent to the first existing one of these: + //foo/bar:wiz + //foo:bar/wiz + //foo/bar Equivalent to '//foo/bar:bar'. + +Specifying all rules in a package: + + //foo/bar:all Matches all rules in package 'foo/bar'. + +Specifying all rules recursively beneath a package: + + //foo/...:all Matches all rules in all packages beneath directory 'foo'. + //foo/... (ditto) + +Working-directory relative forms: (assume cwd = 'workspace/foo') + + Target patterns which do not begin with '//' are taken relative to + the working directory. Patterns which begin with '//' are always + absolute. + + ...:all Equivalent to '//foo/...:all'. + ... (ditto) + + bar/...:all Equivalent to '//foo/bar/...:all'. + bar/... (ditto) + + bar:wiz Equivalent to '//foo/bar:wiz'. + :foo Equivalent to '//foo:foo'. + + bar:all Equivalent to '//foo/bar:all'. + :all Equivalent to '//foo:all'. + +Summary of target wildcards: + + :all, Match all rules in the specified packages. + :*, :all-targets Match all targets (rules and files) in the specified + packages, including .par and _deploy.jar files. + +Subtractive patterns: + + Target patterns may be preceded by '-', meaning they should be + subtracted from the set of targets accumulated by preceding + patterns. For example: + + % blaze build -- foo/... -foo/contrib/... + + builds everything in 'foo', except 'contrib'. In case a target not + under 'contrib' depends on something under 'contrib' though, in order to + build the former blaze has to build the latter too. As usual, the '--' is + required to prevent '-b' from being interpreted as an option. + +%{options} |