Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

marcospereira
Copy link
Contributor

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

Gradle Core Team Checklist

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation
  • Recognize contributor in release notes

For version 2.6, the new full qualified class name is
"play.core.server.ProdServerStart".

Issue: #3029
@marcospereira marcospereira changed the title Use correct server class when distributing Play applications Fix #3029: Use correct server class when distributing Play applications Oct 30, 2017
@blindpirate
Copy link
Collaborator

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.

@marcospereira
Copy link
Contributor Author

@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 build.gradle file to our example projects and templates (eventually documentation too).

Besides that, I really appreciate that we can work together to evolve Gradle+Play dev experience. ;-)

Copy link
Member

@big-guy big-guy left a 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);
Copy link
Member

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

Copy link
Contributor Author

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";
Copy link
Member

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+?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcospereira
Copy link
Contributor Author

@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"
Copy link
Contributor

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?

Copy link
Collaborator

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!

@blindpirate blindpirate self-assigned this Nov 3, 2017
@marcospereira
Copy link
Contributor Author

@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?

@marcospereira
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

playBinary - gradle 4.2 play 2.6 - using the wrong main class

4 participants