pekko/project/Publish.scala

62 lines
1.9 KiB
Scala
Raw Normal View History

/*
2021-01-08 17:55:38 +01:00
* Copyright (C) 2009-2021 Lightbend Inc. <https://www.lightbend.com>
*/
2011-09-23 10:21:03 +02:00
package akka
2011-07-08 18:01:19 +12:00
import sbt._
2011-12-09 21:55:49 +13:00
import sbt.Keys._
2011-07-08 18:01:19 +12:00
import java.io.File
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncHost
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
2011-07-08 18:01:19 +12:00
object Publish extends AutoPlugin {
2011-07-08 18:01:19 +12:00
val defaultPublishTo = settingKey[File]("Default publish directory")
2011-12-09 21:55:49 +13:00
override def trigger = allRequirements
override lazy val projectSettings = Seq(
publishTo := Some(akkaPublishTo.value),
publishRsyncHost := "akkarepo@gustav.akka.io",
credentials ++= akkaCredentials,
organizationName := "Lightbend Inc.",
organizationHomepage := Some(url("https://www.lightbend.com")),
sonatypeProfileName := "com.typesafe",
startYear := Some(2009),
developers := List(
Developer(
"akka-contributors",
"Akka Contributors",
"akka.official@gmail.com",
url("https://github.com/akka/akka/graphs/contributors"))),
2012-03-30 09:59:33 -04:00
publishMavenStyle := true,
pomIncludeRepository := { x =>
false
},
defaultPublishTo := target.value / "repository")
2011-07-08 18:01:19 +12:00
private def akkaPublishTo = Def.setting {
val key = new java.io.File(
2020-05-25 14:23:43 +02:00
Option(System.getProperty("akka.gustav.key"))
.getOrElse(System.getProperty("user.home") + "/.ssh/id_rsa_gustav.pem"))
if (isSnapshot.value)
Resolver.sftp("Akka snapshots", "gustav.akka.io", "/home/akkarepo/www/snapshots").as("akkarepo", key)
else
Opts.resolver.sonatypeStaging
}
private def akkaCredentials: Seq[Credentials] =
Option(System.getProperty("akka.publish.credentials")).map(f => Credentials(new File(f))).toSeq
}
/**
* For projects that are not to be published.
*/
object NoPublish extends AutoPlugin {
override def requires = plugins.JvmPlugin
2011-07-08 18:01:19 +12:00
override def projectSettings =
2021-08-17 19:04:27 +12:00
Seq(publish / skip := true, Compile / doc / sources := Seq.empty)
2011-07-08 18:01:19 +12:00
}