seratch's weblog in Japanese

About Scala, Java and Ruby programming in Japaense. If you need English information, go to http://blog.seratch.net/

Mac での Play20 開発環境構築は brew install play だけ

書くまでもない感じですが、以下のように Homebrew だけですぐに play コマンドを使えるようになります。

https://github.com/mxcl/homebrew/wiki/installation

$ /usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
(省略)

$ brew install play
==> Downloading http://download.playframework.org/releases/play-2.0.zip
(省略)
/usr/local/Cellar/play/2.0: 2496 files, 119M, built in 17 seconds

$ play new hello-play
(省略)
       _            _ 
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/ 
             
play! 2.0, http://www.playframework.org

The new application will be created in /Users/seratch/hello-play

What is the application name? 
> hello-play

Which template do you want to use for this new application? 

  1 - Create a simple Scala application
  2 - Create a simple Java application
  3 - Create an empty project

> 1

OK, application hello-play is created.

Have fun!

$ cd hello-play/

$ play
[info] Loading project definition from /Users/seratch/hello-play/project
[info] Set current project to hello-play (in build file:/Users/seratch/hello-play/)
       _            _ 
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/ 
             
play! 2.0, http://www.playframework.org

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[hello-play] $ run

[info] Updating {file:/Users/seratch/hello-play/}hello-play...
[info] Done updating.                                                                  
--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on port 9000...

(Server started, use Ctrl+D to stop and go back to the console...)

[info] Compiling 5 Scala sources and 1 Java source to /Users/seratch/hello-play/target/scala-2.9.1/classes...
[info] play - Application started (Dev)