sbt 0.11.2 how to combine ~copy-resources with ~aux-compile

爱⌒轻易说出口 提交于 2019-12-03 00:45:39

You can create your own task that calls/depends on aux-compile and copy-resources

import sbt._
import Keys._
import com.github.siasia._
import PluginKeys._

object SampleProject extends Build {

  val sampleTask = TaskKey[Unit]("combined")

  val setngs = Seq(
    sampleTask <<= (copyResources in Compile, auxCompile in Compile) map {
      (c, p) =>
    }
  )

  val root = Project("root", file(".")) settings(setngs:_*)

  override val projects = Seq(root)

}

,and call the new task continuously

~combined

~ accepts any command as an argument, including a command list:

~ ;copy-resources;aux-compile

This will run copy-resources and then aux-compile on each trigger.

I prefer Vasil's solution in this case, however, because it only requires one evaluation of the task graph.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!