1

In my project I use plugin which exposes task genExport. I can run genExport task from console with:

sbt genExport

My problem is I cannot configure my sbt project to run genExport after project compilation:

lazy val sample:Project = project
  .in(file("sample"))
  .settings(
     MyPluginKeys.someKey := "someKeyValue",
     compile in Compile <<= (compile in Compile) map { x =>
       println("----------")
       // ???
       x
     }
  )
  .enablePlugins(MyPlugin)

From sbt documentation I could not get how to invoke task from plugin by name. I've experimented with:

taskKey[Unit]("genExport").taskValue

without any success. What I'm missing?

4

1 回答 1

1
val genexport = TaskKey[Unit]("genExport")

genExport <<= genExport triggeredBy (compile in Compile) 
于 2016-01-02T06:30:40.910 回答