Skip to content
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 AuxiliaryClassFiles in IncOptions #956

Merged
merged 3 commits into from
Dec 14, 2020
Merged

Conversation

adpi2
Copy link
Member

@adpi2 adpi2 commented Dec 7, 2020

Fixes #579

Add an AuxiliaryClassFiles member in IncOptions so that the ClassFileManager manages the files that are associated to class files. This will be used for Scala 3 (.tasty files), for Scala.js (.sjsir files) and for Scala Native (.nir files).

The auxiliaryClassFiles member in IncOptions is an array so that we can manage several type of files at the same time (for instance .tasty and .sjsir files). Its default value is an empty array because Scala 2 and Java don't need any.

The implementation for .tasty files is provided so that it can already be reused by sbt (sbt/sbt#6080) and also by Mill and Bloop.

@eed3si9n
Copy link
Member

eed3si9n commented Dec 7, 2020

Could you exercise this from https://github.com/sbt/zinc/blob/develop/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala or scripted test somehow?

@smarter
Copy link
Contributor

smarter commented Dec 8, 2020

Thanks for working on this!

The auxiliaryClassFiles member in IncOptions is an array so that we can manage several type of files at the same time (for instance .tasty and .sjsir files). Its default value is an empty array because Scala 2 and Java don't need any.
The implementation for .tasty files is provided so that it can already be reused by sbt (sbt/sbt#6080) and also by Mill and Bloop.

I wonder if besides .tasty we shouldn't also hardcode .sjsir and .nir by default, it shouldn't break anything and it means that mill/bloop/maven/... don't have to remember to do this themselves. /cc @sjrd

@sjrd
Copy link

sjrd commented Dec 8, 2020

I wonder if besides .tasty we shouldn't also hardcode .sjsir and .nir by default, it shouldn't break anything and it means that mill/bloop/maven/... don't have to remember to do this themselves.

We could do that. I don't have a strong opinion either way. If Zinc doesn't do it by default, sbt-scalajs and sbt-scala-native will keep doing it.

Add auxiliaryClassFiles member in IncOptions to manage files that are
associated to class files. Provide an implementation for TASTy files.
@adpi2 adpi2 requested a review from eed3si9n December 10, 2020 14:58
@eed3si9n eed3si9n added this to the 1.5.0 milestone Dec 10, 2020
Copy link

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. I have a few comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an AuxiliaryClassFileManager to Zinc public API
4 participants