3

在 Play 项目(当前使用 Play 2.3.0)上执行“dist”时,如何阻止 scaladoc 运行?举个例子:

$ 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

该过程的“scaladoc”部分大约需要20 秒中的12秒。我根本不想运行 scaladoc (任何在这个非库项目上工作的人都会查看实际的源代码)。

4

2 回答 2

0

在使用 Play 2.1 构建的项目中,我将以下设置添加到我的 sbt 构建文件中

...settings(sources in doc in Compile := List())

这完全删除了文档创建。

于 2014-08-20T15:27:47.520 回答
0

对于较新版本的 Play(我目前使用的是 2.8.1),您必须将这些设置添加到项目中sbt(或每个子项目):

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

(这是 sbt 1 的新语法。)

于 2020-03-30T19:11:25.473 回答