sbt illegal dynamic reference in runMain
问题 I'm trying to run a code generator, and passing it the filename to write the output: resourceGenerators in (proj, Compile) += Def.task { val file = (resourceManaged in (proj, Compile)).value / "swagger.yaml" (runMain in (proj, Compile)).toTask(s"api.swagger.SwaggerDump $file").value Seq(file) }.value However, this gives me: build.sbt:172: error: Illegal dynamic reference: file (runMain in (proj, Compile)).toTask(s"api.swagger.SwaggerDump $file").value 回答1: Your code snippet has two problems: