Skip to content

Instantly share code, notes, and snippets.

@seraphr
Created February 7, 2019 08:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seraphr/741ee0316381a5a35c6d488222217801 to your computer and use it in GitHub Desktop.
Save seraphr/741ee0316381a5a35c6d488222217801 to your computer and use it in GitHub Desktop.
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