Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
boot-clj plugin to report build status to AnyBar
(defn- send-udp [s port]
(with-open [socket (java.net.DatagramSocket.)]
(let [group (java.net.InetAddress/getByName "localhost")
bytes (.getBytes s)
packet (java.net.DatagramPacket. bytes (count bytes) group port)]
(.send socket packet)
(.close socket))))
(deftask anybar [p port VAL int "AnyBar port"]
(let [port (or port 1738)]
(fn [next-task]
(fn [fileset]
(try
(send-udp "white" port)
(boot.util/with-let [_ (next-task fileset)]
(if (zero? @boot.core/*warnings*)
(send-udp "black" port)
(send-udp "orange" port)))
(catch Throwable t
(send-udp "red" port)
(throw t)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.