The following steps executed in order will;
- create the project file structure
- set the sbt version
- add the gen-idea sbt plugin (if you want to import your project into intellij)
- create an sbt build, that builds the macros project prior to the macrostest project (so the regex macro is usable in the macrostest project)
- create the macros project scala file
- create the macrostest project scala file
- compile the two projects
- fail compilation of macrotest, as the invalid regex [a-z is created compile time by the regex macro
Versions:
- scala 2.11.0-SNAPSHOT (from org.scala-lang.macro-paradise)
- sbt 0.12.1
- gen-idea 1.2.0
References:
Added a repo holding an updated version of whats in this gist https://github.com/torgeir/scala-macros-tutorial-using-sbt. Uses quasiquotes and shows how showRaw can ease debugging.