01.SBT(simple-build-tool)



Eclipse






http://comment2.csdn.net/topic.php?tid=12446 (這個跟sbt有關嗎 冏 by shengyu)

SBT 構建工具,全名叫simple build tool,基於scala語言。跟ant,maven要比,要靈活小巧聰明懂事得多,它做到了groovy,jruby和jython都沒能做到的事情:突破了java語言的限制,解放了java程序員的生產力。在它的支持下,別的語言中(特別是ruby/python世界裡)的好東西,都移植到java中來了,java程序員有福了。

YouTube Video



YouTube Video



Setup



/usr/local/bin/sbt
#!/bin/sh
java -Xmx512M -jar `dirname $0`/sbt-launch-0.7.4.jar "$@"

Project Properties


project/build.properties
#Project properties
#Sat Sep 11 04:39:55 CST 2010
project.organization=org.wisdomfish
project.name=my-fancy-scala-project
sbt.version=0.7.4
project.version=1.0
build.scala.versions=2.8.1-SNAPSHOT
project.initialize=false

  • boot/

Your First Scala Program with Simple Build Tool

make a scala object in your src/main/scala/

object Hello {
    val name = "WisdomFish"
    def main(args: Array[String]){
   println("Hello " + name)
}
}

execute run command in sbt mode

> run

Import ScalaTest

make a file named xxx.scala in project/build/

project/build/
import sbt._

class Project(info: ProjectInfo) extends DefaultProject(info){
val s = "org.scalatest" % "scalatest" % "1.2"
}

execute command in sbt mode

> reload
> clean-cache
> update

Start Testing

make a file named xxxTest.scala in src/test/scala/

import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers

class HelloTest extends FlatSpec with ShouldMatchers{
"Hello name " should " be WisdomFish" in {
Hello.name should equal("WisdomFish")
}
}

execute command in sbt mode

> compile
> test



SBT for Eclipse

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.2")

Reference





http://code.google.com/p/macvim/
"editing goodness" == MacVim + NERD Tree + custom underwater colorscheme
Comments