show タスクキー
というのは、コンソール上で簡易的に実行結果見るためのものなので、そのデータをもとになにかする場合は使うべきでない。update
タスクの戻り値型を確認- https://github.com/sbt/sbt/blob/v0.13.2-M2/main/src/main/scala/sbt/Keys.scala#L245
- 型がUnitじゃなく、
UpdateReport
という型を返してるので、そのクラスを探して、欲しいデータが取れるか考える - https://github.com/sbt/sbt/blob/v0.13.2-M2/ivy/src/main/scala/sbt/UpdateReport.scala#L16
- とりあえず、適当に作った、単にprintするだけのTaskがこれ
- こんな感じで、他のタスクに依存する新しいTaskを定義していく
- もし、updateのTaskから自分が欲しい情報が取れないなら、updateが依存してるタスクや内部的なメソッド(それでもダメそうなら別のKey)を探す
- 最終的にちゃんとしたsbt pluginまでつくるには、細かい点色々作法があるので、覚えること少し多いかも(とりあえずつくるだけならできるが)
Last active
August 29, 2015 13:56
-
-
Save xuwei-k/9325367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val printUpdatedAllModules = TaskKey[Unit]("printUpdatedAllModules") | |
printUpdatedAllModules := { | |
update.value.allModules foreach println | |
} | |
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.2.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.scala-lang:scala-library:2.10.3:compile () | |
com.typesafe.play:play-json_2.10:2.2.2:compile | |
com.typesafe.play:play-iteratees_2.10:2.2.2:compile | |
org.scala-stm:scala-stm_2.10:0.7:compile | |
com.typesafe:config:1.0.2:compile | |
com.typesafe.play:play-functional_2.10:2.2.2:compile | |
com.typesafe.play:play-datacommons_2.10:2.2.2:compile | |
joda-time:joda-time:2.2:compile | |
org.joda:joda-convert:1.3.1:compile | |
com.fasterxml.jackson.core:jackson-annotations:2.2.2:compile | |
com.fasterxml.jackson.core:jackson-core:2.2.2:compile | |
com.fasterxml.jackson.core:jackson-databind:2.2.2:compile | |
org.scala-lang:scala-reflect:2.10.3:compile () | |
org.scala-lang:scala-library:2.10.3:runtime () | |
com.typesafe.play:play-json_2.10:2.2.2:runtime | |
com.typesafe.play:play-iteratees_2.10:2.2.2:runtime | |
org.scala-stm:scala-stm_2.10:0.7:runtime | |
com.typesafe:config:1.0.2:runtime | |
com.typesafe.play:play-functional_2.10:2.2.2:runtime | |
com.typesafe.play:play-datacommons_2.10:2.2.2:runtime | |
joda-time:joda-time:2.2:runtime | |
org.joda:joda-convert:1.3.1:runtime | |
com.fasterxml.jackson.core:jackson-annotations:2.2.2:runtime | |
com.fasterxml.jackson.core:jackson-core:2.2.2:runtime | |
com.fasterxml.jackson.core:jackson-databind:2.2.2:runtime | |
org.scala-lang:scala-reflect:2.10.3:runtime () | |
org.scala-lang:scala-library:2.10.3:test () | |
com.typesafe.play:play-json_2.10:2.2.2:test | |
com.typesafe.play:play-iteratees_2.10:2.2.2:test | |
org.scala-stm:scala-stm_2.10:0.7:test | |
com.typesafe.play:play-iteratees_2.10:2.2.2:compile-internal | |
org.scala-stm:scala-stm_2.10:0.7:compile-internal | |
com.typesafe:config:1.0.2:compile-internal | |
com.typesafe.play:play-functional_2.10:2.2.2:compile-internal | |
com.typesafe.play:play-datacommons_2.10:2.2.2:compile-internal | |
joda-time:joda-time:2.2:compile-internal | |
com.typesafe.play:play-datacommons_2.10:2.2.2:compile-internal | |
joda-time:joda-time:2.2:compile-internal | |
com.typesafe.play:play-datacommons_2.10:2.2.2:compile-internal | |
joda-time:joda-time:2.2:compile-internal | |
org.joda:joda-convert:1.3.1:compile-internal | |
com.fasterxml.jackson.core:jackson-annotations:2.2.2:compile-internal | |
com.fasterxml.jackson.core:jackson-core:2.2.2:compile-internal | |
com.fasterxml.jackson.core:jackson-databind:2.2.2:compile-internal | |
org.scala-lang:scala-reflect:2.10.3:compile-internal () | |
org.scala-lang:scala-library:2.10.3:runtime-internal () | |
com.typesafe.play:play-json_2.10:2.2.2:runtime-internal | |
com.typesafe.play:play-iteratees_2.10:2.2.2:runtime-internal | |
org.scala-stm:scala-stm_2.10:0.7:runtime-internal | |
com.typesafe:config:1.0.2:runtime-internal | |
com.typesafe.play:play-functional_2.10:2.2.2:runtime-internal | |
com.typesafe.play:play-datacommons_2.10:2.2.2:runtime-internal | |
joda-time:joda-time:2.2:runtime-internal | |
org.joda:joda-convert:1.3.1:runtime-internal | |
com.fasterxml.jackson.core:jackson-annotations:2.2.2:runtime-internal | |
com.fasterxml.jackson.core:jackson-core:2.2.2:runtime-internal | |
com.fasterxml.jackson.core:jackson-databind:2.2.2:runtime-internal | |
org.scala-lang:scala-reflect:2.10.3:runtime-internal () | |
org.scala-lang:scala-library:2.10.3:test-internal () | |
com.typesafe.play:play-json_2.10:2.2.2:test-internal | |
com.typesafe.play:play-iteratees_2.10:2.2.2:test-internal | |
org.scala-stm:scala-stm_2.10:0.7:test-internal | |
com.typesafe:config:1.0.2:test-internal | |
com.typesafe.play:play-functional_2.10:2.2.2:test-internal | |
com.typesafe.play:play-datacommons_2.10:2.2.2:test-internal | |
joda-time:joda-time:2.2:test-internal | |
org.joda:joda-convert:1.3.1:test-internal | |
com.fasterxml.jackson.core:jackson-annotations:2.2.2:test-internal | |
com.fasterxml.jackson.core:jackson-core:2.2.2:test-internal | |
com.fasterxml.jackson.core:jackson-databind:2.2.2:test-internal | |
org.scala-lang:scala-reflect:2.10.3:test-internal () | |
org.scala-lang:scala-compiler:2.10.3:scala-tool | |
org.scala-lang:scala-library:2.10.3:scala-tool () | |
org.scala-lang:scala-reflect:2.10.3:scala-tool () | |
org.scala-lang:jline:2.10.3:scala-toolorg.fusesource.jansi:jansi:1.4:scala-tool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment