Sbt 修改deliverLocal任务生成的常春藤文件的名称

Sbt 修改deliverLocal任务生成的常春藤文件的名称,sbt,Sbt,在SBT 0.13中,修改SBT deliverLocal任务生成的常春藤文件名(文件名模式)的最简单方法是什么?我想从文件名中删除版本号,例如ivy.xml,而不是ivy-0.1-SNAPSHOT.xml。我还希望将它应用到我构建的其他项目中。我不想在发布时修改常春藤文件的名称,只想在传递到项目的目标目录时修改 目前,我发现以下方法很有效,但这是过分的、丑陋的和枯燥的: def deliverPattern(outputPath: File): String = (outputPath / "

在SBT 0.13中,修改SBT deliverLocal任务生成的常春藤文件名(文件名模式)的最简单方法是什么?我想从文件名中删除版本号,例如
ivy.xml
,而不是
ivy-0.1-SNAPSHOT.xml
。我还希望将它应用到我构建的其他项目中。我不想在发布时修改常春藤文件的名称,只想在传递到项目的目标目录时修改

目前,我发现以下方法很有效,但这是过分的、丑陋的和枯燥的:

def deliverPattern(outputPath: File): String = (outputPath / "[artifact](-[classifier]).[ext]").absolutePath

def deliverConfig(outputDirectory: File, status: String = "release", logging: UpdateLogging.Value = UpdateLogging.DownloadOnly) =
  new DeliverConfiguration(deliverPattern(outputDirectory), status, None, logging)

deliverLocalConfiguration := deliverConfig(crossTarget.value, status = if (isSnapshot.value) "integration" else "release", logging = ivyLoggingLevel.value)
更新

我简化了上面的内容,以引用现有deliverLocalConfiguration中的值。我当前的工作解决方案如下所示:

deliverLocalConfiguration := {
  val dlc = deliverLocalConfiguration.value
  new DeliverConfiguration((crossTarget.value / "[artifact].[ext]").absolutePath, dlc.status, dlc.configurations, dlc.logging)
}

我把它放在
Common.scala
中,并在我所有项目的sbt文件中引用它。

您可能想将它添加到
~/.sbt/0.13/global.sbt