3

I'd like to create a task that publishes to a specific directory. I tried this:

import sbt._
import Keys._

object SampleStuff extends Plugin {
  lazy val someCmd = taskKey[Unit]("some command")
  val someCmdValue = publishTo in someCmd := Some(Resolver.file("file",  new File( "path/to/my/maven-repo/releases")))
  override def settings = Seq(
    someCmdValue,
    someCmd := { println(s"publishing to the place; ${publish.value}") }
  )
}

I thought that the publishTo in someCmd would set the value of publishTo while someCmd was being executed, but that's not what happens. What am I missing?

James Moore
  • 8,636
  • 5
  • 71
  • 90

0 Answers0