Skip to content

Instantly share code, notes, and snippets.

@seraphr seraphr/build.sbt
Created Feb 7, 2019

Embed
What would you like to do?
sbt all command
val dockerPublish = taskKey[Unit]("ダミーのタスク。本来sbt-native-packagerのやつ")
lazy val commonSettings = Def.settings(
dockerPublish := {
import java.time.LocalTime
println(s"${LocalTime.now()} ${name.value} のpublish開始")
// 並列で実行されるのがわかりやすいように、途中sleepする
Thread.sleep(3000)
println(s"${LocalTime.now()} ${name.value} のpublish終了")
}
)
lazy val a = project
.settings(
commonSettings
)
lazy val b = project
.settings(
commonSettings
)
lazy val c = project
.settings(
commonSettings
)
> all a/dockerPublish b/dockerPublish
16:42:10.772 a のpublish開始
16:42:10.772 b のpublish開始
16:42:13.774 a のpublish終了
16:42:13.775 b のpublish終了
[success] Total time: 3 s, completed 2019/02/07 16:42:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.