playframework/Play20 — pull request #1209 by huntc (2013-07-14 07:12:29+00:00)
Title: Improved dist task

Use sbt's packager plugin to produce universal distributions as part of Play's dist task i.e. produce zip and tar.gz archives.

#### Today
Play presently produces a zip file in a project's dist folder using the "dist" task. The zip file has the following layout:

lib/

README
start

#### For 2.2
The following changes are proposed:
* change the use of Play's dist folder so that it becomes the default contents for distribution (at the moment it is the target of the dist command);
* change the layout within the archives given that the packager's tools adopt a certain convention;
* defer to the packaging plugin as to the type of archive that should be created i.e. Play's dist will no longer produce a zip as the user may desire another form.

The following packaging plugin conventions will be adopted by Play for its dist file layout:

bin/

lib/

conf/
<
everything from the project's conf folder except the routes file.
application.conf will be located here via a config.file property
declaration in the start script.
>
share/
doc/
api/

README

mapGenericFilesToLinux will be enabled by default so that the plugin's appropriate behaviours can occur.

Play's dist task will copy any existing "dist" folder to the project's target/dist folder and use this as a source for the packaging tasks. The target/dist folder will be enhanced by Play's dist task with scripts, libraries, configuration and doc as required. The universal:package-bin and universal:package-zip-tarball tasks will be configured to depend on the dist task. These packaging tasks will produce archives in the project's target folder.

The functionality that creates a zip file will also be removed from Play's dist task as the packager will have this responsibility.

#### Links
https://github.com/sbt/sbt-native-packager
http://scala-sbt.org/sbt-native-packager