How to disable ScalaDoc generation in dist task in Play 2.2.x (using project/build.scala)?
Asked Answered
H

1

39

Adding the following settings to the build.sbt file of a Play 2.2.x app does not disable Scaladoc generation. How can it be disabled?

play.Project(appName, appVersion, appDependencies)
    .settings(scalaVersion := "2.10.3")
    .settings(jsSettings : _*)
    .settings(
        publishArtifact in (Compile, packageDoc) := false,
        publishArtifact in packageDoc := false
    )
Hols answered 30/1, 2014 at 16:18 Comment(0)
H
64

Add the following settings to the Play project:

sources in (Compile,doc) := Seq.empty
publishArtifact in (Compile, packageDoc) := false

With the change it should be as follows:

play.Project(appName, appVersion, appDependencies)
    .settings(scalaVersion := "2.10.3")
    .settings(jsSettings : _*)
    .settings(
        publishArtifact in (Compile, packageDoc) := false,
        publishArtifact in packageDoc := false,
        sources in (Compile,doc) := Seq.empty
    )

Thanks @peter-hilton for the comment!

Hoary answered 31/1, 2014 at 22:35 Comment(4)
This seems to prevent creating the docs JAR for me: settings(publishArtifact in (Compile, packageDoc) := false), and the same with packageSrc for the sources.Kelcey
Works for me with Play 2.3.2: github.com/guardian/gu-who/commit/…Caveman
Great answer. The official document goes a long way in how to include the stuff but not how to disable it. The answer was not clear to me wheter to include play.Project... but in my case just having the two lines in the first code block of the post was all needed. Now I can build and stage my app under 30 seconds as opposed to 5 min! Thank you!Citral
Different syntax in my project, but based on this answer, I added: Compile / doc / sources := Seq.empty to my .settings( and it worked.Hillis

© 2022 - 2024 — McMap. All rights reserved.