From 5377b537b1ab154441aed8b903be402a65324f9a Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Mon, 18 Feb 2019 11:31:37 +0100 Subject: [PATCH] Allow to disable publishing Javadoc with -Dpublish.javadoc Useful when testing the plugin locally --- project/Settings.scala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/project/Settings.scala b/project/Settings.scala index 9b98c6db4..a06e76ca3 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -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 ++