Skip to content

Commit

Permalink
Delete unused/not working/not documented help rule name functionality.
Browse files Browse the repository at this point in the history
Transitively this pulls in skydoc which pulls in other large deps, so this is one step closer to a smaller bazel binary, see #6316.

RELNOTES: None
PiperOrigin-RevId: 232215895
  • Loading branch information
meisterT authored and Copybara-Service committed Feb 3, 2019
1 parent 8db50b6 commit 24f5739
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 74 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/com/google/devtools/build/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,6 @@ java_library(
":shared-base-rules",
":unix",
":util",
"//src/main/java/com/google/devtools/build/docgen:docgen_javalib",
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/actions:localhost_capacity",
"//src/main/java/com/google/devtools/build/lib/buildeventstream",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
import com.google.common.collect.Iterables;
import com.google.common.escape.Escaper;
import com.google.common.html.HtmlEscapers;
import com.google.devtools.build.docgen.BlazeRuleHelpPrinter;
import com.google.devtools.build.lib.analysis.BlazeVersionInfo;
import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider;
import com.google.devtools.build.lib.analysis.NoBuildEvent;
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.packages.RuleClass;
import com.google.devtools.build.lib.runtime.BlazeCommand;
import com.google.devtools.build.lib.runtime.BlazeCommandResult;
import com.google.devtools.build.lib.runtime.BlazeCommandUtils;
Expand Down Expand Up @@ -166,18 +164,8 @@ public BlazeCommandResult exec(CommandEnvironment env, OptionsParsingResult opti

BlazeCommand command = runtime.getCommandMap().get(helpSubject);
if (command == null) {
ConfiguredRuleClassProvider provider = runtime.getRuleClassProvider();
RuleClass ruleClass = provider.getRuleClassMap().get(helpSubject);
if (ruleClass != null && ruleClass.isDocumented()) {
// There is a rule with a corresponding name
outErr.printOut(
BlazeRuleHelpPrinter.getRuleDoc(helpSubject, runtime.getProductName(), provider));
return BlazeCommandResult.exitCode(ExitCode.SUCCESS);
} else {
env.getReporter().handle(Event.error(
null, "'" + helpSubject + "' is neither a command nor a build rule"));
env.getReporter().handle(Event.error(null, "'" + helpSubject + "' is not a known command"));
return BlazeCommandResult.exitCode(ExitCode.COMMAND_LINE_ERROR);
}
}
emitBlazeVersionInfo(outErr, productName);
outErr.printOut(
Expand Down

0 comments on commit 24f5739

Please sign in to comment.