Skip to content

Commit 8314c56

Browse files
committed
Updated Play tutorial for Play 2.1 and Scala IDE 3.0.0
I have only updated the text, not the images, as this is cumbersome and I think having un up-to-date text is sufficient to understand the tutorial. Fixes #53
1 parent 3556e24 commit 8314c56

24 files changed

+19
-38
lines changed

src/sphinx/tutorials/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tutorials
55
:maxdepth: 2
66

77
m2eclipse/index.rst
8-
play20scalaide20/index.rst
8+
play/index.rst
99
lift24scalaide20/index.rst
1010
continuations-plugin/index.rst
1111
scalac-trunk/index.rst
Loading

src/sphinx/tutorials/play20scalaide20/index.rst renamed to src/sphinx/tutorials/play/index.rst

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Setup and use Play framework 2.0 in Scala IDE 2.0
1+
Setup and use Play framework 2.1 in Scala IDE 3.0
22
=================================================
33

44
What is in this guide?
@@ -9,7 +9,7 @@ This guide will show you how to configure a Play web application to import it in
99
Prerequisites
1010
.............
1111

12-
* `Eclipse`_ 3.6.2 (Helios) with Scala IDE for Scala 2.9 installed (update site: http://download.scala-ide.org/releases-29/stable/site).
12+
* `Eclipse`_ 3.7 (Indigo) with Scala IDE for `Scala 2.10 installed <http://scala-ide.org/download/current.html#for_scala_210x>`_.
1313

1414
Check the :doc:`getting started </current-user-doc/gettingstarted/index>` page for instructions on how to install Scala IDE.
1515

@@ -19,22 +19,22 @@ Prerequisites
1919

2020
* No knowledge of the Play framework is required (in this guide).
2121

22-
Setting up Play 2.0
22+
Setting up Play 2.1
2323
-------------------
2424

2525
To be able to create a Play web application, the Play framework need to be installed. If you have not installed it already, follow this few steps, or use the `Play documentation`_.
2626

27-
* Download Play framework 2.0 from http://www.playframework.org/.
27+
* Download Play framework 2.1 from http://www.playframework.org/.
2828

29-
* Unzip it in your preferred location. Let's say ``/path/to/play20`` for the purpose of this document.
29+
* Unzip it in your preferred location. Let's say ``/path/to/play21`` for the purpose of this document.
3030

3131
* For convenience, add the Play folder to your system PATH:
3232

3333
.. code-block:: bash
3434
35-
export PATH=$PATH:/path/to/play20
35+
export PATH=$PATH:/path/to/play21
3636
37-
Creating a Play 2.0 application
37+
Creating a Play 2.1 application
3838
-------------------------------
3939

4040
* In your development folder, ask Play to create a new web application, as a ``simple Scala application``.
@@ -72,12 +72,12 @@ Creating a Play 2.0 application
7272
:width: 100%
7373
:target: ../../_images/play20-scalaide20-05.png
7474

75-
Configuring the Play 2.0 web application for Scala IDE
75+
Configuring the Play 2.1 web application for Scala IDE
7676
------------------------------------------------------
7777

7878
Now that the Play application is running, it needs to be configured so it can be imported into Scala IDE.
7979

80-
Play 2.0-RC1 integrates `sbteclipse`_, which allow to create configuration files of a project for Eclipse.
80+
Play 2.1 integrates `sbteclipse`_, which allow to create configuration files of a project for Eclipse.
8181

8282
* First, exit the 'run' mode in Play using ``ctrl-d``.
8383

@@ -86,7 +86,7 @@ Play 2.0-RC1 integrates `sbteclipse`_, which allow to create configuration files
8686
:width: 100%
8787
:target: ../../_images/play20-scalaide20-06.png
8888

89-
* ``eclipsify`` is the command to invoke sbteclipse in Play. (In Play 2.1, the command is ``eclipse``)
89+
* ``eclipse`` is the command to invoke sbteclipse in Play. (or ``eclipse with-source=true`` if you want to also download sources attachment of your dependencies)
9090

9191
.. image:: images/play20-scalaide20-09.png
9292
:alt: eclipse
@@ -114,10 +114,10 @@ Setting a few preferences in Eclipse will make everything easier to use.
114114

115115
* Configure Eclipse so changes on the file system are automatically picked up.
116116

117-
.. image:: images/play20-scalaide20-13.png
117+
.. image:: images/refresh-on-access.png
118118
:alt: refresh automatically
119119
:width: 100%
120-
:target: ../../_images/play20-scalaide20-13.png
120+
:target: ../../_images/refresh-on-access.png
121121

122122
* If you don't have the Web Development Tools for Eclipse installed, Eclipse opens ``.html`` files in a web browser. Configure it to use the ``Text Editor`` instead.
123123

@@ -131,29 +131,13 @@ Importing the Play web application into Scala IDE
131131

132132
Everything is setup, it is time to import the project in the IDE.
133133

134-
* Import the Play 2.0 application as an ``Existing Projects into Workspace``.
134+
* Import the Play 2.1 application as an ``Existing Projects into Workspace``.
135135

136136
.. image:: images/play20-scalaide20-15.png
137137
:alt: import project
138138
:width: 100%
139139
:target: ../../_images/play20-scalaide20-15.png
140140

141-
* The configuration generated by sbteclipse is working fine in Eclipse, but it is not optimal when using with Scala IDE.
142-
143-
Add the ``target/src_managed/scala`` folder as a source folder.
144-
145-
.. image:: images/play20-scalaide20-20.png
146-
:alt: add the managed sources folder
147-
:width: 100%
148-
:target: ../../_images/play20-scalaide20-20.png
149-
150-
* And remove the ``classes_managed`` folder for the build path.
151-
152-
.. image:: images/play20-scalaide20-21.png
153-
:alt: remove managed classes folder
154-
:width: 100%
155-
:target: ../../_images/play20-scalaide20-21.png
156-
157141
* Everything is good, everything compiles.
158142

159143
.. image:: images/play20-scalaide20-16.png
@@ -181,17 +165,15 @@ Let's change the main page to display a quote instead of the default page.
181165
182166
package models
183167
184-
case class Quote(val text: String, val author: String) {
185-
186-
}
168+
case class Quote(text: String, author: String)
187169
188170
* Add an extra parameter to the ``index.scala.html`` view and update the layout.
189171

190172
.. code-block:: scala
191173
192174
@(message: String, quote: models.Quote)
193175
194-
@main("Welcome to Play 2.0") {
176+
@main("Welcome to Play 2.1") {
195177
196178
<p>@quote.text<em> - @quote.author</em></p>
197179
@@ -226,9 +208,9 @@ Let's change the main page to display a quote instead of the default page.
226208
Going further
227209
-------------
228210

229-
You now have all you need to create great web applications with Play 2.0 and Scala.
211+
You now have all you need to create great web applications with Play 2.1 and Scala.
230212

231-
For more information about Play 2.0, check out the `embedded documentation`_.
213+
For more information about Play 2.1, check out the `embedded documentation`_.
232214

233215
For more information about Scala, go to the `documentation website`_ or get the downloadable `eBook`_.
234216

@@ -241,11 +223,10 @@ Please use github tickets and pull requests system for feedback.
241223
Luc Bourlier - `+Luc Bourlier`_ `@sky1uc`_
242224

243225

244-
.. _#1000907: http://www.assembla.com/spaces/scala-ide/tickets/1000907
245226
.. _Scala IDE: http://www.scala-ide.org
246227
.. _Scala IDE documentation project: https://github.com/scala-ide/docs
247228
.. _Eclipse: http://www.eclipse.org/
248-
.. _Play documentation: http://www.playframework.org/documentation/2.0/Installing
229+
.. _Play documentation: http://www.playframework.com/documentation/2.1.0/Home
249230
.. _sbteclipse: https://github.com/typesafehub/sbteclipse
250231
.. _embedded documentation: http://localhost:9000/@documentation/Home
251232
.. _documentation website: http://docs.scala-lang.org/
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)