diff --git a/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala b/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala index ecfe1d0d..a57ae111 100644 --- a/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala +++ b/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala @@ -35,17 +35,19 @@ object TypelevelSonatypePlugin extends AutoPlugin { import autoImport._ override def buildSettings = - Seq(tlSonatypeUseLegacyHost := true) ++ - addCommandAlias( - "tlRelease", - mkCommand( - List( - "reload", - "project /", - "+mimaReportBinaryIssues", - "+publish", - "tlSonatypeBundleReleaseIfRelevant")) - ) + Seq( + tlSonatypeUseLegacyHost := true, + autoAPIMappings := true + ) ++ addCommandAlias( + "tlRelease", + mkCommand( + List( + "reload", + "project /", + "+mimaReportBinaryIssues", + "+publish", + "tlSonatypeBundleReleaseIfRelevant")) + ) override def projectSettings = Seq( publishMavenStyle := true, // we want to do this unconditionally, even if publishing a plugin @@ -57,6 +59,17 @@ object TypelevelSonatypePlugin extends AutoPlugin { "oss.sonatype.org" else "s01.oss.sonatype.org" + }, + apiURL := { + val javadocio = CrossVersion( + crossVersion.value, + scalaVersion.value, + scalaBinaryVersion.value + ).map { cross => + url( + s"https://www.javadoc.io/doc/${organization.value}/${cross(moduleName.value)}/${version.value}/") + } + apiURL.value.orElse(javadocio) } )