Created
July 13, 2011 14:19
-
-
Save maedaunderscore/1080369 to your computer and use it in GitHub Desktop.
sbtからnunitを実行するシェルをたたいて結果を通知
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
import Process._ | |
import java.io.File | |
import java.awt.event._ | |
import java.awt.TrayIcon._ | |
object MyBuild extends Build { | |
override lazy val projects = Seq(root) | |
lazy val root = Project("root", file(".")) settings( | |
nunit <<= inputTask { (args: TaskKey[Seq[String]]) => args map runShell }, | |
unmanagedSourceDirectories := List(new File("/Users/maeda/test/")), | |
unmanagedSources <<= unmanagedSourceDirectories map {d => ( d ** "*.fs").get } | |
) | |
val nunit = InputKey[Unit]("nunit", "run nunit") | |
def runShell(args : Seq[String]) : Unit = "sh a.sh"! match { | |
case 0 => tray.displayMessage("NUnit", "OK", MessageType.INFO) | |
case _ => tray.displayMessage("NUnit", "NG", MessageType.ERROR) | |
} | |
val icon = new javax.swing.ImageIcon("/Users/maeda/Downloads/ninja.png") | |
val tray = { | |
val ret = new java.awt.TrayIcon(icon.getImage) | |
java.awt.SystemTray.getSystemTray().add(ret) | |
ret | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment