Skip to content

Provide a Setting that points to the (eventual) config:packageBin #2348

@fommil

Description

@fommil

Currently the packageBin task is the only way to get hold of the jar output from a project/config. (actually (artifactPath in Compile in packageBin).value would be enough but it amounts to the same).

However, it is often useful to know where the file is going to be without necessarily invoking the compilation (e.g. projects that are compiler plugins and need to be referenced by IDEs, caching strategies).

Proposed implementation:

  val packageBinFile = SettingKey[File](
    "packageBinFile",
    "The (eventual) location of the packageBin."
  )

  def packageBinFileSetting = Def.setting {
    val append = configuration.value match {
      case Compile => ""
      case Test    => "-tests"
      case _       => "-" + configuration.value.name
    }
    crossTarget.value / s"${projectID.value.name}_${scalaBinaryVersion.value}-${projectID.value.revision}$append.jar"
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions