Nick ten Veen
Nick ten Veen

Reputation: 178

SBT task executed twice

I am trying to create a custom SBT task. My problem is that the task is executed twice and the output of the tasks are interleaved, which suggests parallel execution. This is a minified example of the task I am creating:

theproject/project/ModuleTemplate.scala:

object ModuleTemplate extends Build {
  lazy val createModule = inputKey[Unit]("Create a new module")
  override def settings = super.settings ++ Seq(
    createModule := {
      println("creating module...")
      println("interleaved")
    }
  )
}

The output of executing this task in the sbt console (play createModule):

creating module bla...
interleaved
creating module bla...
interleaved

Any idea what is causing this? Thanks in advance

Upvotes: 0

Views: 223

Answers (1)

Nick ten Veen
Nick ten Veen

Reputation: 178

Apparently there was something wrong with either project files from IntelliJ or SBT files messing with the task execution. Anyways, I deleted all files that were generated by SBT and IntelliJ and the problem is solved.

Upvotes: 0

Related Questions