-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the first iteration of the Zinc API 1.0 #304
Commits on May 21, 2017
-
Remove deprecated compatibility stubs
Remove unused `GlobalCompat` for compatibility with 2.8.1 and extract the run subclassing out of the main logic of the `run` method.
Configuration menu - View commit details
-
Copy full SHA for 8a86b55 - Browse repository at this point
Copy the full SHA 8a86b55View commit details -
Make Zinc
Global
implementations independentThe callback implementation should be independent of the compiler interface and the source code should reflect so. Breaking change in comparison with the previous API: `Compiler` is now called `ZincCompiler` to make the naming more clear and better distinguish between `CachedCompiler` and its underlying `ZincCompiler`. Docs have been added and simplifications to methods have been provided and double checked with previous Scala versions. For instance, `dropRun` has been confirmed to only exist in 2.10.x series and removed in 2.11.x. Therefore, its implementation has been moved to the compatibility traits for 2.10.x series. We then remove a reflective call for versions above 2.10.6.
Configuration menu - View commit details
-
Copy full SHA for e39dd51 - Browse repository at this point
Copy the full SHA e39dd51View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2609a34 - Browse repository at this point
Copy the full SHA 2609a34View commit details -
Port
CompileAnalysis
from contraband to JavaWe need `CompileAnalysis` to start creating the Java API with good docs. Contraband is not necessary for the analysis since we only serialize/deserialize `MAnalysis`, its subclass.
Configuration menu - View commit details
-
Copy full SHA for e519c08 - Browse repository at this point
Copy the full SHA e519c08View commit details -
Change
Stamps
interface and functionality* Make `ReadStamps` a Java interface exposed in the public API. * Create a `Stamp` interface that Java users can use without any knowledge of the internal requirement. * Add docs to the pertinent Java interface. * Change `Stamp` companion object by `Stamper` to make it Java-friendly. I also think the name is clearer about the contents of the object. * Rename `internalSouce` to `source` for consistency with the Scala API. It's made clear that source should always be an internal source in the docs. This makes sense anyway, otherwise it wouldn't make sense to ask for the stamp of a source file that is not compiled in the current analysis.
Configuration menu - View commit details
-
Copy full SHA for ae6381c - Browse repository at this point
Copy the full SHA ae6381cView commit details -
`Exists` has never been used, neither internally in Zinc nor in sbt and pants (I double checked on both). The concept of `exists` does not make sense, since there is no value in asserting that a stamp "exists" only in asserting that a stamp is **not** available for a given file. The latter is represented by the new `Stamp` API since last modified time and hash are both optional. If both are empty, a stamp does not exist.
Configuration menu - View commit details
-
Copy full SHA for 8834f0b - Browse repository at this point
Copy the full SHA 8834f0bView commit details -
Turn
CompileAnalysis
to an interface`CompileAnalysis` should be an interface instead of an abstract class.
Configuration menu - View commit details
-
Copy full SHA for ad5e59a - Browse repository at this point
Copy the full SHA ad5e59aView commit details -
Add
ReadStamps
toCompileAnalysis
Users of `CompileAnalysis` will have access to the stamps of the files that have been processed by Zinc.
Configuration menu - View commit details
-
Copy full SHA for 529c709 - Browse repository at this point
Copy the full SHA 529c709View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8cde423 - Browse repository at this point
Copy the full SHA 8cde423View commit details -
Create
ReadSourceInfos
& add toCompileAnalysis
`ReadSourceInfos` is a read-only interface for getting source info (namely, compiler errors) associated with a given file. This is very useful in lots of cases. Especially to process and improve error messages in a lightweight way, though ScalaClippy already exists for that purpose. In any case, having access to the compiler errors outside of is of ultimate importance for tools that want to preprocess compilation results independently of sbt.
Configuration menu - View commit details
-
Copy full SHA for 1d5da03 - Browse repository at this point
Copy the full SHA 1d5da03View commit details -
Configuration menu - View commit details
-
Copy full SHA for df4d222 - Browse repository at this point
Copy the full SHA df4d222View commit details -
Replace
OutputSetting
byOutputGroup
`OutputSetting` is like `OutputGroup` by just returns strings instead of files. I see no reason why `OutputGroup` should not be used instead, therefore simplifying the Zinc API and allowing users to have access to files and not mere strings. If they want strings, they always can do `getAbsolutePath`. N.B. This is good for machine independence.
Configuration menu - View commit details
-
Copy full SHA for 1f2d12c - Browse repository at this point
Copy the full SHA 1f2d12cView commit details -
Fix
Output
andCompilation
API* Remove dangerous use of output groups as fields in compilation. In the case of `SingleOutput`, the source directory was invented and incorrect (the root). Users of the API processing this file could create chaos in people's computers. The new design forces consumers of the `Compilation` API to make up their minds and identify whether the compilation was used with a single output or several outputs. In order to do that, we return `Output` instead of an array of `OutputGroup`. * Rename `outputDirectory` and `sourceDirectory` to be Java friendly. * Augment `Output` interface with Java-friendly methods. Scala users can use pattern matching instead.
Configuration menu - View commit details
-
Copy full SHA for 761ea0e - Browse repository at this point
Copy the full SHA 761ea0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 73ff81a - Browse repository at this point
Copy the full SHA 73ff81aView commit details -
Make the Output API more Java friendly
* Make methods in `Output` subclasses public * Changes to the API. Java idiomatic renames: * sourceDirectory -> getSourceDirectory * outputDirectory -> getOutputDirectory
Configuration menu - View commit details
-
Copy full SHA for df6f5a4 - Browse repository at this point
Copy the full SHA df6f5a4View commit details -
Add
ReadCompilations
toCompileAnalysis
* `Compilation` has been ported to Java code and documented. * `ReadCompilations` is a read-only API of `Compilations`. * Add a TODO to check the ordering of the array of compilations. * Expose `ReadCompilations` to the `CompileAnalysis`.
Configuration menu - View commit details
-
Copy full SHA for 4850acf - Browse repository at this point
Copy the full SHA 4850acfView commit details -
Add
CompilerBridgeProvider
interface and misc.* 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.
Configuration menu - View commit details
-
Copy full SHA for 9eea8bd - Browse repository at this point
Copy the full SHA 9eea8bdView commit details -
Move
constant
to static inCompilerBridgeProvider
No need to have it in the internal Scala side.
Configuration menu - View commit details
-
Copy full SHA for 8381e29 - Browse repository at this point
Copy the full SHA 8381e29View commit details -
Configuration menu - View commit details
-
Copy full SHA for d061e9e - Browse repository at this point
Copy the full SHA d061e9eView commit details -
Rename
getCompilerSources
togetCompiledBridge
Previous name was incorrect, we actually return the compiled bridge.
Configuration menu - View commit details
-
Copy full SHA for 4b475b1 - Browse repository at this point
Copy the full SHA 4b475b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for b48a783 - Browse repository at this point
Copy the full SHA b48a783View commit details -
Configuration menu - View commit details
-
Copy full SHA for f1fc0d5 - Browse repository at this point
Copy the full SHA f1fc0d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae88038 - Browse repository at this point
Copy the full SHA ae88038View commit details -
Test
getScalaInstance
&getCompiledBridge
* 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.
Configuration menu - View commit details
-
Copy full SHA for 7903c60 - Browse repository at this point
Copy the full SHA 7903c60View commit details -
Compile bridge for 2.12.x and other Scala versions
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.
Configuration menu - View commit details
-
Copy full SHA for 3bac784 - Browse repository at this point
Copy the full SHA 3bac784View commit details -
Configuration menu - View commit details
-
Copy full SHA for 182aec7 - Browse repository at this point
Copy the full SHA 182aec7View commit details -
Add Java API for Zinc Ivy integration
* 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.'
Configuration menu - View commit details
-
Copy full SHA for 55583d7 - Browse repository at this point
Copy the full SHA 55583d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for b1eac04 - Browse repository at this point
Copy the full SHA b1eac04View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bf12de - Browse repository at this point
Copy the full SHA 0bf12deView commit details -
Configuration menu - View commit details
-
Copy full SHA for af702ae - Browse repository at this point
Copy the full SHA af702aeView commit details -
Add public method to get default component 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`.
Configuration menu - View commit details
-
Copy full SHA for 6391ae7 - Browse repository at this point
Copy the full SHA 6391ae7View commit details -
Remove the use of
BaseIvySpecification
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.
Configuration menu - View commit details
-
Copy full SHA for 436a985 - Browse repository at this point
Copy the full SHA 436a985View commit details -
Move IncOptionsUtil to zincCore project
It does not make sense to define it in the compiler interface since the default implementations of class file manager and some inc options are defined in `zincCore`.
Configuration menu - View commit details
-
Copy full SHA for 4452126 - Browse repository at this point
Copy the full SHA 4452126View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14d37d8 - Browse repository at this point
Copy the full SHA 14d37d8View commit details -
Fix
fromStringMap
for classfile manager keyPreviously, classfile manager key was not read from `incOptions.properties` files because there was no way to specify which classfile manager should be chosen. Now, the class file manager can be indeed chosen. As we cannot serialize the logger that should be used for the transactional classfile manager type, we reuse the one passed in at the time of reading the incremental options values.
Configuration menu - View commit details
-
Copy full SHA for 5590cc5 - Browse repository at this point
Copy the full SHA 5590cc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c53bf0 - Browse repository at this point
Copy the full SHA 9c53bf0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 686b6bb - Browse repository at this point
Copy the full SHA 686b6bbView commit details
Commits on May 22, 2017
-
Make the equiv for stamp public
This is necessary for other users to implement external hooks and reason about which files have been changed and which have not. Java users can access it with: ``` sbt.internal.inc.Stamp$.MODULE$.equivStamp ```
Configuration menu - View commit details
-
Copy full SHA for d13928f - Browse repository at this point
Copy the full SHA d13928fView commit details -
Add interface for external Lookup
* Move `JavaInterfaceUtil` to zincCore. * Define `Changes` in `compilerInterface`. * Define a `Lookup` interface. Note that this lookup interface can now be implemented by third parties because the stamps of the files are provided by the `CompileAnalysis` interface.
Configuration menu - View commit details
-
Copy full SHA for f984ed9 - Browse repository at this point
Copy the full SHA f984ed9View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd23a51 - Browse repository at this point
Copy the full SHA bd23a51View commit details -
Fix sbt#125: Get default classfile manager for inc
Previously, there was no way to get the underlying classfile manager without depending on internal implementation details (sbt.internal.inc). This problem is described in this issue: sbt#125. That is a blocker for scalajs. * Add `ClassFileManagerUtil` static methods to get access to the underlying class file manager implementation from both the key and the incremental options. * Add docs to subclasses of `ClassFileManagerType` and the implementations. * Remove closures for getting the `deleteImmediately` and `transactional` class file manager implementations. * Extract implementation from anonymous classes, make them final and private.
Configuration menu - View commit details
-
Copy full SHA for e6eb0b0 - Browse repository at this point
Copy the full SHA e6eb0b0View commit details -
Remove deprecated
transactional
In sbt 0.13.x series, there exist a transactional classfile manager that did not have any logger on which to log its steps. As this is not used anymore, and a classfile manager should always log them, we remove this from the internal API.
Configuration menu - View commit details
-
Copy full SHA for f49e945 - Browse repository at this point
Copy the full SHA f49e945View commit details -
Remove
allInternalSrcDeps
from RelationsIt's safe to remove this deprecated method in M1 because it's part of the private API (sbt.internal.inc). This method has been deprecated and removed because class-based dependency tracking does not need to know about internal source dependencies anymore (in fact, this is not a useful concept for class-based dependency tracking).
Configuration menu - View commit details
-
Copy full SHA for 7ee4c9d - Browse repository at this point
Copy the full SHA 7ee4c9dView commit details -
Add
ZincCompilerUtil
to get the Scalac compiler* Move `IncrementalCompilerUtil` to `ZincCompilerUtil`. * Change `IncrementalCompilerUtil` to an interface with static methods. * Remove bug in which ScalaInstance implementation was leaking to the public API.
Configuration menu - View commit details
-
Copy full SHA for d1a4627 - Browse repository at this point
Copy the full SHA d1a4627View commit details -
Hide Zinc Compilation implementation
Before, we had made this public in `sbt.inc`, but this is not necessary anymore.
Configuration menu - View commit details
-
Copy full SHA for f98c221 - Browse repository at this point
Copy the full SHA f98c221View commit details -
Move formats away from public API
Formats for `AnalyzedClass`, `Compilation` and `Companions` were in the public API (xsbti.api)! They have been removed from there.
Configuration menu - View commit details
-
Copy full SHA for d00234d - Browse repository at this point
Copy the full SHA d00234dView commit details -
Move ZincBridgeProvider to
xsbti.compile
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.
Configuration menu - View commit details
-
Copy full SHA for df5915f - Browse repository at this point
Copy the full SHA df5915fView commit details -
Move
ClasspathOptionsUtil
to the Java public APIMove the previous Scala implementation to Java as static methods.
Configuration menu - View commit details
-
Copy full SHA for 3c846ad - Browse repository at this point
Copy the full SHA 3c846adView commit details -
Configuration menu - View commit details
-
Copy full SHA for a4f877e - Browse repository at this point
Copy the full SHA a4f877eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 293c400 - Browse repository at this point
Copy the full SHA 293c400View commit details
Commits on May 26, 2017
-
Configuration menu - View commit details
-
Copy full SHA for e6cbee2 - Browse repository at this point
Copy the full SHA e6cbee2View commit details