Skip to content

Commit

Permalink
Rearrange publish settings
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown committed Jan 2, 2020
1 parent 1e0131b commit 9c4ba24
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import sbt.Keys.{crossScalaVersions, developers, organizationHomepage, scalacOpt

// has to be set for all modules to allow 'sbt release'
// [error] Repository for publishing is not specified.
publishTo in ThisBuild := Some(
if (isSnapshot.value)
"snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
else
"releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")

releaseCrossBuild in ThisBuild := true

/* Define the different sbt projects of sangria
*/
Expand All @@ -18,16 +11,15 @@ lazy val root = project
.in(file("."))
.withId("sangria-root")
.aggregate(core, benchmarks)
.settings(inThisBuild(projectInfo))
.settings(
inThisBuild(projectInfo ++ scalaSettings ++ shellSettings)
)
.settings(
noPublishSettings
scalaSettings ++ shellSettings ++ publishSettings ++ noPublishSettings
)

lazy val core = project
.in(file("modules/core"))
.withId("sangria-core")
.settings(scalaSettings ++ shellSettings ++ publishSettings)
.settings(
name := "sangria",
description := "Scala GraphQL implementation",
Expand Down Expand Up @@ -62,22 +54,16 @@ lazy val core = project
// CATs
"net.jcazevedo" %% "moultingyaml" % "0.4.1" % Test,
"io.github.classgraph" % "classgraph" % "4.8.59" % Test
),

// Publishing
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := (_ => false)
)
)

lazy val benchmarks = project
.in(file("modules/benchmarks"))
.withId("sangria-benchmarks")
.dependsOn(core)
.enablePlugins(JmhPlugin)
.settings(scalaSettings ++ shellSettings ++ noPublishSettings)
.settings(
noPublishSettings,
name := "sangria-benchmarks",
description := "Benchmarks of Sangria functionality",
)
Expand Down Expand Up @@ -120,6 +106,20 @@ lazy val shellSettings = Seq(
}
)

lazy val publishSettings = Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseVcsSign := true,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := (_ => false),
publishTo := Some(
if (isSnapshot.value)
"snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
else
"releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
)

lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.4
sbt.version=1.3.6

0 comments on commit 9c4ba24

Please sign in to comment.