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 an AuxiliaryClassFileManager to Zinc public API #579

Closed
allanrenucci opened this issue Aug 17, 2018 · 3 comments · Fixed by #956
Closed

Add an AuxiliaryClassFileManager to Zinc public API #579

allanrenucci opened this issue Aug 17, 2018 · 3 comments · Fixed by #956

Comments

@allanrenucci
Copy link
Contributor

allanrenucci commented Aug 17, 2018

From scala-js/scala-js#3419:

Can we upstream a more generic version of https://github.com/lampepfl/dotty/blob/master/sbt-dotty/src/dotty/tools/sbtplugin/TastyFileManager.scala to Zinc so that scala-js and others can reuse it instead of reimplementing it?

I think we need something like:

abstract class AuxiliaryClassFileManager extends ClassFileManager {

  /** Given a list of class files, return the list of associated files
   *
   *  Associated files share the same life cycle as their class file.
   *  E.g. if a class file is deleted or restored, its associated files will
   *  be deleted or restored as well.
   */
  protected def associatedFiles(classes: Array[File]): Array[File]
}
@sjrd
Copy link

sjrd commented Aug 17, 2018

Yes, that would be an ideal API for us in Scala.js.

(I think you can make associatedFiles protected rather than public)

@sjrd
Copy link

sjrd commented Aug 17, 2018

Or perhaps even better: just give me one .class file at a time:

protected def associatedFiles(classFile: File): Array[File]

@smarter
Copy link
Contributor

smarter commented Aug 24, 2020

@eed3si9n @dwijnand I'd like to bring attention to this issue again: ClassFileManager in 1.4 now uses VirtualFile and it's not clear to me if that still allows the sbt-dotty and sbt-scalajs plugin to correctly implement a custom ClassFileManager. #902 restores the old API as deprecated which should at least help with migration but doesn't seem like it's a good way forward.

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

Successfully merging a pull request may close this issue.

6 participants