Skip to content

Commit b32d3e6

Browse files
committed
Merge pull request #80 from tuplejump/develop
release 0.8.1
2 parents b26d1d4 + f29e72a commit b32d3e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1708
-468
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The play-compatible-version depends on the version of Playframework being used,
4747
|---------------------------|--------------------|--------------|
4848
| 2.2.x | 0.6.4 | 2.10 |
4949
| 2.3.x | 0.7.1 | 2.10, 2.11 |
50-
| 2.4.x | 0.8.0 | 2.11 |
50+
| 2.4.x | 0.8.1 (support for injected routes generator) | 2.11 |
5151

5252

5353
3) Import Yeoman classes in the project build adding the following import to `project/Build.scala`,
@@ -107,6 +107,22 @@ play.Project.playJavaSettings ++ Yeoman.yeomanSettings
107107

108108
```
109109

110+
Using 0.7.1 or greater
111+
112+
```
113+
import com.tuplejump.sbt.yeoman.Yeoman
114+
115+
name := "play-project"
116+
117+
version := "1.0-SNAPSHOT"
118+
119+
scalaVersion := "2.x.x"
120+
121+
lazy val root = (project in file(".")).enablePlugins(PlayScala)
122+
123+
Yeoman.yeomanSettings ++ Yeoman.withTemplates
124+
```
125+
110126
5) Add yeoman routes to the project, appending the following line in conf/routes files,
111127

112128
```
@@ -126,6 +142,9 @@ GET / com.tuplejump.playYeoman.Yeoman.redirectRoot(base="/ui/")
126142
127143
```
128144

145+
If using, Play's injected routes generator, prefixing the route with `@` will work except for `yeoman.Routes`. It can be used as is.
146+
147+
129148
6) Start play/sbt in your project folder,
130149

131150
```
@@ -233,7 +252,7 @@ Using >= 0.7.1
233252

234253
* Once that is done play will compile the templates from yeoman directory too, and you can use them in your controllers. This helps you keep all your UI files together under the yeoman directory ('ui' by default)
235254

236-
* Look at the yo-demo project for details!
255+
* Look at the yo-demo and yo-injection-demo projects for details!
237256

238257
Note: Starting from 0.7.1, play-yeoman supports compilation of views from the yeoman directory but cannot recompile them when they are modified with the server running. You will need to stop the server and start it again.
239258

@@ -254,7 +273,6 @@ For this purpose play-yeoman provides 2 settings that you can use in you play pr
254273

255274
2) yeoman.devDirs - This is a List of String that takes a list of locations where play-yeoman should look for files in development mode i.e. when run using sbt run.
256275

257-
258276
Note: Starting from 0.7.1, it is possible to disable force option on execution of grunt tasks. This can be done by adding the following to the application build settings,
259277

260278
```

notes/0.8.1.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
New in this release
2+
3+
+ Support for using Play's injected routes generator.
4+
+ updated default value for devDirs to include 'ui'. (related to #78)

play-yeoman/README

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
This is your new Play 2.1 application
2-
=====================================
3-
4-
This file will be packaged with your application, when using `play dist`.
1+
This application provides the controllers for the plugin

play-yeoman/app/com/tuplejump/playYeoman/Yeoman.scala

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,23 @@ object Yeoman extends Controller {
4141

4242
}
4343

44+
/**
45+
* Class added to support injected route generator (Play 2.4 onwards)
46+
*/
47+
class Yeoman extends Controller {
48+
def index = Yeoman.index
49+
50+
def redirectRoot(base: String = "/ui/") = Yeoman.redirectRoot(base)
51+
}
52+
4453
object DevAssets extends Controller {
4554
// paths to the grunt compile directory or else the application directory, in order of importance
4655
val runtimeDirs = Play.configuration.getStringList("yeoman.devDirs")
4756
val basePaths: List[java.io.File] = runtimeDirs match {
4857
case Some(dirs) => dirs.asScala.map(Play.application.getFile _).toList
49-
case None => List(Play.application.getFile("ui/.tmp"), Play.application.getFile("ui/app"))
58+
case None => List(Play.application.getFile("ui/.tmp"), Play.application.getFile("ui/app"),
59+
//added ui to defaults since the newer projects have bower_components in ui directory instead of ui/app/components
60+
Play.application.getFile("ui"))
5061
}
5162

5263
/**

play-yeoman/project/Build.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1+
import play.sbt.PlayScala
2+
import sbt.Keys._
13
import sbt._
2-
import Keys._
3-
import play.Play.autoImport._
4-
import PlayKeys._
54

65
object ApplicationBuild extends Build {
76

87
val appName = "play-yeoman"
9-
val appVersion = "0.8.0"
8+
val appVersion = "0.8.1"
109

1110
val appDependencies = Seq(
1211
// Add your project dependencies here,
1312
//jdbc,
1413
//anorm
1514
)
1615

17-
val main = Project(appName, file(".")).enablePlugins(play.PlayScala).settings(
16+
val main = Project(appName, file(".")).enablePlugins(PlayScala).settings(
1817
version := appVersion,
1918
libraryDependencies ++= appDependencies,
2019
// Add your own project settings here

sbt-yeoman/activator

Lines changed: 0 additions & 246 deletions
This file was deleted.

sbt-yeoman/activator-launch-0.1.1.jar

-1.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)