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