Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add the first iteration of the Zinc API 1.0 #304
This is just the first iteration of the Zinc API.
This iteration's goal is to make safe functionality of Zinc public to allow Scala and Java parties (Gradle, Pants, Maven, et cetera) use Zinc with binary compatibility guarantees. This task needs another iteration given:
The last iteration will happen before RC1 (end of June - beginning of July).
The new public API makes it easier to:
Aside from these, this API also addresses some issues that have arisen in the past:
I find that in general, these commits make Zinc easier to use and improve the consistency of the whole API. The most remarkable change is the
Note that all the utilities made public only expose functionality that is a product of the incremental compiler. No internal details of the incremental analysis are exposed to the users.
There are some Java files that have been moved out of the compiler interface because they required static method implementations in the projects on which the implementations of certain classes were provided.
In the future, I feel that these are the things that should be worked on to finish off the Zinc API:
I have more ideas, but those will be discussed when time's up.
The breaking changes are documented in every commit. I suggest that reviewers go through the commits one by one, though I don't expect them to do so (given the big diff size). As this is just the first iteration of the redesign and targets a milestone, I am not writing any migration notes for now. I'll wait until everything is finished in our first RC to write the migration notes so that other build tools (other than sbt) can start using it.
As a reminder, the public API is
This is a good time to gather feedback. So that's very much welcome.
May 26, 2017
1 check passed
With regard to additional private/internal APIs that are currently in use, can browse through https://github.com/pantsbuild/pants/tree/master/src/scala/org/pantsbuild/zinc (as of zinc
@stuhood I've been browsing through that for a while, but thanks for the heads up. Are you in a hurry to do this? I'll be tackling the second iteration of the API soon before the release candidate and the API freeze, so maybe you want to wait until that's out?
@jvican : It would probably make sense for me to continue to attempt this, just in order to find any additional issues that you might not have seen. As an example, yesterday I noticed that it's not currently possible to extend
Great, I'll make this (or something similar, I have to look into the details) happen to unblock that implementation.
@jvican: A few more details here:
I'm going to try porting to usage of
Alright, I ported to
Also, it doesn't look like it's possible to use a "default" Reporter (as it is with
@stuhood: Yes, it seems that the entanglement between
To overcome this issue, some of Zinc's test suites create a
With regards to making the reporter
referenced this pull request
Jun 20, 2017
Yea, that makes sense. I'm still thinking of zinc as a CLI tool, but in the context of a library, being explicit about output location is important... ditto logging.
Hey @stuhood, I've been fixing all the issues you've reported regarding logging. I think I have come up with some elegant solutions you may want to have a look at.
This is the most important change: scalacenter@a9a9c2f.
All the changes are in this branch: 1.0...scalacenter:fix-loggers.
I can release these changes as part of a temporary
In the new interface, I have added a filtered reporter in Zinc and the normal
Let me know if this public API works for you.
Thanks @jvican . The API looks great (with one exception mentioned below): thanks for incorporating file/msg based filtering.
I should be able to sanity check incremental compile before the end of Monday.
There is a bit of inconsistency between