From 8b90f566b812ac5fe542fb1f80ac4d58654c9723 Mon Sep 17 00:00:00 2001 From: Daniel Spiewak Date: Sat, 30 May 2020 09:13:06 -0600 Subject: [PATCH] Restructured githubPublishTo to avoid cyclic reference --- .../scala/sbtghpackages/GitHubPackagesPlugin.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/scala/sbtghpackages/GitHubPackagesPlugin.scala b/src/main/scala/sbtghpackages/GitHubPackagesPlugin.scala index 5ea995f..ad2fdc7 100644 --- a/src/main/scala/sbtghpackages/GitHubPackagesPlugin.scala +++ b/src/main/scala/sbtghpackages/GitHubPackagesPlugin.scala @@ -55,9 +55,7 @@ object GitHubPackagesPlugin extends AutoPlugin { }) val packagePublishSettings = Seq( - publishTo := githubPublishTo.value, githubPublishTo := { - val suppress = githubSuppressPublicationWarning.value val log = streams.value.log val ms = publishMavenStyle.value val back = for { @@ -71,7 +69,14 @@ object GitHubPackagesPlugin extends AutoPlugin { } } - back orElse { + back + }, + + publishTo := { + val suppress = githubSuppressPublicationWarning.value + val log = streams.value.log + + githubPublishTo.value orElse { GitHubPackagesPlugin synchronized { if (!alreadyWarned && !suppress) { log.warn("undefined keys `githubOwner` and `githubRepository`")