自動監視コンパイル
//playのコンソールモードに入ってから下記を入力
~compile
先日のplay勉強会で教わりました(http://blog.greative.jp/archives/627)。
通常は、編集して保存したのち、リクエストを送ってはじめてコンパイルされますが、そのときにラグがあります。
下記のコマンドを流しておけば、保存した瞬間にコンパイルされるので、少しラグが緩和されます。
実際の使い方
auto_compile
% play
[info] Loading project definition from /Users/path/to/test/project
[info] Set current project to test (in build file:/Users/path/to/test/)
_ _
_ __ | | __ _ _ _| |
| '_ \| |/ _' | || |_|
| __/|_|\____|\__ (_)
|_| |__/
play! 2.0.1, http://www.playframework.org
> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.
[test] $ ~compile//←これ!!!
[info] Updating {file:/Users/path/to/test/}test...
[info] Done updating.
[info] Compiling 5 Scala sources and 1 Java source to /Users/path/to/test/target/scala-2.9.1/classes...
[success] Total time: 24 s, completed 2012/06/20 10:33:53
1. Waiting for source changes... (press enter to interrupt)
[info] Compiling 1 Scala source to /Users/path/to/test/target/scala-2.9.1/classes...
[success] Total time: 2 s, completed 2012/06/20 10:34:41
2. Waiting for source changes... (press enter to interrupt)