我该如何使用sbt.IO?

时间:2013-08-16 21:29:34

标签: scala sbt

我注意到许多Scala项目使用sbt.IO,它具有出色的文件系统和IO实用程序

E.g。有用的东西,如:

def gzip(in: File, out: File)
def download(url: URL, to: File)
def copyDirectory(source: File, target: File, overwrite: Boolean = false, preserveLastModified: Boolean = false):

然而,我在官方的任何一个maven回购中都找不到它(有趣的是),我错过了什么?

1 个答案:

答案 0 :(得分:12)

Scala2.9

resolvers += Resolver.url("typesafe", url("http://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns)

libraryDependencies += "org.scala-sbt" % "io" % "0.12.4"

scalaVersion := "2.9.3"

Scala2.10

resolvers += Resolver.url("typesafe", url("http://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns)

libraryDependencies += "org.scala-sbt" % "io" % "0.13.9"

scalaVersion := "2.10.6"

Scala2.11

resolvers += Resolver.url("typesafe", url("http://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns)

libraryDependencies += "org.scala-sbt" %% "io" % "0.13.9"

scalaVersion := "2.11.7"