Search in sources :

Example 1 with BuildRuleKeys

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();
}
Also used : BuildTarget(com.facebook.buck.model.BuildTarget) BuildRuleKeys(com.facebook.buck.rules.BuildRuleKeys) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with BuildRuleKeys

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);
}
Also used : RuleKey(com.facebook.buck.rules.RuleKey) FakeBuildRule(com.facebook.buck.rules.FakeBuildRule) FakeBuildRule(com.facebook.buck.rules.FakeBuildRule) BuildRule(com.facebook.buck.rules.BuildRule) BuildRuleKeys(com.facebook.buck.rules.BuildRuleKeys) BuildRuleEvent(com.facebook.buck.rules.BuildRuleEvent)

Aggregations

BuildRuleKeys (com.facebook.buck.rules.BuildRuleKeys)2 BuildTarget (com.facebook.buck.model.BuildTarget)1 BuildRule (com.facebook.buck.rules.BuildRule)1 BuildRuleEvent (com.facebook.buck.rules.BuildRuleEvent)1 FakeBuildRule (com.facebook.buck.rules.FakeBuildRule)1 RuleKey (com.facebook.buck.rules.RuleKey)1 Subscribe (com.google.common.eventbus.Subscribe)1