From bbd6b07dac16acff84ebd4d75cc44738d24f3c81 Mon Sep 17 00:00:00 2001 From: Brandon Stilson Date: Sat, 2 Dec 2023 12:20:10 -0800 Subject: [PATCH] respect publishArtifact := false --- .../src/main/scala/codeartifact/CodeArtifactPlugin.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala b/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala index 77bf616..9d0454c 100644 --- a/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala +++ b/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala @@ -60,10 +60,11 @@ object CodeArtifactPlugin extends AutoPlugin { // See: https://www.scala-sbt.org/1.x/docs/Howto-Dynamic-Task.html private def dynamicallyPublish: Def.Initialize[Task[Unit]] = Def.taskDyn { val shouldSkip = (publish / skip).value + val publishEnabled = (publish / publishArtifact).value val logger = streams.value.log val ref = thisProjectRef.value - if (shouldSkip) Def.task { + if (shouldSkip || !publishEnabled) Def.task { logger.debug(s"Skipping publish for ${ref.project}") } else publish0