如何在AutoPlugin中SBT的`publish`任务之前运行自定义任务?

时间:2018-05-17 22:37:45

标签: scala sbt

我有一个名为prePublishCheck的任务,它确保在将JAR发布到Artifactory之前Git工作树不脏,该Artifactory应该在AutoPlugin中的publish任务之前运行。

如何让SBT在publish之前运行此任务?

以下代码至少对sbt 1.1.5无效:

// Has no effect on `publish`
prePublishCheck := { throw new Exception("test") },
publish := (prePublishCheck before publish).value

// Has no effect on `publish`
prePublishCheck := { throw new Exception("test") },
prePublishCheck := (prePublishCheck before publish).value

这些类似的答案已经过时了:

0 个答案:

没有答案