Tumgik
code-plus · 10 years
Text
Getting Started with: Play Framework (2.3.2) I
Today I will talk about how i got started with the Play Framework. I think the documentation ist not perfect, so maybe it's good to get a start. 
In the first part of the series I will cover the installation and how to prepare IntelliJ for a play project.
I. Installation (Windows)
As I'm using Windows OS i will explain shortly how to install everything.  At first go to the Play Download Page at http://playframework.com/download and download the latest version.
Then you have to add the Install Directory to your path environment variable and after that you can start.
II. Create your first application
To build a new Play application just open the console (cmd) and type in "activator new". You get asked what template you want to use. For the first try I would recommend "3> play-java for java developers". After that enter the name of your new play application and you're done.
III. Prepare IntelliJ IDE
I would strongly recommend to use an IDE and I prefer the IntelliJ IDEA because it has a good play framework integration and a very good user interface. You have to invest into the Ultimate Edition, because at the moment it's the only IntelliJ edition that supports play.
So if you have the IDE running, go to the settings menu (File->Settings). Choose Plugins under IDE Settings and click on "Install JetBrains plugin...". A new window will pop up and you have to search for "Play 2.0 Support" and "Scala". Install them both and you're done.
IV. Convert the project for the IDE
To use IntelliJ for your play application, you have to open the console and move to the directory of your application.
When you are in the directory, you can type in the console "activator idea". This converts the project to the IntelliJ project format.
Now open IntelliJ and open the project like you are used to do.
V. Run your application
IntelliJ has an integrated Terminal that you can use to control your play application. To run it type in the console "activator run". 
Open your favourite browser and navigate to http://localhost:9000 and your first play application is running!
0 notes
code-plus · 10 years
Text
Play Framework not processing .less Files
Actually I'm diving deeper into the Play Framework. So i just came to the issue that my .less Files that i have to put into the /App/Assets/Stylesheets Folder were not processed.
After hours of research I found the simple Solution: In Play Framework 2.3 they changed the default behaviour of processing .less files.
see http://www.playframework.com/documentation/2.3.x/Migration23
Only the .less file named "main.less" gets processed, you have to add a filter to your build.sbt to process the others.
Solution:
1. Edit your build.sbt
2. Add the following or modified line:  "includeFilter in (Assets, LessKeys.less) := "test.less | test2.less" or simply "includeFilter in (Assets, LessKeys.less) := "*.less""
0 notes