mirror of https://github.com/sbt/sbt.git
Update PublishBinPlugin to current sbt
This commit is contained in:
parent
dbbba67d36
commit
9d808a389c
|
|
@ -5,14 +5,12 @@ import sbt.librarymanagement.ConfigRef
|
|||
|
||||
/** This local plugin provides ways of publishing just the binary jar. */
|
||||
object PublishBinPlugin extends AutoPlugin {
|
||||
override def requires = plugins.JvmPlugin
|
||||
override def trigger = allRequirements
|
||||
|
||||
object autoImport {
|
||||
val publishLocalBin = taskKey[Unit]("")
|
||||
val publishLocalBinConfig = taskKey[PublishConfiguration]("")
|
||||
}
|
||||
|
||||
import autoImport._
|
||||
|
||||
override def globalSettings = Seq(publishLocalBin := (()))
|
||||
|
|
@ -20,22 +18,17 @@ object PublishBinPlugin extends AutoPlugin {
|
|||
override def projectSettings = Def settings (
|
||||
publishLocalBin := Classpaths.publishTask(publishLocalBinConfig, deliverLocal).value,
|
||||
publishLocalBinConfig := {
|
||||
val _ = deliverLocal.value
|
||||
Classpaths.publishConfig(
|
||||
publishMavenStyle.value,
|
||||
deliverPattern(crossTarget.value),
|
||||
false, // publishMavenStyle.value,
|
||||
Classpaths.deliverPattern(crossTarget.value),
|
||||
if (isSnapshot.value) "integration" else "release",
|
||||
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
|
||||
(packagedArtifacts in publishLocalBin).value.toVector,
|
||||
(checksums in publishLocalBin).value.toVector,
|
||||
resolverName = "local",
|
||||
logging = ivyLoggingLevel.value,
|
||||
overwrite = isSnapshot.value
|
||||
)
|
||||
},
|
||||
packagedArtifacts in publishLocalBin := Classpaths.packaged(Seq(packageBin in Compile)).value
|
||||
)
|
||||
|
||||
def deliverPattern(outputPath: File): String =
|
||||
(outputPath / "[artifact]-[revision](-[classifier]).[ext]").absolutePath
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue