Allow to disable publishing Javadoc with -Dpublish.javadoc

Useful when testing the plugin locally
This commit is contained in:
Alexandre Archambault 2019-02-18 11:31:37 +01:00
parent 3eb210eb1b
commit 5377b537b1
1 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,6 @@
import java.util.Locale
import sbt._
import sbt.Keys._
import sbt.ScriptedPlugin.autoImport.{scriptedBufferLog, scriptedLaunchOpts}
@ -22,7 +24,16 @@ object Settings {
"-language:higherKinds",
"-language:implicitConversions"
)
)
) ++ {
val prop = sys.props.getOrElse("publish.javadoc", "").toLowerCase(Locale.ROOT)
if (prop == "0" || prop == "false")
Seq(
sources in (Compile, doc) := Seq.empty,
publishArtifact in (Compile, packageDoc) := false
)
else
Nil
}
lazy val plugin =
shared ++