Skip to content

What's the right way to make a Command with parameters from other targets? #1239

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

You must be logged in to vote

The issue is, that you can't call another task in the parameter list of the command.

The solution is, to move the task execution (actually, it's only a dependency and a reference to the outcome) into the shared task.

def scpUp(localPathTask: Task[Path], remotePath: String): Task[CommandResult] = T.task { 
  val localPath: Path = localPathTask()
  // scp command here... 
}

scpUp(T.task{ assembly().path }, s"${artifactName()}.jar")()

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by dwalend
Comment options

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

@lefou
Comment options

@dwalend
Comment options

@lefou
Comment options

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