mirror of https://github.com/sbt/sbt.git
Build against Scala 2.8 nightly from Sept 29, 2009.
git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@1066 d89573ee-9141-11dd-94d4-bdf5e562f29c
This commit is contained in:
parent
113a22b719
commit
4e15cdcc0b
|
|
@ -13,7 +13,7 @@ abstract class CrossCompileProject extends BasicScalaProject with MavenStyleScal
|
|||
private val version2_7_4 = "2.7.4"
|
||||
private val version2_7_5 = "2.7.5"
|
||||
private val version2_7_6 = "2.7.6"
|
||||
private val version2_8_0 = "2.8.0-20090910.003346-+"
|
||||
private val version2_8_0 = "2.8.0-20090929.004247-+"
|
||||
private val base = "base"
|
||||
|
||||
/* The configurations for the versions of Scala.*/
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ sealed abstract class CompilerCore
|
|||
{
|
||||
val ClasspathOptionString = "-classpath"
|
||||
val OutputOptionString = "-d"
|
||||
|
||||
|
||||
// Returns false if there were errors, true if there were not.
|
||||
protected def process(args: List[String], log: Logger): Boolean
|
||||
// Returns false if there were errors, true if there were not.
|
||||
|
|
@ -27,7 +27,7 @@ sealed abstract class CompilerCore
|
|||
def actionNothingToDoMessage: String
|
||||
def actionSuccessfulMessage: String
|
||||
def actionUnsuccessfulMessage: String
|
||||
|
||||
|
||||
private def classpathString(rawClasspathString: String, includeScala: Boolean) =
|
||||
if(includeScala)
|
||||
List(rawClasspathString, scalaClasspathForJava).mkString(File.pathSeparator)
|
||||
|
|
@ -51,7 +51,7 @@ sealed abstract class CompilerCore
|
|||
FileUtilities.createDirectory(outputDir, log) orElse
|
||||
{
|
||||
def classpathAndOut(javac: Boolean): List[String] = OutputOptionString :: outputDir.getAbsolutePath :: classpathOption(javac)
|
||||
|
||||
|
||||
Control.trapUnit("Compiler error: ", log)
|
||||
{
|
||||
val sourceList = sources.map(_.asFile.getAbsolutePath).toList
|
||||
|
|
@ -87,7 +87,7 @@ sealed abstract class CompilerCore
|
|||
val javaSourceList = filteredSources(".java")
|
||||
compile("Java", javaSourceList, javaOptions, true)(processJava)
|
||||
}
|
||||
|
||||
|
||||
val (first, second) = if(order == CompileOrder.JavaThenScala) (javaCompile, scalaCompile) else (scalaCompile, javaCompile)
|
||||
if(first() && second())
|
||||
{
|
||||
|
|
@ -157,7 +157,7 @@ final class Compile(maximumErrors: Int) extends CompilerBase
|
|||
var reporter = new LoggerReporter(maximumErrors, log)
|
||||
val settings = new Settings(reporter.error)
|
||||
val command = new CompilerCommand(arguments, settings, error, false)
|
||||
|
||||
|
||||
object compiler extends Global(command.settings, reporter)
|
||||
if(!reporter.hasErrors)
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ final class LoggerReporter(maximumErrors: Int, log: Logger) extends scala.tools.
|
|||
{
|
||||
import scala.tools.nsc.util.{FakePos,NoPosition,Position}
|
||||
private val positions = new scala.collection.mutable.HashMap[Position, Severity]
|
||||
|
||||
|
||||
def error(msg: String) { error(FakePos("scalac"), msg) }
|
||||
|
||||
def printSummary()
|
||||
|
|
@ -222,7 +222,7 @@ final class LoggerReporter(maximumErrors: Int, log: Logger) extends scala.tools.
|
|||
if(ERROR.count > 0)
|
||||
log.error(countElementsAsString(ERROR.count, "error") + " found")
|
||||
}
|
||||
|
||||
|
||||
def display(pos: Position, msg: String, severity: Severity)
|
||||
{
|
||||
severity.count += 1
|
||||
|
|
@ -236,7 +236,7 @@ final class LoggerReporter(maximumErrors: Int, log: Logger) extends scala.tools.
|
|||
case WARNING => Level.Warn
|
||||
case INFO => Level.Info
|
||||
}
|
||||
|
||||
|
||||
private def print(level: Level.Value, posIn: Position, msg: String)
|
||||
{
|
||||
// the implicits keep source compatibility with the changes in 2.8 : Position.{source,line,column} are no longer Options
|
||||
|
|
@ -265,7 +265,7 @@ final class LoggerReporter(maximumErrors: Int, log: Logger) extends scala.tools.
|
|||
for(offset <- pos.offset; src <- pos.source)
|
||||
{
|
||||
val pointer = offset - src.lineToOffset(src.offsetToLine(offset))
|
||||
val pointerSpace = lineContent.take(pointer).map { case '\t' => '\t'; case x => ' ' }
|
||||
val pointerSpace = (lineContent: Seq[Char]).take(pointer).map { case '\t' => '\t'; case _ => ' ' }
|
||||
log.log(level, pointerSpace.mkString + "^") // pointer to the column position of the error/warning
|
||||
}
|
||||
}
|
||||
|
|
@ -289,7 +289,7 @@ final class LoggerReporter(maximumErrors: Int, log: Logger) extends scala.tools.
|
|||
case _ => display(pos, msg, severity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private def testAndLog(pos: Position, severity: Severity): Boolean =
|
||||
{
|
||||
if(pos == null || pos.offset.isEmpty)
|
||||
|
|
|
|||
|
|
@ -52,12 +52,12 @@ class JLineReader(historyPath: Option[Path], completors: Completors, log: Logger
|
|||
{
|
||||
import completors._
|
||||
import jline.{ArgumentCompletor, Completor, MultiCompletor, NullCompletor, SimpleCompletor}
|
||||
|
||||
|
||||
private val generalCompletor = simpleCompletor(generalCommands)
|
||||
private val projectCompletor = simpleArgumentCompletor(projectAction :: Nil, projectNames)
|
||||
|
||||
|
||||
private val completor = new MultiCompletor()
|
||||
|
||||
|
||||
protected[this] val reader =
|
||||
{
|
||||
val cr = new ConsoleReader
|
||||
|
|
@ -74,14 +74,14 @@ class JLineReader(historyPath: Option[Path], completors: Completors, log: Logger
|
|||
cr.addCompletor(completor)
|
||||
cr
|
||||
}
|
||||
|
||||
|
||||
/** Used for a single argument so that the argument can have spaces in it.*/
|
||||
object SingleArgumentDelimiter extends ArgumentCompletor.AbstractArgumentDelimiter
|
||||
{
|
||||
def isDelimiterChar(buffer: String, pos: Int) =
|
||||
(buffer.charAt(pos) == ' ') && buffer.substring(0, pos).trim.indexOf(' ') == -1
|
||||
}
|
||||
|
||||
|
||||
private def simpleCompletor(completions: Iterable[String]) = new SimpleCompletor(completions.toList.toArray)
|
||||
private def simpleArgumentCompletor(first: Iterable[String], second: Iterable[String]) =
|
||||
singleArgumentCompletor(simpleCompletor(first), simpleCompletor(second))
|
||||
|
|
@ -98,11 +98,11 @@ class JLineReader(historyPath: Option[Path], completors: Completors, log: Logger
|
|||
c.setStrict(true)
|
||||
c
|
||||
}
|
||||
|
||||
|
||||
private def propertyCompletor(propertyNames: Iterable[String]) =
|
||||
simpleArgumentCompletor(propertyActions, propertyNames)
|
||||
private def prefixedCompletor(baseCompletor: Completor) =
|
||||
singleArgumentCompletor(simpleCompletor(prefixes.toList.toArray), baseCompletor)
|
||||
singleArgumentCompletor(simpleCompletor(prefixes.toList.toArray[String]), baseCompletor)
|
||||
def setVariableCompletions(taskNames: Iterable[String], propertyNames: Iterable[String], extra: Iterable[(String, Iterable[String])] )
|
||||
{
|
||||
import scala.collection.immutable.TreeSet
|
||||
|
|
|
|||
|
|
@ -533,7 +533,7 @@ object ManageDependencies
|
|||
}
|
||||
private def addArtifacts(moduleID: DefaultModuleDescriptor, artifacts: Iterable[Artifact])
|
||||
{
|
||||
val allConfigurations = moduleID.getPublicConfigurationsNames
|
||||
val allConfigurations = moduleID.getPublicConfigurationsNames.toSeq
|
||||
for(artifact <- artifacts)
|
||||
{
|
||||
val configurationStrings =
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ private[sbt] trait ClassFile
|
|||
val fileName: String
|
||||
val className: String
|
||||
val superClassName: String
|
||||
val interfaceNames: RandomAccessSeq[String]
|
||||
val interfaceNames: Array[String]
|
||||
val accessFlags: Int
|
||||
val constantPool: RandomAccessSeq[Constant]
|
||||
val fields: RandomAccessSeq[FieldOrMethodInfo]
|
||||
val methods: RandomAccessSeq[FieldOrMethodInfo]
|
||||
val attributes: RandomAccessSeq[AttributeInfo]
|
||||
val constantPool: Array[Constant]
|
||||
val fields: Array[FieldOrMethodInfo]
|
||||
val methods: Array[FieldOrMethodInfo]
|
||||
val attributes: Array[AttributeInfo]
|
||||
val sourceFile: Option[String]
|
||||
def types: Set[String]
|
||||
def stringValue(a: AttributeInfo): String
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ private[sbt] object Parser
|
|||
new ClassFile
|
||||
{
|
||||
assume(in.readInt() == JavaMagic, "Invalid class file: " + fileName)
|
||||
|
||||
|
||||
val fileName = filename
|
||||
val minorVersion: Int = in.readUnsignedShort()
|
||||
val majorVersion: Int = in.readUnsignedShort()
|
||||
|
|
@ -81,10 +81,10 @@ private[sbt] object Parser
|
|||
fieldsOrMethods.flatMap { fieldOrMethod =>
|
||||
descriptorToTypes(fieldOrMethod.descriptor)
|
||||
}
|
||||
|
||||
|
||||
private def fieldTypes = getTypes(fields)
|
||||
private def methodTypes = getTypes(methods)
|
||||
|
||||
|
||||
private def classConstantReferences =
|
||||
constants.flatMap { constant =>
|
||||
constant.tag match
|
||||
|
|
@ -119,7 +119,7 @@ private[sbt] object Parser
|
|||
{
|
||||
val constantPoolSize = in.readUnsignedShort()
|
||||
val pool = new Array[Constant](constantPoolSize)
|
||||
|
||||
|
||||
def parse(i: Int): Unit =
|
||||
if(i < constantPoolSize)
|
||||
{
|
||||
|
|
@ -127,8 +127,8 @@ private[sbt] object Parser
|
|||
pool(i) = constant
|
||||
parse( if(constant.wide) i+2 else i+1 )
|
||||
}
|
||||
|
||||
parse(1) // to lookup: why 1?
|
||||
|
||||
parse(1)
|
||||
pool
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ private[sbt] object Parser
|
|||
tag match
|
||||
{
|
||||
case ConstantClass | ConstantString => new Constant(tag, in.readUnsignedShort())
|
||||
case ConstantField | ConstantMethod | ConstantInterfaceMethod | ConstantNameAndType =>
|
||||
case ConstantField | ConstantMethod | ConstantInterfaceMethod | ConstantNameAndType =>
|
||||
new Constant(tag, in.readUnsignedShort(), in.readUnsignedShort())
|
||||
case ConstantInteger => new Constant(tag, new java.lang.Integer(in.readInt()))
|
||||
case ConstantFloat => new Constant(tag, new java.lang.Float(in.readFloat()))
|
||||
|
|
|
|||
Loading…
Reference in New Issue