mirror of https://github.com/sbt/sbt.git
Scala 2.10.0-M7
This commit is contained in:
parent
b453af7c45
commit
2c7e9cd893
|
|
@ -122,7 +122,7 @@ object Act
|
|||
{
|
||||
case Omitted => None +: defaultConfigurations(proj, index, defaultConfigs).flatMap(nonEmptyConfig(index, proj))
|
||||
case ParsedGlobal => None :: Nil
|
||||
case pv: ParsedValue[String] => Some(pv.value) :: Nil
|
||||
case pv: ParsedValue[x] => Some(pv.value) :: Nil
|
||||
}
|
||||
def defaultConfigurations(proj: Option[ResolvedReference], index: KeyIndex, defaultConfigs: Option[ResolvedReference] => Seq[String]): Seq[String] =
|
||||
if(index exists proj) defaultConfigs(proj) else Nil
|
||||
|
|
@ -217,7 +217,7 @@ object Act
|
|||
{
|
||||
case Omitted => Some(current)
|
||||
case ParsedGlobal => None
|
||||
case pv: ParsedValue[ResolvedReference] => Some(pv.value)
|
||||
case pv: ParsedValue[rr] => Some(pv.value)
|
||||
}
|
||||
|
||||
def actParser(s: State): Parser[() => State] = requireSession(s, actParser0(s))
|
||||
|
|
|
|||
|
|
@ -189,7 +189,8 @@ object EvaluateTask
|
|||
}
|
||||
type AnyCyclic = Execute[Task]#CyclicException[_]
|
||||
def convertCyclicInc: Incomplete => Incomplete = {
|
||||
case in @ Incomplete(_, _, _, _, Some(c: AnyCyclic)) => in.copy(directCause = Some(new RuntimeException(convertCyclic(c))) )
|
||||
case in @ Incomplete(_, _, _, _, Some(c: AnyCyclic)) =>
|
||||
in.copy(directCause = Some(new RuntimeException(convertCyclic(c))) )
|
||||
case i => i
|
||||
}
|
||||
def convertCyclic(c: AnyCyclic): String =
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ object Resolvers
|
|||
try {
|
||||
f
|
||||
} catch {
|
||||
case e =>
|
||||
case e: Throwable =>
|
||||
IO.delete(file)
|
||||
throw e
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ object InitializeInstance extends MonadInstance
|
|||
}
|
||||
object InitializeConvert extends Convert
|
||||
{
|
||||
def apply[T: c.AbsTypeTag](c: reflect.makro.Context)(in: c.Tree): c.Tree =
|
||||
def apply[T: c.AbsTypeTag](c: reflect.macros.Context)(in: c.Tree): c.Tree =
|
||||
{
|
||||
val u = appmacro.ContextUtil[c.type](c)
|
||||
if(in.tpe <:< u.atypeOf[Initialize[Task[T]]] || in.tpe <:< u.atypeOf[Task[T]])
|
||||
|
|
@ -32,7 +32,7 @@ object InitializeConvert extends Convert
|
|||
|
||||
import language.experimental.macros
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import reflect.macros._
|
||||
|
||||
object SettingMacro
|
||||
{
|
||||
|
|
|
|||
|
|
@ -140,17 +140,17 @@ object Scoped
|
|||
{
|
||||
protected def onTask[T](f: Task[S] => Task[T]): Initialize[Task[T]] = i apply f
|
||||
|
||||
def dependsOn(tasks: AnyInitTask*): Initialize[Task[S]] = (i, Initialize.joinAny(tasks)) { (thisTask, deps) => thisTask.dependsOn(deps : _*) }
|
||||
def dependsOn(tasks: AnyInitTask*): Initialize[Task[S]] = (i, Initialize.joinAny[Task](tasks)) { (thisTask, deps) => thisTask.dependsOn(deps : _*) }
|
||||
|
||||
def triggeredBy(tasks: AnyInitTask*): Initialize[Task[S]] = nonLocal(tasks, Def.triggeredBy)
|
||||
def runBefore(tasks: AnyInitTask*): Initialize[Task[S]] = nonLocal(tasks, Def.runBefore)
|
||||
private[this] def nonLocal(tasks: Seq[AnyInitTask], key: AttributeKey[Seq[Task[_]]]): Initialize[Task[S]] =
|
||||
(Initialize.joinAny(tasks), i) { (ts, i) => i.copy(info = i.info.set(key, ts)) }
|
||||
(Initialize.joinAny[Task](tasks), i) { (ts, i) => i.copy(info = i.info.set(key, ts)) }
|
||||
}
|
||||
final class RichInitializeInputTask[S](i: Initialize[InputTask[S]]) extends RichInitTaskBase[S,InputTask]
|
||||
{
|
||||
protected def onTask[T](f: Task[S] => Task[T]): Initialize[InputTask[T]] = i(_ mapTask f)
|
||||
def dependsOn(tasks: AnyInitTask*): Initialize[InputTask[S]] = (i, Initialize.joinAny(tasks)) { (thisTask, deps) => thisTask.mapTask(_.dependsOn(deps : _*)) }
|
||||
def dependsOn(tasks: AnyInitTask*): Initialize[InputTask[S]] = (i, Initialize.joinAny[Task](tasks)) { (thisTask, deps) => thisTask.mapTask(_.dependsOn(deps : _*)) }
|
||||
}
|
||||
|
||||
sealed abstract class RichInitTaskBase[S, R[_]]
|
||||
|
|
@ -184,7 +184,7 @@ object Scoped
|
|||
implicit def richAnyTaskSeq(in: Seq[AnyInitTask]): RichAnyTaskSeq = new RichAnyTaskSeq(in)
|
||||
final class RichAnyTaskSeq(keys: Seq[AnyInitTask])
|
||||
{
|
||||
def dependOn: Initialize[Task[Unit]] = Initialize.joinAny(keys).apply(deps => nop.dependsOn(deps : _*) )
|
||||
def dependOn: Initialize[Task[Unit]] = Initialize.joinAny[Task](keys).apply(deps => nop.dependsOn(deps : _*) )
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package sbt
|
||||
package std
|
||||
|
||||
|
|
@ -9,7 +8,7 @@ package std
|
|||
|
||||
import language.experimental.macros
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import reflect.macros._
|
||||
|
||||
/** Instance for the monad/applicative functor for plain Tasks. */
|
||||
object TaskInstance extends MonadInstance
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ object Sbt extends Build
|
|||
organization := "org.scala-sbt",
|
||||
version := "0.13.0-SNAPSHOT",
|
||||
publishArtifact in packageDoc := false,
|
||||
scalaVersion := "2.10.0-M6",
|
||||
scalaVersion := "2.10.0-M7",
|
||||
publishMavenStyle := false,
|
||||
componentID := None,
|
||||
crossPaths := false,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package sbt
|
|||
package appmacro
|
||||
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import macros._
|
||||
import scala.tools.nsc.Global
|
||||
|
||||
object ContextUtil {
|
||||
|
|
@ -66,7 +66,7 @@ final class ContextUtil[C <: Context](val ctx: C)
|
|||
polyType(tvar :: Nil, refVar(tvar))
|
||||
}
|
||||
/** A Type that references the given type variable. */
|
||||
def refVar(variable: TypeSymbol): Type = variable.asTypeConstructor
|
||||
def refVar(variable: TypeSymbol): Type = variable.toTypeConstructor
|
||||
/** Constructs a new, synthetic type variable that is a type constructor. For example, in type Y[L[x]], L is such a type variable. */
|
||||
def newTCVariable(owner: Symbol): TypeSymbol =
|
||||
{
|
||||
|
|
@ -75,7 +75,7 @@ final class ContextUtil[C <: Context](val ctx: C)
|
|||
tc.setTypeSignature(PolyType(arg :: Nil, emptyTypeBounds))
|
||||
tc
|
||||
}
|
||||
def emptyTypeBounds: TypeBounds = TypeBounds(definitions.NothingClass.asType, definitions.AnyClass.asType)
|
||||
def emptyTypeBounds: TypeBounds = TypeBounds(definitions.NothingClass.toType, definitions.AnyClass.toType)
|
||||
|
||||
/** Returns the Symbol that references the statically accessible singleton `i`. */
|
||||
def singleton[T <: AnyRef with Singleton](i: T)(implicit it: ctx.TypeTag[i.type]): Symbol =
|
||||
|
|
@ -85,7 +85,12 @@ final class ContextUtil[C <: Context](val ctx: C)
|
|||
}
|
||||
|
||||
/** Returns the symbol for the non-private method named `name` for the class/module `obj`. */
|
||||
def method(obj: Symbol, name: String): Symbol = obj.typeSignature.nonPrivateMember(newTermName(name))
|
||||
def method(obj: Symbol, name: String): Symbol = {
|
||||
val global: Global = ctx.universe.asInstanceOf[Global]
|
||||
val ts: Type = obj.typeSignature
|
||||
val m: global.Symbol = ts.asInstanceOf[global.Type].nonPrivateMember(global.newTermName(name))
|
||||
m.asInstanceOf[Symbol]
|
||||
}
|
||||
|
||||
/** Returns a Type representing the type constructor tcp.<name>. For example, given
|
||||
* `object Demo { type M[x] = List[x] }`, the call `extractTC(Demo, "M")` will return a type representing
|
||||
|
|
@ -97,7 +102,7 @@ final class ContextUtil[C <: Context](val ctx: C)
|
|||
val itTpe = it.tpe.asInstanceOf[global.Type]
|
||||
val m = itTpe.nonPrivateMember(global.newTypeName(name))
|
||||
val tc = itTpe.memberInfo(m).asInstanceOf[ctx.universe.Type]
|
||||
assert(tc != NoType && tc.isHigherKinded, "Invalid type constructor: " + tc)
|
||||
assert(tc != NoType && tc.takesTypeArgs, "Invalid type constructor: " + tc)
|
||||
tc
|
||||
}
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ trait Instance
|
|||
}
|
||||
trait Convert
|
||||
{
|
||||
def apply[T: c.AbsTypeTag](c: scala.reflect.makro.Context)(in: c.Tree): c.Tree
|
||||
def apply[T: c.AbsTypeTag](c: scala.reflect.macros.Context)(in: c.Tree): c.Tree
|
||||
}
|
||||
trait MonadInstance extends Instance
|
||||
{
|
||||
|
|
@ -30,7 +30,7 @@ object InputWrapper
|
|||
}
|
||||
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import macros._
|
||||
|
||||
object Instance
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ package appmacro
|
|||
import Types.Id
|
||||
import scala.tools.nsc.Global
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import macros._
|
||||
|
||||
/** A `TupleBuilder` that uses a KList as the tuple representation.*/
|
||||
object KListBuilder extends TupleBuilder
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package sbt
|
|||
package appmacro
|
||||
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import macros._
|
||||
|
||||
/** A builder that uses `TupleN` as the representation for small numbers of inputs (up to `TupleNBuilder.MaxInputs`)
|
||||
* and `KList` for larger numbers of inputs. This builder cannot handle fewer than 2 inputs.*/
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ package appmacro
|
|||
import Types.Id
|
||||
import scala.tools.nsc.Global
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import macros._
|
||||
|
||||
/**
|
||||
* A `TupleBuilder` abstracts the work of constructing a tuple data structure such as a `TupleN` or `KList`
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ package appmacro
|
|||
import Types.Id
|
||||
import scala.tools.nsc.Global
|
||||
import scala.reflect._
|
||||
import makro._
|
||||
import macros._
|
||||
|
||||
/** A builder that uses a TupleN as the tuple representation.
|
||||
* It is limited to tuples of size 2 to `MaxInputs`. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue