Skip to content

Support for passing git version as a argument to runMain? #143

Closed Answered by lefou
KireinaHoro asked this question in Q&A
Discussion options

You must be logged in to vote

Since the version comes from a target, you need a run-version that has receives a Task for the run arguments. Unfortunatelly, runMain isn't one of them (only in the next major Mill version, due to compatibility reasons). Either you use run or the underlying runForkedTask.

  def generateVerilog = T {
    gen.runForkedTask(
      mainClass = T.task { "pionic.GenEngineVerilog" },
      args = T.task { 
        val v = gitVersion()
        Args("--name", variant, "--version", v) 
      }
    )()

    Seq("NicEngine_ips.v", "NicEngine.v", "NicEngine.xdc").map(fn => PathRef(generatedSourcesPath / fn))
  }

I'm referring to Mill 0.11.7-70-654f58

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@KireinaHoro
Comment options

@KireinaHoro
Comment options

@lefou
Comment options

@KireinaHoro
Comment options

Answer selected by KireinaHoro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #142 on April 29, 2024 06:51.