typesafehub / sbt-lagom-bundle

Other
0 stars 5 forks source link

Provide defaults for Play project #14

Open markusjura opened 8 years ago

markusjura commented 8 years ago

sbt-lagom-bundle kicks in for every project that has LagomJava enabled. It does not kick in for projects that have LagomPlay, PlayJava or PlayScala enabled. As a result the user need to manually specify the following things for a LagomPlay or Play project:

A possible solution would be to create a separate sbt plugin sbt-play-bundle that provide some of the above defaults for a Play project. In particular it could provide defaults for the bundle keys, the java options and can add the play[version]-bundle-lib. For a Lagom project we also generate and set the play.crypto.secret automatically. In the context of Lagom this can be automated because Lagom itself is not using the session at all. In the context of Play the user need to set the play.crypto.secret manually for prod mode.

sbt-lagom-bundle could then be based on the new sbt-play-bundle plugin instead of sbt-bundle directly. Also we would need to change sbt-lagom-bundle to get triggered if the plugin LagomPlay is enabled. In this case we should use sbt-play-bundle and override the play[version]-bundle-lib to the lagom10-bundle-lib.

huntc commented 8 years ago

I would prefer an sbt-play-bundle plugin so that it can be used for Play apps in isolation of Lagom.

markusjura commented 8 years ago

Yes, that's what I've stated above ;-)

markusjura commented 8 years ago

Another goodie would be if the sbt-play-bundle plugin resolves the endpoints from the routes file to generate the SbtBundle.endpoints key. This way the user by default don't need to worry about this.