p

bloop

package bloop

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package internal
  2. package io
  3. package logging
  4. package reporter
  5. package task
  6. package tracing
  7. package util

Type Members

  1. final class BloopClassFileManager extends ClassFileManager
  2. final class BloopClasspathEntryLookup extends PerClasspathEntryLookup
  3. abstract class CompileBackgroundTasks extends AnyRef
  4. case class CompileInputs(scalaInstance: ScalaInstance, compilerCache: CompilerCache, sources: Array[AbsolutePath], classpath: Array[AbsolutePath], uniqueInputs: UniqueCompileInputs, out: CompileOutPaths, baseDirectory: AbsolutePath, scalacOptions: Array[String], javacOptions: Array[String], javacBin: Option[AbsolutePath], compileOrder: CompileOrder, classpathOptions: ClasspathOptions, previousResult: PreviousResult, previousCompilerResult: Result, reporter: ZincReporter, logger: ObservedLogger[Logger], dependentResults: Map[File, PreviousResult], cancelPromise: Promise[Unit], tracer: BraveTracer, ioScheduler: Scheduler, ioExecutor: Executor, invalidatedClassFilesInDependentProjects: Set[File], generatedClassFilePathsInDependentProjects: Map[String, File]) extends Product with Serializable
  5. case class CompileOutPaths(out: AbsolutePath, analysisOut: AbsolutePath, genericClassesDir: AbsolutePath, externalClassesDir: AbsolutePath, internalReadOnlyClassesDir: AbsolutePath) extends Product with Serializable
  6. case class CompileProducts(readOnlyClassesDir: Path, newClassesDir: Path, resultForDependentCompilationsInSameRun: PreviousResult, resultForFutureCompilationRuns: PreviousResult, invalidatedCompileProducts: Set[File], generatedRelativeClassFilePaths: Map[String, File]) extends Product with Serializable

    Collects the products generated during the compilation of a project.

    Collects the products generated during the compilation of a project.

    It has two previous results. The first is to be used by the projects that depend on this compilation and are being compiled during this run. This result is used because it contains class file locations referring to both classes directories and because these two classes directories will be in the dependency classpath of dependent compilations.

    The latter previous result is used for future client compilations. Future compilations will not see the readOnlyClassesDir and newClassesDir in this abstraction, but instead see an aggregated read-only classes directory. newClassesDir will become this read-only classes directory by the time of that compilation because all compilation products (class files, semanticdb files, sjsir files, tasty files, nir files, etc) in the current readOnlyClassesDir that are not in newClassesDir will be copied over. Therefore,the result that is used for compilation will have all class file references rebased to newClassesDir.

    We use different previous results because we want to remove the cost of copying class files from readOnlyClassesDir to newClassesDir before starting dependent compilations. This scheme allows us to be fast and perform as much IO work in the background as possible.

  7. final class CompilerCache extends AnyRef
  8. sealed trait ComponentLock extends GlobalLock
  9. sealed trait JavaSignal extends AnyRef

    Signals the Zinc internals whether Java compilation should be attempted or not.

    Signals the Zinc internals whether Java compilation should be attempted or not.

    This signal is completed by Bloop when all the Scala compilations of dependent projects have been successful. If they haven't, then the java signal will be FailFastCompilation with the list of the projects that failed.

    The reason why we need a java signal is because pipelining may start the compilation of dependent projects earlier than the compilation of the dependent projects have compiled. This is okay for dependent Scala projects because they can be compiled against the public interfaces extracted from the Scala pickles, but it's not okay for the java compilation because Java code may have dependencies on Scala code, and for Javac to compile successfully it needs to read the Scala code public APIs from class files (which means the dependent projects need to have finished successfully).

  10. case class PartialCompileProducts(readOnlyClassesDir: AbsolutePath, newClassesDir: AbsolutePath) extends Product with Serializable

    Collects the partial compile products generated after typechecking but before the end of compilation of a project.

  11. final class ScalaInstance extends xsbti.compile.ScalaInstance
  12. class ScalaInstanceTopLoader extends ClassLoader

    The parent classloader of the Scala compiler.

    The parent classloader of the Scala compiler. It was originally copied and pasted from https://github.com/lampepfl/dotty/blob/ea65338e06142f41f0e68b23250c8e22b0ba8837/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala#L586-L627

    To understand why a custom parent classloader is needed for the compiler, let us describe some alternatives that wouldn't work.

    - new URLClassLoader(urls): The compiler contains sbt phases that callback to sbt using the xsbti.* interfaces. If urls does not contain the sbt interfaces we'll get a ClassNotFoundException in the compiler when we try to use them, if urls does contain the interfaces we'll get a ClassCastException or a LinkageError because if the same class is loaded by two different classloaders, they are considered distinct by the JVM.

    - new URLClassLoader(urls, bloopLoader): Because of the JVM delegation model, this means that we will only load a class from urls if it's not present in the parent bloopLoader, but Bloop uses its own version of the scala library which is not the one we need to run the compiler.

    Our solution is to implement an URLClassLoader whose parent is new ScalaInstanceTopLoader(bloopClassLoader, bootClassLoader). We override loadClass to load the xsbti.* interfaces from the bloopClassLoader and the JDK classes from the bootClassLoader.

  13. case class UniqueCompileInputs(sources: Vector[HashedSource], classpath: Vector[FileHash], options: Vector[String], scalaJars: Vector[String], originProjectPath: String) extends CacheHashCode with Product with Serializable

Ungrouped