mirror of https://github.com/sbt/sbt.git
more deprecations
This commit is contained in:
parent
29a26a13ab
commit
1870edfd27
|
|
@ -13,9 +13,16 @@ package compiler
|
|||
* provided by scalaInstance. This class requires a ComponentManager in order to obtain the interface code to scalac and
|
||||
* the analysis plugin. Because these call Scala code for a different Scala version than the one used for this class, they must
|
||||
* be compiled for the version of Scala being used.*/
|
||||
final class AnalyzingCompiler(val scalaInstance: xsbti.compile.ScalaInstance, val provider: CompilerInterfaceProvider, val cp: xsbti.compile.ClasspathOptions, log: Logger) extends CachedCompilerProvider
|
||||
final class AnalyzingCompiler(val scalaInstance: xsbti.compile.ScalaInstance, val provider: CompilerInterfaceProvider, val cp: xsbti.compile.ClasspathOptions) extends CachedCompilerProvider
|
||||
{
|
||||
def this(scalaInstance: ScalaInstance, provider: CompilerInterfaceProvider, log: Logger) = this(scalaInstance, provider, ClasspathOptions.auto, log)
|
||||
def this(scalaInstance: ScalaInstance, provider: CompilerInterfaceProvider) = this(scalaInstance, provider, ClasspathOptions.auto)
|
||||
|
||||
@deprecated("A Logger is no longer needed.", "0.13.0")
|
||||
def this(scalaInstance: ScalaInstance, provider: CompilerInterfaceProvider, log: Logger) = this(scalaInstance, provider)
|
||||
|
||||
@deprecated("A Logger is no longer needed.", "0.13.0")
|
||||
def this(scalaInstance: xsbti.compile.ScalaInstance, provider: CompilerInterfaceProvider, cp: xsbti.compile.ClasspathOptions, log: Logger) = this(scalaInstance, provider, cp)
|
||||
|
||||
def apply(sources: Seq[File], changes: DependencyChanges, classpath: Seq[File], singleOutput: File, options: Seq[String], callback: AnalysisCallback, maximumErrors: Int, cache: GlobalsCache, log: Logger)
|
||||
{
|
||||
val arguments = (new CompilerArguments(scalaInstance, cp))(Nil, classpath, None, options)
|
||||
|
|
@ -79,14 +86,14 @@ final class AnalyzingCompiler(val scalaInstance: xsbti.compile.ScalaInstance, va
|
|||
}
|
||||
}
|
||||
}
|
||||
private[this] def loader =
|
||||
private[this] def loader(log: Logger) =
|
||||
{
|
||||
val interfaceJar = provider(scalaInstance, log)
|
||||
// this goes to scalaInstance.loader for scala classes and the loader of this class for xsbti classes
|
||||
val dual = createDualLoader(scalaInstance.loader, getClass.getClassLoader)
|
||||
new URLClassLoader(Array(interfaceJar.toURI.toURL), dual)
|
||||
}
|
||||
private def getInterfaceClass(name: String, log: Logger) = Class.forName(name, true, loader)
|
||||
private[this] def getInterfaceClass(name: String, log: Logger) = Class.forName(name, true, loader(log))
|
||||
protected def createDualLoader(scalaLoader: ClassLoader, sbtLoader: ClassLoader): ClassLoader =
|
||||
{
|
||||
val xsbtiFilter = (name: String) => name.startsWith("xsbti.")
|
||||
|
|
|
|||
|
|
@ -20,16 +20,6 @@ object Compiler
|
|||
final case class IncSetup(analysisMap: File => Option[Analysis], definesClass: DefinesClass, skip: Boolean, cacheFile: File, cache: GlobalsCache, incOptions: IncOptions)
|
||||
final case class Compilers(scalac: AnalyzingCompiler, javac: JavaTool)
|
||||
|
||||
@deprecated("Use the other inputs variant.", "0.12.0")
|
||||
def inputs(classpath: Seq[File], sources: Seq[File], outputDirectory: File, options: Seq[String], javacOptions: Seq[String], definesClass: DefinesClass, maxErrors: Int, order: CompileOrder)(implicit compilers: Compilers, log: Logger): Inputs =
|
||||
{
|
||||
import Path._
|
||||
val classesDirectory = outputDirectory / "classes"
|
||||
val cacheFile = outputDirectory / "cache_old_style"
|
||||
val augClasspath = classesDirectory.asFile +: classpath
|
||||
val incSetup = IncSetup(Map.empty, definesClass, false, cacheFile, CompilerCache.fresh, IncOptions.Default)
|
||||
inputs(augClasspath, sources, classesDirectory, options, javacOptions, maxErrors, Nil, order)(compilers, incSetup, log)
|
||||
}
|
||||
def inputs(classpath: Seq[File], sources: Seq[File], classesDirectory: File, options: Seq[String], javacOptions: Seq[String], maxErrors: Int, sourcePositionMappers: Seq[Position => Option[Position]], order: CompileOrder)(implicit compilers: Compilers, incSetup: IncSetup, log: Logger): Inputs =
|
||||
new Inputs(
|
||||
compilers,
|
||||
|
|
|
|||
Loading…
Reference in New Issue