File tree Expand file tree Collapse file tree 3 files changed +31
-5
lines changed
bloopgun-core/src/main/scala/bloop/bloopgun
shared/src/main/scala/bloop/io Expand file tree Collapse file tree 3 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package bloop.bloopgun
3
3
import java .nio .file .attribute .PosixFilePermissions
4
4
import java .nio .file .{Files , Path , Paths }
5
5
import scala .util .Properties
6
- import coursierapi .shaded .coursier .cache .shaded .dirs .dev . dirs . ProjectDirectories
6
+ import coursierapi .shaded .coursier .cache .shaded .dirs .{ GetWinDirs , ProjectDirectories }
7
7
8
8
object Defaults {
9
9
val Version = " 0.9.3"
@@ -21,7 +21,20 @@ object Defaults {
21
21
}
22
22
23
23
// also more or less in bloop.io.Paths…
24
- private lazy val projectDirectories = ProjectDirectories .from(" " , " " , " bloop" )
24
+ private lazy val projectDirectories = {
25
+ val getWinDirs : GetWinDirs =
26
+ if (coursierapi.shaded.coursier.paths.Util .useJni())
27
+ new GetWinDirs {
28
+ def getWinDirs (guids : String * ) =
29
+ guids.map { guid =>
30
+ coursierapi.shaded.coursier.jniutils.WindowsKnownFolders
31
+ .knownFolderPath(" {" + guid + " }" )
32
+ }.toArray
33
+ }
34
+ else
35
+ GetWinDirs .powerShellBased
36
+ ProjectDirectories .from(" " , " " , " bloop" , getWinDirs)
37
+ }
25
38
private lazy val bloopCacheDir : Path = Paths .get(projectDirectories.cacheDir)
26
39
private lazy val bloopDataDir : Path = Paths .get(projectDirectories.dataDir)
27
40
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ object Dependencies {
56
56
val libraryManagement = " org.scala-sbt" %% " librarymanagement-ivy" % lmVersion
57
57
val scalazCore = " org.scalaz" %% " scalaz-core" % scalazVersion
58
58
val scalazConcurrent = " org.scalaz" %% " scalaz-concurrent" % scalazVersion
59
- val coursierInterface = " io.get-coursier" % " interface" % " 1.0.4 "
59
+ val coursierInterface = " io.get-coursier" % " interface" % " 1.0.5 "
60
60
val coursierInterfaceSubs = " io.get-coursier" % " interface-svm-subs" % " 1.0.4"
61
61
val scalaXml = " org.scala-lang.modules" %% " scala-xml" % scalaXmlVersion
62
62
val scalaCollectionCompat = " org.scala-lang.modules" %% " scala-collection-compat" % " 2.4.2"
Original file line number Diff line number Diff line change @@ -14,13 +14,26 @@ import java.nio.file.{
14
14
Paths => NioPaths
15
15
}
16
16
import java .util
17
- import coursierapi .shaded .coursier .cache .shaded .dirs .dev . dirs . ProjectDirectories // GetWinDirs
17
+ import coursierapi .shaded .coursier .cache .shaded .dirs .{ GetWinDirs , ProjectDirectories }
18
18
import scala .collection .mutable
19
19
import java .nio .file .NoSuchFileException
20
20
import scala .util .Properties
21
21
22
22
object Paths {
23
- private lazy val projectDirectories = ProjectDirectories .from(" " , " " , " bloop" )
23
+ private lazy val projectDirectories = {
24
+ val getWinDirs : GetWinDirs =
25
+ if (coursierapi.shaded.coursier.paths.Util .useJni())
26
+ new GetWinDirs {
27
+ def getWinDirs (guids : String * ) =
28
+ guids.map { guid =>
29
+ coursierapi.shaded.coursier.jniutils.WindowsKnownFolders
30
+ .knownFolderPath(" {" + guid + " }" )
31
+ }.toArray
32
+ }
33
+ else
34
+ GetWinDirs .powerShellBased
35
+ ProjectDirectories .from(" " , " " , " bloop" , getWinDirs)
36
+ }
24
37
private def createDirFor (filepath : String ): AbsolutePath =
25
38
AbsolutePath (Files .createDirectories(NioPaths .get(filepath)))
26
39
You can’t perform that action at this time.
0 commit comments