Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created July 13, 2013 06:19
Show Gist options
  • Select an option

  • Save pedrofurla/5989637 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/5989637 to your computer and use it in GitHub Desktop.
source file
def source:String = macro sourceImpl
def sourceImpl(c:Context) = {
import c.universe._
c.Expr[String](Literal(Constant(c.enclosingUnit.source.file.canonicalPath)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment