Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use sbt.IO?

Tags:

scala

sbt

I've noticed that many Scala projects use sbt.IO which has great file system and IO utilities

E.g. useful things like:

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

However I couldn't find it (funnily enough) in any maven repo officially, what am I missing?

like image 543
Eran Medan Avatar asked Aug 16 '13 21:08

Eran Medan


People also ask

What is the use of sbt?

sbt is an open-source build tool for Scala and Java projects, similar to Apache's Maven and Ant. Its main features are: Native support for compiling Scala code and integrating with many Scala test frameworks. Continuous compilation, testing, and deployment.

Can sbt build Java?

SBT can build both Scala and Java code out of the box, but with Maven you need to add plugins to build Scala. SBT integrates with the Scala REPL making it easy to run commands against your project code.


1 Answers

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"
like image 91
Kenji Yoshida Avatar answered Oct 16 '22 01:10

Kenji Yoshida