Build output files if the build tag filter contains only tags to exclude.

This is arguably more correct, since output files don't have any tags, therefore you cannot exclude them by specifying tags to exclude.

Fixes #4012.

RELNOTES: None.
PiperOrigin-RevId: 177950851
diff --git a/src/main/java/com/google/devtools/build/lib/packages/TargetUtils.java b/src/main/java/com/google/devtools/build/lib/packages/TargetUtils.java
index 702b9d6..756df75 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/TargetUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/TargetUtils.java
@@ -275,7 +275,7 @@
       }
 
       if (!(input instanceof Rule)) {
-        return false;
+        return requiredTags.isEmpty();
       }
       // Note that test_tags are those originating from the XX_test rule,
       // whereas the requiredTags and excludedTags originate from the command