-
Notifications
You must be signed in to change notification settings - Fork 5k
Fix #3029: Use correct server class when distributing Play applications #3314
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
Conversation
For version 2.6, the new full qualified class name is "play.core.server.ProdServerStart". Issue: #3029
Thanks for your excellent work! LGTM, but please give me some time to validate it. @big-guy I'll appreciate it if you can give us more suggestions. |
@blindpirate thanks for looking. Not trying to rush your guys here, so take your time. My goal here is to fix these small problems so that we can have full support of Play 2.6 and then add Gradle's Besides that, I really appreciate that we can work together to evolve Gradle+Play dev experience. ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small comments, thanks for your help @marcospereira
case PLAY_2_6_X: | ||
return "play.core.server.ProdServerStart"; | ||
default: | ||
throw new RuntimeException("Could not create Twirl compile spec for Play version: " + playVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably say something like, "Could not determine main class for Play version: " + playVersion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad copy and pasta. :-P
Will fix that too.
case PLAY_2_5_X: | ||
return "play.core.server.NettyServer"; | ||
case PLAY_2_6_X: | ||
return "play.core.server.ProdServerStart"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has actually been deprecated for a few releases (2.4.x?). Could we try using the non-deprecated version for 2.4+?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right:
Will use ProdServerStart
for 2.4 and 2.5 too.
@big-guy thanks for helping here. Please, review again. |
playVersion | mainClass | ||
"2.3.10" | "play.core.server.NettyServer" | ||
"2.4.11" | "play.core.server.NettyServer" | ||
"2.5.18" | "play.core.server.NettyServer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading the code in PlayDistributionPlugin.java
correctly then NettyServer
is expected for 2.2 and 2.3 and ProdServerStart
for 2.4+. I'm not sure whether the code or the test is correct, but they don't seem to match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right, I guess this is just a typo. I've fixed them, thanks for pointing out!
@big-guy and @blindpirate, some questions: are these fixes ok to be backported to Gradle 4.3? I don't know how this works for Gradle (there is no information in contributing guide). As far as I can tell, these changes are compatible with what we have in 4.3 so they should be ok to backport. Should I submit new PR targeting a specific branch or are the changes cherry-picked manually when releasing? Is it possible to add then to the next dot release? |
By the way, I've noticed that there is a "4.4 RC1" milestone and that #3018 was added to this milestone. I think this PR could be part of "4.4 RC1" too. |
Context
This fixes #3029 where the wrong main class is used when running dist tasks. The full qualified class name for Play 2.6 is
"play.core.server.ProdServerStart"
Contributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew <changed-subproject>:check
Gradle Core Team Checklist