$ sbt > compile上箭頭按鍵能夠選擇前一條命令。
其中test-only有兩個參數,TestA和TestB,把他們做爲一個總體,須要用雙引號包起來。 java
~ compilesbt會先執行一次編譯,並進入阻塞狀態。修改scala文件並保存,sbt就會自動從新編譯這個文件。在控制檯輸入回車能夠回到交互模式。
sbt ~ compile run
E:\study\study-sbt\hello-sbt>sbt ~ compile run [info] Loading project definition from E:\study\study-sbt\hello-sbt\project [info] Set current project to hello-sbt (in build file:/E:/study/study-sbt/hello -sbt/) 1. Waiting for source changes... (press enter to interrupt) 2. Waiting for source changes... (press enter to interrupt) 3. Waiting for source changes... (press enter to interrupt) [info] Updating {file:/E:/study/study-sbt/hello-sbt/}default-dea105... [info] Resolving org.scala-lang#scala-library;2.10.0 ... [info] Done updating. [info] Compiling 1 Scala source to E:\study\study-sbt\hello-sbt\target\scala-2.1 0\classes... [success] Total time: 4 s, completed 2013-1-23 12:01:17 [info] Running Hello Hello sbt!12 [success] Total time: 0 s, completed 2013-1-23 12:01:17
可見只有最後一次的更改生效了。。。 shell
reload 從新加載配置(build.sbt, project/*.scala, project/*.sbt)。修改構建文件後須要重載才能生效。 eclipse
在空命令提示符下直接輸入tab能夠查看全部命令。 測試
(最後兩個感受沒什麼用) ui
!-n例子> clean [success] Total time: 0 s, completed 2013-1-23 13:55:19 > !:5 40 !: 41 clean 42 !: 43 clean 44 !:5 > !-2 clean [success] Total time: 0 s, completed 2013-1-23 13:55:30!string例子
> !:10 44 !:5 45 clean 46 compile 47 !:10 48 clean 49 !: 50 clean 51 !: 52 !:5 53 !:10 > !c clean [success] Total time: 0 s, completed 2013-1-23 13:58:45 > !co compile ...