Help us understand the problem. What is going on with this article?

Let's Play!!

More than 3 years have passed since last update.

Playしよう(序章)

文字通りplay frameworkを用いてScalaでアプリケーションを書いていきます
バージョンは
Scala: 2.11.7
Play: 2.4.4
となります。Macであれば両方ともHomebrewで入れられるかと
※注意

$brew install play
Error: No available formula with the name "play"

は通りません。playを入れる場合は

$brew install typesafe-activator

とします。

Playを始めよう

$activator new (アプリ名)

でアプリ用のディレクトリを作成する事が出来ます。このとき1~6と選択肢が出ると思いますが、今回はscalaでやっていくので6を選択して下さい。

- newapp
     + LICENSE
     + README
     + activator
     + activator-launch-1.3.6.jar
     + build.sbt
     - app
         - controllers
            + Application.scala
         - views
            + index.scala.html
            + main.scala.html
     - conf
         + application.conf
         + logback.xml
         + routes
     - project
         + build.properties
         + plugins.sbt
         - project
            - target
                - config-classes
         - target
     - target
     - logs
         + application.log
     - public
         - images
         - javascripts
         - stylesheets
     - test
         + ApplicationSpec.scala
         + IntegrationSpec.scala

構造は上記の様になります
(ディレクトリツリーの全てを載せると長くなるので割愛)

Eclipseとの連携

IDEで編集した方が比較的やりやすいかなと思うので、今回はEclipse LUNAを用いていきます。
まずはactivator側でplugin.sbtを編集していきます

project/plugins.sbt
...
//For Eclipse
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")

次に以下の様なコマンドを作成したアプリのディレクトリ内で実行します

% activator eclipse

後はEclipse内でFile->Import->Existing Projects into Workspaceで作成したアプリのディレクトリを選べばeclipse上で動かす事ができます

続きがあればもっと踏みこんだとこをやっていきます
コンソールの使い方等、細かい所は以下を参照していただければ良いかと思います。
https://www.playframework.com/documentation/ja/2.4.x/Home

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away