Skip to content

Commit 8522a24

Browse files
authored
Merge pull request #97 from sbt/wip/publishing
Fix the build so it gets published on Sonatype
2 parents 4f985d3 + 8f92f87 commit 8522a24

File tree

1 file changed

+37
-28
lines changed

1 file changed

+37
-28
lines changed

build.sbt

+37-28
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
1-
lazy val commonSettings = inThisBuild(
2-
List(
3-
organization := "com.github.sbt",
4-
homepage := Some(url("https://github.com/sbt/sbt-unidoc")),
5-
licenses := Seq("Apache License v2" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
6-
developers := List(
7-
Developer(
8-
"eed3si9n",
9-
"Eugene Yokota",
10-
"@eed3si9n",
11-
url("https://github.com/eed3si9n")
12-
)
13-
)
14-
)
15-
) ++ Seq(
16-
scalaVersion := "2.12.15"
17-
)
1+
ThisBuild / scalaVersion := "2.12.15"
2+
ThisBuild / version := {
3+
val orig = (ThisBuild / version).value
4+
if (orig.endsWith("-SNAPSHOT")) "0.5.0-SNAPSHOT"
5+
else orig
6+
}
187

19-
lazy val root = (project in file(".")).
20-
enablePlugins(SbtPlugin).
21-
settings(commonSettings: _*).
22-
settings(
8+
lazy val root = (project in file("."))
9+
.enablePlugins(SbtPlugin)
10+
.settings(
2311
name := "sbt-unidoc",
24-
description := "sbt plugin to create a unified API document across projects",
25-
scalacOptions := Seq("-deprecation", "-unchecked"),
26-
Compile / packageBin / publishArtifact := true,
27-
Test / packageBin / publishArtifact := false,
28-
Compile / packageDoc / publishArtifact := false,
29-
Compile / packageSrc / publishArtifact := true,
3012
scriptedLaunchOpts ++= Seq("-Xmx1024M", "-XX:MaxPermSize=256M", "-Dplugin.version=" + version.value),
31-
scriptedBufferLog := false
13+
scriptedBufferLog := false,
14+
// sbt-unidoc requires sbt 1.5.0 and up
15+
pluginCrossBuild / sbtVersion := "1.5.0",
16+
)
17+
18+
Global / onChangedBuildSource := ReloadOnSourceChanges
19+
ThisBuild / description := "sbt plugin to create a unified API document across projects"
20+
ThisBuild / organization := "com.github.sbt"
21+
ThisBuild / homepage := Some(url("https://github.com/sbt/sbt-unidoc"))
22+
ThisBuild / Compile / scalacOptions := Seq("-feature", "-deprecation", "-Xlint")
23+
ThisBuild / licenses := List("Apache License v2" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
24+
ThisBuild / developers := List(
25+
Developer(
26+
"eed3si9n",
27+
"Eugene Yokota",
28+
"@eed3si9n",
29+
url("https://github.com/eed3si9n")
3230
)
31+
)
32+
ThisBuild / pomIncludeRepository := { _ =>
33+
false
34+
}
35+
ThisBuild / publishTo := {
36+
val nexus = "https://oss.sonatype.org/"
37+
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
38+
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
39+
}
40+
ThisBuild / publishMavenStyle := true
41+
ThisBuild / dynverSonatypeSnapshots := true

0 commit comments

Comments
 (0)