Skip to content

Commit

Permalink
Merge pull request #773 from ihostage/issue-745
Browse files Browse the repository at this point in the history
[Gradle] Add notes about using templates in Java sources
  • Loading branch information
mkurz committed Apr 26, 2024
2 parents 04c0d3e + 635df35 commit fc6f19a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ Replacing the `LATEST_VERSION` with the latest version published, which should b

Twirl template files are expected to be placed under `src/main/twirl` or
`src/test/twirl`, similar to `scala` or `java` sources. The additional source
locations for template files can be configured.
locations for template files can be configured.

⚠️Please note that the output of the template compilation is Scala source code.
If you use these templates in your Java source files, you must place them in a _joint compilation_ folder (see the [Gradle Scala Plugin](https://docs.gradle.org/current/userguide/scala_plugin.html#sec:scala_project_layout) documentation for details).
The default location for this folder is `src/main/scala`, but it [can be customized](https://stackoverflow.com/questions/23261075/compiling-scala-before-alongside-java-with-gradle).

Template files must be named `{name}.scala.{ext}` where `ext` can be `html`,
`js`, `xml`, or `txt`.
Expand Down

0 comments on commit fc6f19a

Please sign in to comment.