pathikrit / sauron

Yet another Scala lens macro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sbt gives "macro implementation not found: lens"

simbo1905 opened this issue · comments

when I try to copy the macro file into my simple sbt project. it then follows up with:

(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)

things work fine in Intellij as the IDE will compile the macro first then compile the file where you first use it second. seems like there should be something in the readme about how to handle this? better yet https://github.com/scalamacros/sbt-example is a working sbt with macro example has a build structure to support compilation of the macro before the main code. perhaps you could change your project layout to match?

You should not "copy the macro file". That would never work since macros cannot live in the same project as the your code.

You should use it as a library. If you consult the README, it clearly tells you how to use the macro as a library by adding this to build.sbt:

resolvers += Resolver.bintrayRepo("pathikrit", "maven")

libraryDependencies += "com.github.pathikrit" %% "sauron" % "1.1.0"

addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full)