#2522 - Fixing so that an explicitly system-propertied target repository is used for the nightly sbt plugin.

This commit is contained in:
Viktor Klang 2012-09-18 15:49:02 +02:00
parent 8420c35de0
commit 0d91c33fcf
2 changed files with 14 additions and 14 deletions

View file

@ -275,12 +275,7 @@ object AkkaBuild extends Build {
settings = defaultSettings ++ Seq(
sbtPlugin := true,
publishMavenStyle := false, // SBT Plugins should be published as Ivy
publishTo <<= (version) { version: String =>
val scalasbt = "http://scalasbt.artifactoryonline.com/scalasbt/"
val (name, u) = if (version.contains("-SNAPSHOT")) ("sbt-plugin-snapshots", scalasbt+"sbt-plugin-snapshots")
else ("sbt-plugin-releases", scalasbt+"sbt-plugin-releases")
Some(Resolver.url(name, url(u))(Resolver.ivyStylePatterns))
},
publishTo <<= Publish.akkaPluginPublishTo,
scalacOptions in Compile := Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"),
scalaVersion := "2.9.1",
scalaBinaryVersion <<= scalaVersion

View file

@ -74,6 +74,15 @@ object Publish {
}
}
def akkaPluginPublishTo: Initialize[Option[Resolver]] = {
(version) { version: String =>
akkaPublishRepository orElse {
val name = if (version.contains("-SNAPSHOT")) "sbt-plugin-snapshots" else "sbt-plugin-releases"
Some(Resolver.url(name, url("http://scalasbt.artifactoryonline.com/scalasbt/" + name))(Resolver.ivyStylePatterns))
}
}
}
def sonatypeRepo(version: String): Option[Resolver] = {
Option(sys.props("publish.maven.central")) filter (_.toLowerCase == "true") map { _ =>
val nexus = "https://oss.sonatype.org/"
@ -83,15 +92,11 @@ object Publish {
}
def akkaPublishRepository: Option[Resolver] = {
val property = Option(System.getProperty("akka.publish.repository"))
property map { "Akka Publish Repository" at _ }
}
def akkaPublishRepository: Option[Resolver] =
Option(System.getProperty("akka.publish.repository", null)) map { "Akka Publish Repository" at _ }
def akkaCredentials: Seq[Credentials] = {
val property = Option(System.getProperty("akka.publish.credentials"))
property map (f => Credentials(new File(f))) toSeq
}
def akkaCredentials: Seq[Credentials] =
Option(System.getProperty("akka.publish.credentials", null)) map (f => Credentials(new File(f))) toSeq
// timestamped versions