sbt - How to finding a zip dependency path? -
in sbt build, i'm fetching zip dependency (previously built sbt-native-packager plugin), published in local ivy repo bundle classifier.
but need dependency path in ivy repo, in order unzip (with io.unzip), put files in , repackage sbt-native-packager.
i'm using artifacts(...) method find artifact , add dependency :
"foo" % "bar" % "1.0-snapshot" artifacts(artifact("bar-bundle", "zip", "zip", "bundle")) but after that, i'm bit lost...
i tried filter out dependencyclasspath find :
val bundlefile = taskkey[file]("bundle's path") val settings = seq(bundlefile <<= dependencyclasspath map { _ filter (_.endswith(".zip"))}) trouble : can't find zip dependency in classpath... i'm doing wrong ?
i'm using sbt 0.13.
zip files aren't on classpath default. types of artifacts included configured classpathtypes. can add "zip" with:
classpathtypes += "zip" it appear on dependencyclasspath.
however, if isn't supposed go on classpath, might pull out of update report directly.
bundlefile := { val report: updatereport = update.value val filter = artifactfilter(name = "bar-bundle", extension = "zip") val all: seq[file] = report.matching(filter) all.headoption getorelse error("could not find bar-bundle") } see documentation on updatereport details.
Comments
Post a Comment