ohnosequences / nice-sbt-settings

sbt plugin with common settings for all era7/ohnosequences releases
GNU Affero General Public License v3.0
10 stars 2 forks source link

Provide fat-jar url as a constant #38

Closed laughedelic closed 9 years ago

laughedelic commented 9 years ago

Putting this in every statika-distribution project is quite clumsy:

// mvn: "[organisation]/[module]_[scalaVersion]/[revision]/[artifact]-[revision]-[classifier].[ext]"
// ivy: "[organisation]/[module]_[scalaVersion]/[revision]/[type]s/[artifact]-[classifier].[ext]"
val fatUrl = Def.setting {
  val isMvn = publishMavenStyle.value
  val scalaV = "_"+scalaBinaryVersion.value
  val module = moduleName.value + scalaV
  val artifact =
    (if (isMvn) "" else "jars/") +
    module +
    (if (isMvn) "-"+version.value else "") +
    "-fat" +
    ".jar"

  Seq(
    publishS3Resolver.value.url,
    organization.value,
    module,
    version.value,
    artifact
  ).mkString("/")
}

As we know all this in advance, we could provide it as a constant which is imported together with the assembly-related settings. It could be also a setting, but I don't know how to change where sbt publishes all the artifacts.

laughedelic commented 9 years ago

in the end made it a setting, because it refers to other settings. if you change this setting, don't complain :expressionless: