mirror of https://github.com/sbt/sbt.git
Merge pull request #44 from dwijnand/cleanups
Fix compilation warnings, migrate to blackbox.Context
This commit is contained in:
commit
414a7bb5f7
|
|
@ -19,9 +19,6 @@ sealed trait AttributeKey[T] {
|
|||
/** The runtime evidence for `T` */
|
||||
def manifest: Manifest[T]
|
||||
|
||||
@deprecated("Should only be used for compatibility during the transition from hyphenated labels to camelCase labels.", "0.13.0")
|
||||
def rawLabel: String
|
||||
|
||||
/** The label is the identifier for the key and is camelCase by convention. */
|
||||
def label: String
|
||||
|
||||
|
|
@ -73,7 +70,6 @@ object AttributeKey {
|
|||
|
||||
private[this] def make[T](name: String, description0: Option[String], extend0: Seq[AttributeKey[_]], rank0: Int)(implicit mf: Manifest[T]): AttributeKey[T] = new SharedAttributeKey[T] {
|
||||
def manifest = mf
|
||||
def rawLabel = name
|
||||
val label = Util.hyphenToCamel(name)
|
||||
def description = description0
|
||||
def extend = extend0
|
||||
|
|
@ -81,7 +77,6 @@ object AttributeKey {
|
|||
}
|
||||
private[sbt] def local[T](implicit mf: Manifest[T]): AttributeKey[T] = new AttributeKey[T] {
|
||||
def manifest = mf
|
||||
def rawLabel = LocalLabel
|
||||
def label = LocalLabel
|
||||
def description = None
|
||||
def extend = Nil
|
||||
|
|
@ -207,4 +202,4 @@ object Attributed {
|
|||
|
||||
/** Associates an empty metadata map with `data`. */
|
||||
def blank[T](data: T): Attributed[T] = Attributed(data)(AttributeMap.empty)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ object Dag {
|
|||
*/
|
||||
private[sbt] def findNegativeCycle[Node](graph: DirectedSignedGraph[Node]): List[graph.Arrow] =
|
||||
{
|
||||
import scala.annotation.tailrec
|
||||
import graph._
|
||||
val finished = new mutable.HashSet[Node]
|
||||
val visited = new mutable.HashSet[Node]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package sbt.internal.util
|
|||
import java.lang.Runnable
|
||||
import java.util.concurrent.{ atomic, Executor, LinkedBlockingQueue }
|
||||
import atomic.{ AtomicBoolean, AtomicInteger }
|
||||
import Types.{ :+:, ConstK, Id }
|
||||
import Types.{ ConstK, Id }
|
||||
|
||||
object EvaluationState extends Enumeration {
|
||||
val New, Blocked, Ready, Calling, Evaluated = Value
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
*/
|
||||
package sbt.internal.util
|
||||
|
||||
import Types._
|
||||
|
||||
// Used to emulate ~> literals
|
||||
trait Param[A[_], B[_]] {
|
||||
type T
|
||||
|
|
|
|||
|
|
@ -278,7 +278,6 @@ trait Init[Scope] {
|
|||
|
||||
def flattenLocals(compiled: CompiledMap): Map[ScopedKey[_], Flattened] =
|
||||
{
|
||||
import collection.breakOut
|
||||
val locals = compiled flatMap { case (key, comp) => if (key.key.isLocal) Seq[Compiled[_]](comp) else Nil }
|
||||
val ordered = Dag.topologicalSort(locals)(_.dependencies.flatMap(dep => if (dep.key.isLocal) Seq[Compiled[_]](compiled(dep)) else Nil))
|
||||
def flatten(cmap: Map[ScopedKey[_], Flattened], key: ScopedKey[_], deps: Iterable[ScopedKey[_]]): Flattened =
|
||||
|
|
@ -340,11 +339,6 @@ trait Init[Scope] {
|
|||
derivsByDef.getOrElseUpdate(key, new Deriveds(key, new mutable.ListBuffer)).settings += s
|
||||
}
|
||||
|
||||
// sort derived settings so that dependencies come first
|
||||
// this is necessary when verifying that a derived setting's dependencies exist
|
||||
val ddeps = (d: Deriveds) => d.dependencies.flatMap(derivsByDef.get)
|
||||
val sortedDerivs = Dag.topologicalSort(derivsByDef.values)(ddeps)
|
||||
|
||||
// index derived settings by triggering key. This maps a key to the list of settings potentially derived from it.
|
||||
val derivedBy = new mutable.HashMap[AttributeKey[_], mutable.ListBuffer[Derived]]
|
||||
for (s <- derived; d <- s.triggeredBy)
|
||||
|
|
@ -458,9 +452,7 @@ trait Init[Scope] {
|
|||
def settings = this :: Nil
|
||||
def definitive: Boolean = !init.dependencies.contains(key)
|
||||
def dependencies: Seq[ScopedKey[_]] = remove(init.dependencies, key)
|
||||
@deprecated("Will be made private.", "0.13.2")
|
||||
def mapReferenced(g: MapScoped): Setting[T] = make(key, init mapReferenced g, pos)
|
||||
@deprecated("Will be made private.", "0.13.2")
|
||||
def validateReferenced(g: ValidateRef): Either[Seq[Undefined], Setting[T]] = (init validateReferenced g).right.map(newI => make(key, newI, pos))
|
||||
|
||||
private[sbt] def validateKeyReferenced(g: ValidateKeyRef): Either[Seq[Undefined], Setting[T]] =
|
||||
|
|
@ -468,7 +460,6 @@ trait Init[Scope] {
|
|||
|
||||
def mapKey(g: MapScoped): Setting[T] = make(g(key), init, pos)
|
||||
def mapInit(f: (ScopedKey[T], T) => T): Setting[T] = make(key, init(t => f(key, t)), pos)
|
||||
@deprecated("Will be made private.", "0.13.2")
|
||||
def mapConstant(g: MapConstant): Setting[T] = make(key, init mapConstant g, pos)
|
||||
def withPos(pos: SourcePosition) = make(key, init, pos)
|
||||
def positionString: Option[String] = pos match {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
*/
|
||||
package sbt.internal.util
|
||||
|
||||
import Types._
|
||||
|
||||
// compilation test
|
||||
object LiteralTest {
|
||||
def x[A[_], B[_]](f: A ~> B) = f
|
||||
|
|
@ -14,4 +12,4 @@ object LiteralTest {
|
|||
|
||||
val a: List[Int] = f(Some(3))
|
||||
val b: List[String] = f(Some("aa"))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ object SettingsExample extends Init[Scope] {
|
|||
|
||||
object SettingsUsage {
|
||||
import SettingsExample._
|
||||
import Types._
|
||||
|
||||
// Define some keys
|
||||
val a = AttributeKey[Int]("a")
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@ package sbt.internal.util
|
|||
|
||||
import jline.console.ConsoleReader
|
||||
import jline.console.history.{ FileHistory, MemoryHistory }
|
||||
import java.io.{ File, InputStream, PrintWriter, FileInputStream, FileDescriptor, FilterInputStream }
|
||||
import java.io.{ File, InputStream, FileInputStream, FileDescriptor, FilterInputStream }
|
||||
import complete.Parser
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import scala.concurrent.duration.Duration
|
||||
import scala.annotation.tailrec
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ object EditDistance {
|
|||
for (i <- 1 to n; s_i = s(i - 1); j <- 1 to m) {
|
||||
val t_j = t(j - 1)
|
||||
val cost = if (s_i == t_j) matchCost else if (lower(s_i) == lower(t_j)) caseCost else subCost
|
||||
val tcost = if (s_i == t_j) matchCost else transposeCost
|
||||
|
||||
val c1 = d(i - 1)(j) + deleteCost
|
||||
val c2 = d(i)(j - 1) + insertCost
|
||||
|
|
@ -39,4 +38,4 @@ object EditDistance {
|
|||
|
||||
d(n)(m)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
package sbt.internal.util
|
||||
package complete
|
||||
|
||||
import java.io.File
|
||||
import sbt.io.IO
|
||||
|
||||
object HistoryCommands {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ package sbt.internal.util
|
|||
package complete
|
||||
|
||||
import jline.console.ConsoleReader
|
||||
import jline.console.completer.{ CandidateListCompletionHandler, Completer, CompletionHandler }
|
||||
import jline.console.completer.{ Completer, CompletionHandler }
|
||||
import scala.annotation.tailrec
|
||||
import collection.JavaConversions
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ class FileExamplesTest extends UnitSpec {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Remove DelayedInit - https://github.com/scala/scala/releases/tag/v2.11.0-RC1
|
||||
class DirectoryStructure(withCompletionPrefix: String = "") extends DelayedInit {
|
||||
var fileExamples: FileExamples = _
|
||||
var baseDir: File = _
|
||||
|
|
|
|||
Loading…
Reference in New Issue