SBT has macro , sbt.std.KeyMacro.taskKeyImpl , which takes a String description and sbt.std.KeyMacro.taskKeyImpl task name from the sbt.std.KeyMacro.taskKeyImpl name val.
This macro is aliased to taskKey[T] in the sbt package object.
Therefore, when you call taskKey[Unit]("SimpleTask") , which expands to a macro that finds val printMessage , and uses this to print the name of the task key.
source share