use of com.facebook.buck.rules.BuildRuleKeys in project buck by facebook.
the class RuleKeyLoggerListener method onBuildRuleEvent.
@Subscribe
public void onBuildRuleEvent(BuildRuleEvent.Finished event) {
BuildRuleKeys ruleKeys = event.getRuleKeys();
BuildTarget target = event.getBuildRule().getBuildTarget();
String ruleKeyLine = toTsv(target, ruleKeys.getRuleKey());
String inputRuleKeyLine = null;
if (ruleKeys.getInputRuleKey().isPresent()) {
inputRuleKeyLine = toTsv(target, ruleKeys.getInputRuleKey().get());
}
synchronized (lock) {
logLines.add(ruleKeyLine);
if (inputRuleKeyLine != null) {
logLines.add(inputRuleKeyLine);
}
}
flushLogLinesIfNeeded();
}
use of com.facebook.buck.rules.BuildRuleKeys in project buck by facebook.
the class RuleKeyLoggerListenerTest method createBuildEvent.
private BuildRuleEvent.Finished createBuildEvent() {
BuildRule rule = new FakeBuildRule(BuildTarget.builder().setUnflavoredBuildTarget(UnflavoredBuildTarget.of(projectFilesystem.getRootPath(), Optional.empty(), "//topspin", "//downtheline")).build(), null);
BuildRuleKeys keys = BuildRuleKeys.of(new RuleKey("1a1a1a"));
BuildRuleEvent.Started started = TestEventConfigurator.configureTestEvent(BuildRuleEvent.started(rule, durationTracker));
return BuildRuleEvent.finished(started, keys, null, null, null, null, null);
}
Aggregations