diff options
author | 2018-03-20 10:14:09 -0700 | |
---|---|---|
committer | 2018-03-20 10:15:13 -0700 | |
commit | adb27dc3783509768f8a2ba5f2913185ccd90eec (patch) | |
tree | 0a161362c59cde334875f4e604eddf2a7ac59602 /src/main/java/com/google/devtools/build/lib/packages | |
parent | 4b7f7601730e08a80ce0944ea44370d9dbb111a9 (diff) |
Add more documentation for rule.outputs
We want to simplify/remove this API, but let's document it in the meantime.
Also fix harmless bug that annoyed me. It used rawTemplate instead of formatStr when there are no placeholders. This would theoretically fail to properly escape % symbols, except that the code path luckily short-circuits later on if there are no placeholders.
RELNOTES:
PiperOrigin-RevId: 189760809
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java b/src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java index 5fa3a0cd01..81dfd14e22 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java +++ b/src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java @@ -450,12 +450,10 @@ public abstract class ImplicitOutputsFunction { List<String> placeholders = Lists.<String>newArrayList(); String formatStr = createPlaceholderSubstitutionFormatString(rawTemplate, placeholders); if (placeholders.isEmpty()) { - return new AutoValue_ImplicitOutputsFunction_ParsedTemplate( - rawTemplate, rawTemplate, ImmutableList.of()); + placeholders = ImmutableList.of(); } - return new AutoValue_ImplicitOutputsFunction_ParsedTemplate( - rawTemplate, formatStr, placeholders); + rawTemplate, formatStr, placeholders); } ImmutableList<String> substituteAttributes( |