我想做一个宏,在编译时验证其他项目中资源的存在。是否可以从上下文中获取此信息?
def example_impl(c: Context): c.Expr[Unit] = {
import c.universe._
//instead of
// val r = this.getClass().getResource("/file.txt")
val r = c.somthing.getResource("/file.txt")
//...
}
这可能是不可能的。但如果是的话,我想知道该怎么做。