mirror of https://github.com/sbt/sbt.git
[scripted] Session update without reload
This commit is contained in:
parent
8bfab5313e
commit
083eb38bd2
|
|
@ -0,0 +1,10 @@
|
|||
name := "projectName"
|
||||
|
||||
k1 := {
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
k2 := {
|
||||
println("This is k2")
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
name := "projectName"
|
||||
|
||||
k1 := {}
|
||||
|
||||
k2 := {
|
||||
println("This is k2")
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
|
||||
object build extends Build {
|
||||
lazy val k1 = taskKey[Unit]("")
|
||||
lazy val k2 = taskKey[Unit]("")
|
||||
|
||||
val UpdateK1 = Command.command("UpdateK1") { st: State =>
|
||||
val ex = Project extract st
|
||||
import ex._
|
||||
val session2 = BuiltinCommands.setThis(st, ex, Seq(k1 := {}), """k1 := {
|
||||
|//
|
||||
|//
|
||||
|}""".stripMargin).session
|
||||
val st1 = BuiltinCommands.reapply(session2, structure, st)
|
||||
// SessionSettings.writeSettings(ex.currentRef, session2, ex.session.original, ex.structure)
|
||||
SessionSettings.saveAllSettings(st1)
|
||||
}
|
||||
|
||||
lazy val root = Project("root", file(".")) settings(
|
||||
commands += UpdateK1
|
||||
)
|
||||
}
|
||||
|
||||
// vim: set ts=4 sw=4 et:
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
> UpdateK1
|
||||
$ must-mirror build.sbt build.check.1
|
||||
> UpdateK1
|
||||
$ must-mirror build.sbt build.check.1
|
||||
Loading…
Reference in New Issue