-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that the task compileScala is recompiling ALL scala files everytime #129
Comments
Also https://www.jetbrains.com/help/idea/dsm-analysis.html -- you want to see what dependencies you have between classes. |
Thank you for helping ... I am using the very simple starter kit For example if I change a single file app\views\index.scala.html
and then check the generated scala files:
They ALL have been modified (checking the timestamp). So it seems that the task compilePlayTwirlTemplates has a problem. Could it be configured ? This is my build.gradle file:
|
I guess my last comment was not clear enough. To summarize I suspect the task compilePlayTwirlTemplates to be the cause of the problem, please reread my comment, thank you. |
The problem is that the generated files have a comment that contains absolute paths and the current timestamp. The timestamp changes every time the file re-generated and the absolute path breaks distributed caching. I added the following snippet to my build.gradle to remove the lines from the generated files that contain absolute paths and date stamps: compilePlayTwirlTemplates {
doLast {
fileTree("${buildDir}/src/play/twirl").each { file ->
file.text = file.text.replaceAll("(?m)^ (SOURCE|DATE): .*", "")
}
}
} With that work around in place caching and rebuilding works as expected. This is similar to #109 . |
@spingel Fantastic ! My compile time went from 4 minutes to a few seconds ! |
This should get fixed with Play 2.8.8: |
Just updating that it is not resolve in 2.8.8 |
Hi Extra update about this - so @spingel is right that the twirl and the route task are generating files with dates and paths but even if I am doing the suggested trick and I am only modifying or adding a new unused Java file the scala compiler compile all Java and Scala files:
|
Seems related to a regression in gradle 7.5: |
Whenever I change any file from the the view folder (containing scala), it takes a very long time for this task to complete, as if everything in the view folder was recompiled.
I haven't found an option to log what is recompiled, so I am not 100% sure.
Any help would be really welcome as it is very painful to work with the Play Framework at the moment.
The text was updated successfully, but these errors were encountered: