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

How to install compiler plugin and full cross-version Scala dependencies? #2

Closed
olafurpg opened this issue Jan 20, 2019 · 2 comments
Closed

Comments

@olafurpg
Copy link

Hi, congratulations on the release and great job with the seed UX and documentation. I was able to get up and running in seconds. I have two questions:

  • How do I add a compiler plugin? For example, what is the equivalent of addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full) in sbt? A workaround is to manually download the jar and update scalaOptions
scalaOptions = [
  "-encoding",
  "UTF-8",
  "-unchecked",
  "-deprecation",
  "-Xfuture",
+  "-Xplugin:/Users/olafurpg/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalamacros/paradise_2.12.8/2.1.1/paradise_2.12.8-2.1.1.jar"
]
  • How do I add Scala dependencies that are cross-versioned against the full Scala compiler version? A workaround is to update javaDeps like this
+ javaDeps = [
+   ["org.scalameta", "interactive_2.12.8", "4.1.0"]
+ ]
@olafurpg olafurpg changed the title How to install compiler plugin and full-cross version Scala dependencies? How to install compiler plugin and full cross-version Scala dependencies? Jan 20, 2019
@tindzk
Copy link
Owner

tindzk commented Jan 21, 2019

Thanks for positive feedback and bringing up these issues, @olafurpg!

How do I add a compiler plugin?

There is no syntax yet for defining compiler plug-ins. For the Scala.js and Scala Native, the logic was hard-coded. But for Macro Paradise and other plug-ins, we need a more generic approach such as:

compilerDeps = [
  ["org.scalamacros", "paradise", "2.1.1", "full"]
]

This would behave like scalaDeps, but also add the -Xplugin parameter.

How do I add Scala dependencies that are cross-versioned against the full Scala compiler version? A workaround is to update javaDeps like this

I was not aware of this use case. We could add a fourth parameter which defaults to binary to retain the current behaviour. Then, you could write:

scalaDeps = [
  ["org.scalameta", "interactive", "4.1.0", "full"]
]

This should not be too hard to implement since the logic is already in place and only needs to be exposed in the TOML format.

@tindzk
Copy link
Owner

tindzk commented Feb 1, 2019

I implemented both features in #8 and #9. Feel free to try the latest snapshot version and report any issues you encounter.

@tindzk tindzk closed this as completed Feb 1, 2019
@megri megri mentioned this issue Jul 29, 2019
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

No branches or pull requests

2 participants