scalafx-utils/project/Publish.scala

46 lines
1.1 KiB
Scala
Raw Normal View History

2016-09-25 04:06:36 +00:00
import sbt._
import Keys._
object Publish {
import Resolvers._
import Helpers._
val sonaCreds = (
for {
user <- getProp("SONATYPE_USER")
pass <- getProp("SONATYPE_PASS")
} yield {
credentials +=
Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
user, pass)
}
).toSeq
val settings = sonaCreds ++ Seq (
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
publishArtifact in Test := false,
publishTo := {
if (version.value.trim endsWith "SNAPSHOT")
Some(sonatypeSnaps)
else
Some(sonatypeStaging)
},
pomExtra := BasicSettings.developerInfo
)
/** Use this if you don't want to publish a certain module.
* (SBT's release plugin doesn't handle this well.)
*/
val falseSettings = settings ++ Seq (
publishArtifact in Compile := false,
publishArtifact in Test := false,
publishTo := Some(Resolver.file("phony-repo", file("target/repo")))
)
}