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

Cut dependency on scala-compiler and scala-reflect #495

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

dwijnand
Copy link
Collaborator

@dwijnand dwijnand commented Apr 28, 2020

MiMa has historically depended on scala-compiler, without fully
cross-building too(!) making it a bit of risk - see DeprecatedPathApis
as an example. However, it only uses:

  • classpath things
  • Settings, to make classpaths (& log levels but not really)
  • ClassfileConstants, which are part of the Java spec anyways
  • scala-reflect's AbstractFile, as a part of ClassPath's API

MiMa also uses scala.reflect.NameTransformer, but that turns out to
actually be in scala-library. :-O

So I made subset copies of AbstractFile (AbsFile), ClassPath and
ClassfileConstants, making use of java.nio instead of java.io.File and
java.util.zip.

Turns out there are classpath things available in and around
javax.tools.JavaCompiler, but I'll leave that for a second pass.

Fixes #193, btw. Not that it's open...

Copy link
Contributor

@raboof raboof left a comment

Choose a reason for hiding this comment

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

Wow that's a cool cleanup!

@dwijnand
Copy link
Collaborator Author

Well, I wasn't running the (stupidly slow) scripted tests. Serves me right:

[error]  Cause of test exception: {line 13}  Command succeeded but failure was expected

MiMa has historically depended on scala-compiler, without fully
cross-building too(!) making it a bit of risk - see DeprecatedPathApis
as an example.  However, it only uses:

* classpath things
* Settings, to make classpaths (& log levels but not really)
* ClassfileConstants, which are part of the Java spec anyways
* scala-reflect's AbstractFile, as a part of ClassPath's API

MiMa also uses `scala.reflect.NameTransformer`, but that turns out to
actually be in scala-library. :-O

So I made subset copies of AbstractFile (AbsFile), ClassPath and
ClassfileConstants, making use of java.nio instead of java.io.File and
java.util.zip.

Turns out there are classpath things available in and around
`javax.tools.JavaCompiler`, but I'll leave that for a second pass.
@mergify mergify bot merged commit 6477e67 into lightbend-labs:master Apr 30, 2020
@dwijnand dwijnand deleted the no-nsc branch April 30, 2020 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Deal with dependency on scala.tools.nsc code
2 participants