Specifying scala compiler plugin by project/workspace relative path

38 views
Skip to first unread message

Arthur

unread,
Jul 30, 2017, 12:43:18 PM7/30/17
to Scala IDE User
I'm working with a project which uses a custom macro for building its AST nodes. The macro is written using macroparadise. Currently the project is stored in version control as a eclipse Scala-IDE project (we are trying to change this to use SBT, but that's not gonna happen immediately). We want to include the macro with the project to make building easy without setup.

How do I specify a compiler plugin using a plugin archive or path relative to the project or workspace?

I have tried a range of different things:
  • -Xplugin:OrcScala/lib/paradise_2.12.2-2.1.0.jar
  • -Xpluginsdir OrcScala/lib/
  • -Xplugin:${resource_loc:/OrcScala/lib/paradise_2.12.2-2.1.0.jar}
  • and many other combinations and variations, including providing these options using the builtin Xplugins/etc fields in the advanced tab of the project.
None of these work. The only thing that seems to work is providing the full absolute path. I suspect this is because all the paths are resolve with respect to the current working directory of the project instead of some part of the workspace. Scala-IDE does help me with this in that if I put a relative path in the Xplugin field it will replace it with an absolute path (by prepending the workspace path) when the preferences are OPENED (not when they are closed interestingly). However, it then saves the absolute path in the file meaning that the project configuration will be broken for any other users.

Is there a known way to make this work?

Thanks!
-Arthur


Rafał Krzewski

unread,
Aug 9, 2017, 6:36:10 AM8/9/17
to Scala IDE User
My approach is not storing Eclipse's specific files (.project, .classpath, .settings/) in git, and letting each user generate their own Eclipse configuration using sbt-eclipse or m2eclipse-scala

Regarding the compiler plugins, manual tweaking of generated .settings/org.scala-ide.sdt.core.prefs is need when plugin is compiled for minor (rather than micro) Scala version, because this makes IDE to freak out. I intend to propose a fix for that eventually.

Cheers,
Rafał
Reply all
Reply to author
Forward
0 new messages