Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
Created October 27, 2009 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanjswift/219395 to your computer and use it in GitHub Desktop.
Save bryanjswift/219395 to your computer and use it in GitHub Desktop.
import sbt._
class SbtPluginProject(info:ProjectInfo) extends PluginProject(info) {
// *-- Copy of ResolverPlugin contents because a project can't depend on itself
val resolverPath = propertyOptional[String](".resolver")
private def sbtPublishResolver = {
import java.io.FileInputStream
import java.util.Properties
val props = new Properties() { def apply(key:String) = this.getProperty(key) }
props.load(new FileInputStream(resolverPath.value))
props("resolver.type") match {
case "sftp" => Resolver.sftp(props("resolver.name"),props("resolver.host"),props("resolver.port").toInt,props("resolver.path"))
case "ssh" => Resolver.ssh(props("resolver.name"),props("resolver.host"),props("resolver.port").toInt,props("resolver.path"))
}
}
val publishTo = sbtPublishResolver
// *-- End Copy of ResolverPlugin contents
// Publish settings
override def managedStyle = ManagedStyle.Maven
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment