Skip to content

Commit

Permalink
Propagating changes to "sonatypePublishTo" and "publishTo" to all (#77)
Browse files Browse the repository at this point in the history
aggregated projects.
  • Loading branch information
atooni authored and xerial committed Jan 11, 2019
1 parent 583db13 commit 68b3fc8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/scala/xerial/sbt/Sonatype.scala
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,19 @@ object Sonatype extends AutoPlugin {
val repo = rest.createStage(profileDescription)
val path = "/staging/deployByRepositoryId/" + repo.repositoryId
val extracted = Project.extract(state)
val next = extracted.append(Seq(sonatypeStagingRepositoryProfile := repo), state)

// accumulate changes for settings for current project and all aggregates
val newSettings : Seq[Def.Setting[_]] = extracted.currentProject.referenced.flatMap { ref =>
Seq(
ref / sonatypeStagingRepositoryProfile := repo,
ref / publishTo := Some(sonatypeDefaultResolver.value)
)
} ++ Seq(
sonatypeStagingRepositoryProfile := repo,
publishTo := Some(sonatypeDefaultResolver.value)
)

val next = extracted.appendWithSession(newSettings, state)
next
}

Expand Down

0 comments on commit 68b3fc8

Please sign in to comment.