Search in sources :

Example 1 with Subscribe

use of com.google.common.eventbus.Subscribe in project buck by facebook.

the class SuperConsoleEventBusListener method testRunFinished.

@Subscribe
public void testRunFinished(TestRunEvent.Finished finished) {
    boolean set = testRunFinished.compareAndSet(null, finished);
    Preconditions.checkState(set, "Test run should not finish after test run already finished");
    ImmutableList.Builder<String> builder = ImmutableList.builder();
    for (TestResults results : finished.getResults()) {
        testFormatter.reportResult(builder, results);
    }
    ImmutableList<TestStatusMessage> testStatusMessages;
    synchronized (testStatusMessageBuilder) {
        testStatusMessages = testStatusMessageBuilder.build();
    }
    testFormatter.runComplete(builder, finished.getResults(), testStatusMessages);
    String testOutput;
    synchronized (testReportBuilder) {
        testReportBuilder.addAll(builder.build());
        testOutput = Joiner.on('\n').join(testReportBuilder.build());
    }
    // We're about to write to stdout, so make sure we render the final frame before we do.
    render();
    synchronized (console.getStdOut()) {
        console.getStdOut().println(testOutput);
    }
}
Also used : TestStatusMessage(com.facebook.buck.test.TestStatusMessage) ImmutableList(com.google.common.collect.ImmutableList) TestResults(com.facebook.buck.test.TestResults) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with Subscribe

use of com.google.common.eventbus.Subscribe in project buck by facebook.

the class JavaUtilsLoggingBuildListener method buildStarted.

@Subscribe
public void buildStarted(BuildEvent.Started started) {
    LogRecord record = new LogRecord(LEVEL, "Build started");
    record.setMillis(started.getTimestamp());
    LOG.log(record);
}
Also used : LogRecord(java.util.logging.LogRecord) Subscribe(com.google.common.eventbus.Subscribe)

Example 3 with Subscribe

use of com.google.common.eventbus.Subscribe in project buck by facebook.

the class JavaUtilsLoggingBuildListener method ruleStarted.

@Subscribe
public void ruleStarted(BuildRuleEvent.Started started) {
    LogRecord record = new LogRecord(LEVEL, started.toString());
    record.setMillis(started.getTimestamp());
    LOG.log(record);
}
Also used : LogRecord(java.util.logging.LogRecord) Subscribe(com.google.common.eventbus.Subscribe)

Example 4 with Subscribe

use of com.google.common.eventbus.Subscribe in project buck by facebook.

the class JavaUtilsLoggingBuildListener method ruleFinished.

@Subscribe
public void ruleFinished(BuildRuleEvent.Finished finished) {
    LogRecord record = new LogRecord(LEVEL, finished.toLogMessage());
    record.setMillis(finished.getTimestamp());
    LOG.log(record);
}
Also used : LogRecord(java.util.logging.LogRecord) Subscribe(com.google.common.eventbus.Subscribe)

Example 5 with Subscribe

use of com.google.common.eventbus.Subscribe in project buck by facebook.

the class JavaUtilsLoggingBuildListener method ruleSuspended.

@Subscribe
public void ruleSuspended(BuildRuleEvent.Suspended suspended) {
    LogRecord record = new LogRecord(LEVEL, suspended.toString());
    record.setMillis(suspended.getTimestamp());
    LOG.log(record);
}
Also used : LogRecord(java.util.logging.LogRecord) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

Subscribe (com.google.common.eventbus.Subscribe)304 SimpleCommand (net.kodehawa.mantarobot.core.modules.commands.SimpleCommand)47 GuildMessageReceivedEvent (net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent)37 EmoteReference (net.kodehawa.mantarobot.utils.commands.EmoteReference)33 MantaroData (net.kodehawa.mantarobot.data.MantaroData)32 List (java.util.List)30 Utils (net.kodehawa.mantarobot.utils.Utils)29 CommandRegistry (net.kodehawa.mantarobot.core.CommandRegistry)28 Module (net.kodehawa.mantarobot.core.modules.Module)28 AllowConcurrentEvents (com.google.common.eventbus.AllowConcurrentEvents)23 Test (org.junit.Test)23 Collectors (java.util.stream.Collectors)22 MessageEmbed (net.dv8tion.jda.core.entities.MessageEmbed)22 EventBus (com.google.common.eventbus.EventBus)20 IOException (java.io.IOException)19 SubCommand (net.kodehawa.mantarobot.core.modules.commands.SubCommand)19 TimeUnit (java.util.concurrent.TimeUnit)18 Context (net.kodehawa.mantarobot.core.modules.commands.base.Context)17 HelpContent (net.kodehawa.mantarobot.core.modules.commands.help.HelpContent)17 Command (net.kodehawa.mantarobot.core.modules.commands.base.Command)16