mirror of https://github.com/sbt/sbt.git
move top-level settingKey,taskKey,inputKey objects to Def and package object
avoids class file name collision on case insensitive filesystem
This commit is contained in:
parent
b7250bb528
commit
cdd2e72cdf
|
|
@ -64,6 +64,11 @@ object Def extends Init[Scope] with TaskMacroExtra
|
|||
// be used in the inputTask macro as an input with an ultimate result of type T
|
||||
implicit def parserInitToInput[T](p: Initialize[Parser[T]]): InitParserInput[T] = ???
|
||||
implicit def parserInitStateToInput[T](p: Initialize[State => Parser[T]]): StateParserInput[T] = ???
|
||||
|
||||
import language.experimental.macros
|
||||
def settingKey[T](description: String): SettingKey[T] = macro std.KeyMacro.settingKeyImpl[T]
|
||||
def taskKey[T](description: String): TaskKey[T] = macro std.KeyMacro.taskKeyImpl[T]
|
||||
def inputKey[T](description: String): TaskKey[T] = macro std.KeyMacro.taskKeyImpl[T]
|
||||
}
|
||||
// these need to be mixed into the sbt package object because the target doesn't involve Initialize or anything in Def
|
||||
trait TaskMacroExtra
|
||||
|
|
|
|||
|
|
@ -500,16 +500,3 @@ object SettingKey
|
|||
|
||||
def local[T: Manifest]: SettingKey[T] = apply[T](AttributeKey.local[T])
|
||||
}
|
||||
|
||||
object settingKey
|
||||
{
|
||||
def apply[T](description: String): SettingKey[T] = macro std.KeyMacro.settingKeyImpl[T]
|
||||
}
|
||||
object taskKey
|
||||
{
|
||||
def apply[T](description: String): TaskKey[T] = macro std.KeyMacro.taskKeyImpl[T]
|
||||
}
|
||||
object inputKey
|
||||
{
|
||||
def apply[T](description: String): TaskKey[T] = macro std.KeyMacro.taskKeyImpl[T]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ package std
|
|||
object Assign
|
||||
{
|
||||
import java.io.File
|
||||
import Def.{inputKey,settingKey,taskKey}
|
||||
import Def.{Initialize,macroValueT,parserToInput}
|
||||
// import UseTask.{x,y,z,a,set,plain}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,4 +50,9 @@ package object sbt extends sbt.std.TaskExtra with sbt.Types with sbt.ProcessExtr
|
|||
// final val System = C.System
|
||||
final val Optional = C.Optional
|
||||
def config(s: String): Configuration = Configurations.config(s)
|
||||
|
||||
import language.experimental.macros
|
||||
def settingKey[T](description: String): SettingKey[T] = macro std.KeyMacro.settingKeyImpl[T]
|
||||
def taskKey[T](description: String): TaskKey[T] = macro std.KeyMacro.taskKeyImpl[T]
|
||||
def inputKey[T](description: String): TaskKey[T] = macro std.KeyMacro.taskKeyImpl[T]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue