Hi. Amertum posted a solution that works, but there are other ways too. My
2 cents:
**1** Just moving the `TwirlKeys.templateFormats += ("csv" ->
"views.CsvFormat")` inside the `restfulapi` definition in the main
`build.sbt`, which would look like this:
...
lazy val restfulapi = (project in
file("modules/apirest")).enablePlugins(PlayScala).dependsOn(util).settings(scalaVersion:="2.11.7",
libraryDependencies ++= Seq(
cache,
"
org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test
),
TwirlKeys.templateFormats += ("csv" -> "views.CsvFormat")
)
...
**2** If you are going to need the custom format in other subprojects,
moving common settings to an object in a new `Common.scala` file (name it
whatever you want) in the `basedir/project` directory:
import sbt._
object Common {
val settings: Seq[Setting[_]] = Seq(
TwirlKeys.templateFormats += ("csv" -> "views.CsvFormat")
)
}
Then use Common object in subprojects `build.sbt`:
name := """apirest"""
Common.settings
See the [Play][1] and [SBT][2] documentation on subprojects for more details.
[1]:
https://playframework.com/documentation/2.5.x/SBTSubProjects
[2]:
https://www.scala-sbt.org/0.13/docs/Multi-Project.html
Regards,
Juan Carlos
> --
> You received this message because you are subscribed to the Google Groups
> "Play Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
play-framewor...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/play-framework/1926a456-b0ce-4d94-9c46-c95fbb189c32%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
>
> -----------------------------------------------------------------
> ---- Universidad de Camagüey "Ignacio Agramonte Loynaz", Cuba ---
> -----------------------------------------------------------------
> ----
https://intranet.reduc.edu.cu/ -----------------------------
> ----
https://www.reduc.edu.cu/ ----------------------------------
> -----------------------------------------------------------------
>
>
-------------------------------------------------------------------------------
---- Universidad de Camagüey "Ignacio Agramonte Loynaz", Cuba ----------------
-------------------------------------------------------------------------------
---- 6 de noviembre de 2017 ------------------------------------------------
----- Aniversario 50 de la Universidad de Camagüey "Ignacio Agramonte Loynaz"-
---- "50 años de ciencia y compromiso" ---------------------------------------
-------------------------------------------------------------------------------
---- Aniversario 95 de la FEU -------------------------------------------------
----
https://www.reduc.edu.cu/ ------------------------------------------------
-------------------------------------------------------------------------------