Before, we were using `sbt.inc`. As we have settled to define all the
interfaces in the `xsbti.compile` namespaces, it's not worth it to force
users remember other locations for the interfaces forwarding the default
implementations in Scala.
* Move `IncrementalCompilerUtil` to `ZincCompilerUtil`.
* Change `IncrementalCompilerUtil` to an interface with static methods.
* Remove bug in which ScalaInstance implementation was leaking to the
public API.
This is the proof that we're now testing the Zinc public API because
we're resolving with the ivy options and resolution specified in the
default compiler bridge provider.
Expose default component provider through a static method in
`ZincCompilerBridge`. This method is necessary to invoke the bridge.
Removes the previous global lock and component provider implementations
in `BridgeProviderSpecification`.
* Adds a method to fetch the default implementation of the compiler
provider.
* Adds a method to get a default `IvyConfiguration` from a small number
of parameters.
The public API is implemented in Java to ensure binary compatibility no
matter what happens to the internal Scala implementations. It also makes
it easier for Java users to use the API and avoid importing MODULE$'s
and Scala generated class files.'
This commit makes sure that we always check that we compile against the
latest two versions in Scala 2.10, Scala 2.11 and Scala 2.12.
This commit also removes the null loggers and uses normal loggers to
check what the output of the bridge provider is. This output is
important and the rationale to do this is that it should be visible for
us in order to detect cases where there's a regression or the output is
modified in some way. Output is short anyway.
* Remove unused code in `BridgeProviderSpecification` and test the real
code in the default provider.
* Don't use temporary directory to download the Scala jars, retrive them
in a directory specified by the user.
* Use `java.net.ClassLoader` instead of `ScalaClassLoader`.
* Use the `ScalaInstance` interface, not the implementation. Remove any
reference to the implementation.
* Add interface for the provider.
* Rename `IvyComponentCompiler` to `ZincComponentCompiler`.
* Split `ZincComponentCompiler` and `ZincComponentManager`.
* Define `IfMissing` and `InvalidComponent` into independent files.
* Rename variables and internal API to be clearer.
The compiler bridge dependency resolution had `missingOk = true` flag on. This would silently succeed even when one of the dependency is missing, and it would randomly fail bridge compilation, which is very confusing.
This commit addresses several concers:
* Document better the Zinc internal implementation.
* Getting the implementation ready for moving things from internal to
public APIs. This will be done in a follow-up commit.
* Removing `inputs` and `setups` from the `IncrementalCompilerUtil` as
they exist mainly to interface between Scala code and Java code. The
reality is that both Java and Scala developers can easily call the
constructors by themselves and don't learn more API methods.
* Removes unused imports, that emit stupid warnings.
* Make code more readable, especifically in the analyzing compilers for
both Java and Scala, which was hardly understandable and documented.
* Make `AnalyzingJavaCompiler` to extend `JavaCompiler` as
`AnalyzingCompiler` does for `ScalaCompiler`. In an upcoming commit,
`AnalyzingCompiler` will be renamed into `AnalyzingScalaCompiler` for
consistency reasons.
* Replace use of `sbt.util.Logger` helpers by `sbt.util.InterfaceUtil`.
This migrates the `ComponentManager` from librarymanagement, and refactors it to clarify the double caching of the compiler bridge.
The main purpose of this refactoring is to fixsbt/sbt#2539. As it stands, becaue Ivy cache directory is being used as the secondary cache of the compiled compiler bridge, it's annoying to work with the compiler bridge. Instead of using "Ivy cache", the new `ZincComponentManager` accepts `secondaryCacheDir: Option[File]`, which during test defaults to `target/zinc-components`.
Fixessbt/sbt#2539
The compiler bridge had a dependency on the scala compiler in the
version defined in the build definition. This means that when trying to
fetch the compiler bridge for, say, Scala 2.9.2, we would also pull in
the Scala compiler 2.10.5.
The compiler bridge now has a "provided" dependency on the Scala
compiler.
Previously the component compiler depended on a `componentID` added to
some interfaces to be able to compile the compiler interface. sbt's
launcher placed artifacts marked with this `componentID` in a special
directory that was then used by the ComponentCompiler to be able to
compile the compiler interface.
This commit modifies the ComponentCompiler so that it does not expect
these components to be already present in some directory, but instead
downloads it using Ivy when required.