Skip to content

Commit 0b8bfef

Browse files
committed
use scala-collection-compat for scala 2.12-
1 parent e93cbdc commit 0b8bfef

File tree

4 files changed

+10
-411
lines changed

4 files changed

+10
-411
lines changed

build.sc

+8-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ object Deps {
3535
val acyclic = ivy"com.lihaoyi:::acyclic:0.3.6"
3636
val jna = ivy"net.java.dev.jna:jna:5.13.0"
3737
val geny = ivy"com.lihaoyi::geny::1.0.0"
38+
val scalaCollectionCompat = ivy"org.scala-lang.modules::scala-collection-compat::2.9.0"
3839
val sourcecode = ivy"com.lihaoyi::sourcecode::0.3.0"
3940
val utest = ivy"com.lihaoyi::utest::0.8.1"
4041
def scalaLibrary(version: String) = ivy"org.scala-lang:scala-library:${version}"
@@ -173,9 +174,13 @@ trait OsLibTestModule extends ScalaModule with TestModule.Utest with SafeDeps {
173174

174175
trait OsModule extends OsLibModule {
175176
override def artifactName = "os-lib"
176-
override def ivyDeps = Agg(
177-
Deps.geny
178-
)
177+
override def ivyDeps = T {
178+
val scalaV = scalaVersion()
179+
if (scalaV.startsWith("2.11") || scalaV.startsWith("2.12")) {
180+
// include collection compat, mostly for a backported scala.util.Using
181+
Agg(Deps.geny, Deps.scalaCollectionCompat)
182+
} else Agg(Deps.geny)
183+
}
179184
}
180185

181186
trait WatchModule extends OsLibModule {

os/src/TempOps.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package os
22

33
import java.nio.file.attribute.{FileAttribute, PosixFilePermissions}
4-
import os.util.Using
4+
import scala.util.Using
55

66
/**
77
* Create temporary files and directories. [[withFile]] and [[withDir]]

0 commit comments

Comments
 (0)