Open dwijnand opened 5 years ago
That won't work because it's not possible to access lombok generated code from within Scala (=twirl) code. More information can be found in my old comment here: https://github.com/playframework/playframework/pull/4006#issuecomment-81049150
The Scala compiler doesn't know anything about what lombok annotations will generate, hence it can't access lombok generated methods: https://github.com/scala/scala/tree/2.13.x/src/compiler/scala/tools/nsc/javac
Here is also a good explanation. The problem is the Scala parser does not support/run an annotation processor.
As feared. Thanks for the wonderful explanation and links, @mkurz!
Thanks, @mkurz!
Well, play-enhancer stills not a good solution, and I think we need to deprecate it anyway even if Lombok is not a drop-in replacement. Maybe this issue is about documenting the alternatives (write the code yourself, use Lombok with a subproject).
Yeah. I personally use Lombok within subprojects for my Play-Java projects. That works fine.
I've reopened and edited the title and description.
Or just wait until Java itself catches up :laughing: :rofl: (like https://cr.openjdk.java.net/~briangoetz/amber/datum.html)
Or just wait until Java itself catches up
buys a comfortable chair
One thing that we can do just right now is to avoid using it in our sample applications. Not a 100% sure, but I think https://github.com/playframework/play-java-ebean-example is the only one using it.
A quick, naïve search in my local repos:
find . | grep plugins.sbt | xargs grep enhanc| awk -F\/ '{print $2 }' | uniq
play-java-fileupload-example
play-java-grpc-example
play-java-jpa-example
play-java-starter-example
playframework
I wouldn't be suprised if it's used somewhere else.
PS: I don't see it used in playframework/play-java-ebean-example
build.sbt
instead of plugins.sbt
)Other projects:
Yeah, for most of these samples, I don't think it is necessary. But I think play-ebean requires it, so we can just remove from all the other examples not using Ebean and use alternatives.
Some of the possible alternatives: