playframeworksbtsbt-native-packagerscaladoc

Skip scaladoc when running 'dist' on a Play project


How can I stop scaladoc from running when executing 'dist' on a Play project (currently using Play 2.3.0)? As an example:

$ git clone --branch play-2.3.0 git@github.com:guardian/gu-who.git
$ cd gu-who
$ sbt clean dist
[info] Loading project definition from /tmp/gu-who/project
[info] Set current project to gu-who (in build file:/tmp/gu-who/)
[success] Total time: 0 s, completed 20-Aug-2014 09:57:55
...
[info] Compiling 23 Scala sources and 1 Java source to /tmp/gu-who/target/scala-2.10/classes...
[info] Main Scala API documentation to /tmp/gu-who/target/scala-2.10/api...
[info] Packaging /tmp/gu-who/target/gu-who-1.0-SNAPSHOT-assets.jar ...
[info] Done packaging.
model contains 54 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /tmp/gu-who/target/scala-2.10/gu-who_2.10-1.0-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging /tmp/gu-who/target/scala-2.10/gu-who_2.10-1.0-SNAPSHOT.jar ...
[info] Done packaging.
[info] 
[info] Your package is ready in /tmp/gu-who/target/universal/gu-who-1.0-SNAPSHOT.zip
[info] 
[success] Total time: 20 s, completed 20-Aug-2014 09:58:15

The 'scaladoc' portion of that process takes about 12 of those 20 seconds. I don't want to run scaladoc at all (anyone doing work on this non-library project will be looking at the actual source code).


Solution

  • For newer versions of Play (I'm currently using 2.8.1), you'll have to add these settings to the project in sbt (or to every subproject):

    Compile / doc / sources := Nil
    Compile / packageDoc / publishArtifact  := false
    

    (This is the new syntax from sbt 1.)