Skip to content

Commit

Permalink
Merge pull request #202 from mkurz/giter8_force
Browse files Browse the repository at this point in the history
Upgrade giter8 which now has a --force flag
  • Loading branch information
mkurz authored May 3, 2023
2 parents e409ab3 + 89bea6a commit 93239a2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ sbt new playframework/play-scala-seed.g8

## Scaffolding

Type `g8Scaffold form` from sbt to create the scaffold controller, template and tests needed to process a form. Be aware you then have to add new routes to the `conf/routes` file, otherwise compilation will fail. See the comments in the newly created controller class which routes need to be added.
Type `g8Scaffold form` from sbt to create the scaffold controller, template and tests needed to process a form. Be aware you then have to:
* Either add new routes to the `conf/routes` file, otherwise compilation will fail. See the comments in the newly created controller class which routes need to be added.
* Or use the `--force` flag which will set up the required routes in the routes file, but overrides any changes you did in that file.

You can also create your own giter8 seeds and scaffolds based off this one by forking from the <https://github.com/playframework/play-java-seed.g8> or <https://github.com/playframework/play-scala-seed.g8> github projects.

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8" % "0.16.1")
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8" % "0.16.2")
12 changes: 12 additions & 0 deletions src/main/scaffolds/form/conf/routes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Routes
# This file defines all application routes (Higher priority routes first)
# https://www.playframework.com/documentation/latest/ScalaRouting
# ~~~~

# An example controller showing a sample home page
GET / controllers.HomeController.index()
GET /$model;format="camel"$ controllers.$model;format="Camel"$Controller.$model;format="camel"$Get()
POST /$model;format="camel"$ controllers.$model;format="Camel"$Controller.$model;format="camel"$Post()

# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
8 changes: 3 additions & 5 deletions src/test/g8/giter8.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
> compile
> test

# TODO: Switch to g8ScaffoldForce and uncomment last two lines when
# https://github.com/foundweekends/giter8/pull/771 got merged
> g8Scaffold form --model=user
> g8Scaffold form --force --model=user

$exists app/controllers/UserController.scala
$exists test/controllers/UserControllerSpec.scala

#> compile
#> test
> compile
> test

0 comments on commit 93239a2

Please sign in to comment.