Skip to content

Commit 65d4cd4

Browse files
Update Scala to 2.12.15
1 parent 3acf4e1 commit 65d4cd4

File tree

11 files changed

+114
-63
lines changed

11 files changed

+114
-63
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package bloop.bloopgun.internal;
2+
3+
// FIXME Copied from shared/src/main/java/bloop/io/internal/ProjDirHelper.java
4+
5+
import coursierapi.shaded.coursier.cache.shaded.dirs.GetWinDirs;
6+
import coursierapi.shaded.coursier.cache.shaded.dirs.ProjectDirectories;
7+
import coursierapi.shaded.coursier.jniutils.WindowsKnownFolders;
8+
import coursierapi.shaded.coursier.paths.Util;
9+
10+
import java.util.ArrayList;
11+
12+
public class ProjDirHelper {
13+
public static String cacheDir() {
14+
return ((ProjectDirectories) get()).cacheDir;
15+
}
16+
public static String dataDir() {
17+
return ((ProjectDirectories) get()).dataDir;
18+
}
19+
// not letting ProjectDirectories leak in the signature, getting weird scalac crashes
20+
// with Scala 2.12.5 (because of shading?)
21+
private static Object get() {
22+
GetWinDirs getWinDirs;
23+
if (Util.useJni()) {
24+
getWinDirs = new GetWinDirs() {
25+
public String[] getWinDirs(String ...guids) {
26+
ArrayList<String> l = new ArrayList<>();
27+
for (int idx = 0; idx < guids.length; idx++) {
28+
l.add(WindowsKnownFolders.knownFolderPath("{" + guids[idx] + "}"));
29+
}
30+
return l.toArray(new String[l.size()]);
31+
}
32+
};
33+
} else {
34+
getWinDirs = GetWinDirs.powerShellBased;
35+
}
36+
return ProjectDirectories.from("", "", "bloop", getWinDirs);
37+
}
38+
}

bloopgun-core/src/main/scala/bloop/bloopgun/Defaults.scala

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package bloop.bloopgun
33
import java.nio.file.attribute.PosixFilePermissions
44
import java.nio.file.{Files, Path, Paths}
55
import scala.util.Properties
6-
import coursierapi.shaded.coursier.cache.shaded.dirs.{GetWinDirs, ProjectDirectories}
76

87
object Defaults {
98
val Version = "0.9.3"
@@ -20,23 +19,10 @@ object Defaults {
2019
val SendThreadWaitTerminationMillis = 5000.toLong
2120
}
2221

23-
// also more or less in bloop.io.Paths…
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)
22+
private lazy val (bloopCacheDir, bloopDataDir) = {
23+
import bloop.bloopgun.internal.ProjDirHelper
24+
(Paths.get(ProjDirHelper.cacheDir()), Paths.get(ProjDirHelper.dataDir()))
3725
}
38-
private lazy val bloopCacheDir: Path = Paths.get(projectDirectories.cacheDir)
39-
private lazy val bloopDataDir: Path = Paths.get(projectDirectories.dataDir)
4026

4127
lazy val daemonDir: Path = {
4228
def defaultDir = {
Binary file not shown.

frontend/src/test/scala/bloop/BuildLoaderSpec.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object BuildLoaderSpec extends BaseSuite {
2424

2525
testLoad("reload if settings are added") { (testBuild, logger) =>
2626
val settings =
27-
WorkspaceSettings.fromSemanticdbSettings("0.2.0", "4.2.0", List(BuildInfo.scalaVersion))
27+
WorkspaceSettings.fromSemanticdbSettings("0.2.0", "4.4.31", List(BuildInfo.scalaVersion))
2828
testBuild.state.build.checkForChange(Some(settings), logger).map {
2929
case Build.ReturnPreviousState =>
3030
sys.error(s"Expected return updated state, got previous state")
@@ -37,7 +37,7 @@ object BuildLoaderSpec extends BaseSuite {
3737
}
3838

3939
val sameSettings =
40-
WorkspaceSettings.fromSemanticdbSettings("0.2.0", "4.2.0", List(BuildInfo.scalaVersion))
40+
WorkspaceSettings.fromSemanticdbSettings("0.2.0", "4.4.31", List(BuildInfo.scalaVersion))
4141

4242
testLoad("do not reload if same settings are added", Some(sameSettings)) { (testBuild, logger) =>
4343
testBuild.state.build.checkForChange(Some(sameSettings), logger).map {
@@ -63,7 +63,7 @@ object BuildLoaderSpec extends BaseSuite {
6363

6464
testLoad("reload if new Java settings are added", Some(sameSettings)) { (testBuild, logger) =>
6565
val newSettings =
66-
WorkspaceSettings.fromSemanticdbSettings("0.1.0", "4.2.0", List(BuildInfo.scalaVersion))
66+
WorkspaceSettings.fromSemanticdbSettings("0.1.0", "4.4.31", List(BuildInfo.scalaVersion))
6767
testBuild.state.build.checkForChange(Some(newSettings), logger).map {
6868
case Build.ReturnPreviousState =>
6969
sys.error(s"Expected return updated state, got previous state")

frontend/src/test/scala/bloop/ConsoleSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object ConsoleSpec extends BaseSuite {
4242
val coursierClasspathArgs =
4343
classpathB.flatMap(elem => Seq("--extra-jars", elem.syntax))
4444
val expectedCommand =
45-
s"coursier launch com.lihaoyi:ammonite_2.12.8:latest.release --main-class ammonite.Main ${coursierClasspathArgs
45+
s"coursier launch com.lihaoyi:ammonite_2.12.15:latest.release --main-class ammonite.Main ${coursierClasspathArgs
4646
.mkString(" ")} ${("--" :: ammArgs).mkString(" ")}"
4747

4848
assertNoDiff(

frontend/src/test/scala/bloop/bsp/BspCompileSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ class BspCompileSpec(
437437
}
438438

439439
// Change the semanticdb jar every time we upgrade Scala version
440-
assert(BuildInfo.scalaVersion == "2.12.8")
440+
assert(BuildInfo.scalaVersion == "2.12.15")
441441
val sourceDir = workspace.resolve("a").resolve("src")
442-
val semanticdbJar = unsafeGetResource("semanticdb_2.12.8-4.1.11.jar")
442+
val semanticdbJar = unsafeGetResource("semanticdb-scalac_2.12.15-4.4.31.jar")
443443
val semanticdbOpts = List(
444444
s"-Xplugin:$semanticdbJar",
445445
"-Yrangepos",

frontend/src/test/scala/bloop/bsp/BspMetalsClientSpec.scala

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object TcpBspMetalsClientSpec extends BspMetalsClientSpec(BspProtocol.Tcp)
3333
class BspMetalsClientSpec(
3434
override val protocol: BspProtocol
3535
) extends BspBaseSuite {
36-
private val testedScalaVersion = "2.12.8"
36+
private val testedScalaVersion = "2.12.15"
3737

3838
override def test(name: String)(fun: => Any): Unit =
3939
super.test(name) {
@@ -46,7 +46,7 @@ class BspMetalsClientSpec(
4646
val projects = List(`A`)
4747
val configDir = TestProject.populateWorkspace(workspace, projects)
4848
val logger = new RecordingLogger(ansiCodesSupported = false)
49-
val semanticdbVersion = "4.2.0"
49+
val semanticdbVersion = "4.4.31"
5050
val extraParams = BloopExtraBuildParams(
5151
ownsBuildFiles = None,
5252
clientClassesRootDir = None,
@@ -61,9 +61,9 @@ class BspMetalsClientSpec(
6161
configDir,
6262
"""|{
6363
| "javaSemanticDBVersion": "0.5.7",
64-
| "semanticDBVersion": "4.2.0",
64+
| "semanticDBVersion": "4.4.31",
6565
| "supportedScalaVersions": [
66-
| "2.12.8"
66+
| "2.12.15"
6767
| ]
6868
|}
6969
|""".stripMargin
@@ -75,7 +75,7 @@ class BspMetalsClientSpec(
7575
|-P:semanticdb:failures:warning
7676
|-P:semanticdb:sourceroot:$workspace
7777
|-P:semanticdb:synthetics:on
78-
|-Xplugin:semanticdb-scalac_2.12.8-4.2.0.jar
78+
|-Xplugin:semanticdb-scalac_2.12.15-4.4.31.jar
7979
|-Yrangepos
8080
|""".stripMargin
8181
)
@@ -91,7 +91,7 @@ class BspMetalsClientSpec(
9191

9292
test("do not initialize metals client and save settings with unsupported scala version") {
9393
TestUtil.withinWorkspace { workspace =>
94-
val semanticdbVersion = "4.2.0" // Doesn't support 2.12.4
94+
val semanticdbVersion = "4.4.31" // Doesn't support 2.12.4
9595
val `A` = TestProject(workspace, "A", Nil, scalaVersion = Some("2.12.4"))
9696
val projects = List(`A`)
9797
val configDir = TestProject.populateWorkspace(workspace, projects)
@@ -100,7 +100,7 @@ class BspMetalsClientSpec(
100100
ownsBuildFiles = None,
101101
clientClassesRootDir = None,
102102
semanticdbVersion = Some(semanticdbVersion),
103-
supportedScalaVersions = Some(List("2.12.8")),
103+
supportedScalaVersions = Some(List("2.12.15")),
104104
javaSemanticdbVersion = Some("0.5.7")
105105
)
106106

@@ -109,9 +109,9 @@ class BspMetalsClientSpec(
109109
configDir,
110110
"""|{
111111
| "javaSemanticDBVersion": "0.5.7",
112-
| "semanticDBVersion": "4.2.0",
112+
| "semanticDBVersion": "4.4.31",
113113
| "supportedScalaVersions": [
114-
| "2.12.8"
114+
| "2.12.15"
115115
| ]
116116
|}
117117
|""".stripMargin
@@ -125,7 +125,7 @@ class BspMetalsClientSpec(
125125

126126
test("initialize metals client in workspace with already enabled semanticdb") {
127127
TestUtil.withinWorkspace { workspace =>
128-
val pluginPath = s"-Xplugin:path-to-plugin/semanticdb-scalac_2.12.8-4.2.0.jar.jar"
128+
val pluginPath = s"-Xplugin:path-to-plugin/semanticdb-scalac_2.12.15-4.4.31.jar.jar"
129129
val defaultScalacOptions = List(
130130
"-P:semanticdb:failures:warning",
131131
s"-P:semanticdb:sourceroot:$workspace",
@@ -144,7 +144,7 @@ class BspMetalsClientSpec(
144144
val projects = List(`A`)
145145
val configDir = TestProject.populateWorkspace(workspace, projects)
146146
val logger = new RecordingLogger(ansiCodesSupported = false)
147-
val semanticdbVersion = "4.2.0"
147+
val semanticdbVersion = "4.4.31"
148148
val extraParams = BloopExtraBuildParams(
149149
ownsBuildFiles = None,
150150
clientClassesRootDir = None,
@@ -158,9 +158,9 @@ class BspMetalsClientSpec(
158158
configDir,
159159
"""|{
160160
| "javaSemanticDBVersion": "0.5.7",
161-
| "semanticDBVersion": "4.2.0",
161+
| "semanticDBVersion": "4.4.31",
162162
| "supportedScalaVersions": [
163-
| "2.12.8"
163+
| "2.12.15"
164164
| ]
165165
|}
166166
|""".stripMargin
@@ -183,7 +183,7 @@ class BspMetalsClientSpec(
183183
"-P:semanticdb:failures:warning",
184184
"-P:semanticdb:synthetics:on",
185185
"-Xplugin-require:semanticdb",
186-
s"-Xplugin:path-to-plugin/semanticdb-scalac_2.12.8-4.2.0.jar.jar",
186+
s"-Xplugin:path-to-plugin/semanticdb-scalac_2.12.15-4.4.31.jar.jar",
187187
"-Yrangepos"
188188
)
189189
val `A` = TestProject(
@@ -196,7 +196,7 @@ class BspMetalsClientSpec(
196196
val projects = List(`A`)
197197
val configDir = TestProject.populateWorkspace(workspace, projects)
198198
val logger = new RecordingLogger(ansiCodesSupported = false)
199-
val semanticdbVersion = "4.2.0"
199+
val semanticdbVersion = "4.4.31"
200200
val extraParams = BloopExtraBuildParams(
201201
ownsBuildFiles = None,
202202
clientClassesRootDir = None,
@@ -210,9 +210,9 @@ class BspMetalsClientSpec(
210210
configDir,
211211
"""|{
212212
| "javaSemanticDBVersion": "0.5.7",
213-
| "semanticDBVersion": "4.2.0",
213+
| "semanticDBVersion": "4.4.31",
214214
| "supportedScalaVersions": [
215-
| "2.12.8"
215+
| "2.12.15"
216216
| ]
217217
|}
218218
|""".stripMargin
@@ -226,7 +226,7 @@ class BspMetalsClientSpec(
226226

227227
test("should save workspace settings with cached build") {
228228
TestUtil.withinWorkspace { workspace =>
229-
val semanticdbVersion = "4.2.0"
229+
val semanticdbVersion = "4.4.31"
230230
val javaSemanticdbVersion = "0.5.7"
231231
val extraParams = BloopExtraBuildParams(
232232
ownsBuildFiles = None,
@@ -303,7 +303,7 @@ class BspMetalsClientSpec(
303303

304304
val javaNormalClientsVersion = "0.5.7"
305305
val javaMetalsVersion = "0.1.0"
306-
val normalClientsVersion = "4.2.0"
306+
val normalClientsVersion = "4.4.31"
307307
val metalsClientVersion = "4.1.11"
308308
val client1 = createClient(javaNormalClientsVersion, normalClientsVersion)
309309
val client2 = createClient(javaNormalClientsVersion, normalClientsVersion)
@@ -329,7 +329,7 @@ class BspMetalsClientSpec(
329329
val logger = new RecordingLogger(ansiCodesSupported = false)
330330
WorkspaceSettings.writeToFile(
331331
configDir,
332-
WorkspaceSettings.fromSemanticdbSettings("0.5.7", "4.2.0", List(testedScalaVersion)),
332+
WorkspaceSettings.fromSemanticdbSettings("0.5.7", "4.4.31", List(testedScalaVersion)),
333333
logger
334334
)
335335
loadBspState(workspace, projects, logger) { state =>
@@ -349,7 +349,7 @@ class BspMetalsClientSpec(
349349
val logger = new RecordingLogger(ansiCodesSupported = false)
350350
WorkspaceSettings.writeToFile(
351351
configDir,
352-
WorkspaceSettings.fromSemanticdbSettings("0.5.7", "4.1.11", List(testedScalaVersion)),
352+
WorkspaceSettings.fromSemanticdbSettings("0.5.7", "4.4.31", List(testedScalaVersion)),
353353
logger
354354
)
355355
loadBspState(workspace, projects, logger) { state =>
@@ -455,7 +455,7 @@ class BspMetalsClientSpec(
455455
val extraParams = BloopExtraBuildParams(
456456
ownsBuildFiles = None,
457457
clientClassesRootDir = None,
458-
semanticdbVersion = Some("4.2.0"),
458+
semanticdbVersion = Some("4.4.31"),
459459
supportedScalaVersions = Some(List(testedScalaVersion)),
460460
javaSemanticdbVersion = Some("0.5.7")
461461
)

project/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package build
22

33
object Dependencies {
4-
val Scala212Version = "2.12.8"
4+
val Scala212Version = "2.12.15"
55

66
// Keep in sync in BloopComponentCompiler
77
val zincVersion = "1.3.0-M4+47-d881fa2f"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package bloop.io.internal;
2+
3+
// FIXME Also in bloopgun-core/src/main/java/bloop/bloopgun/internal/ProjDirHelper.java
4+
5+
import coursierapi.shaded.coursier.cache.shaded.dirs.GetWinDirs;
6+
import coursierapi.shaded.coursier.cache.shaded.dirs.ProjectDirectories;
7+
import coursierapi.shaded.coursier.jniutils.WindowsKnownFolders;
8+
import coursierapi.shaded.coursier.paths.Util;
9+
10+
import java.util.ArrayList;
11+
12+
public class ProjDirHelper {
13+
public static String cacheDir() {
14+
return ((ProjectDirectories) get()).cacheDir;
15+
}
16+
public static String dataDir() {
17+
return ((ProjectDirectories) get()).dataDir;
18+
}
19+
// not letting ProjectDirectories leak in the signature, getting weird scalac crashes
20+
// with Scala 2.12.5 (because of shading?)
21+
private static Object get() {
22+
GetWinDirs getWinDirs;
23+
if (Util.useJni()) {
24+
getWinDirs = new GetWinDirs() {
25+
public String[] getWinDirs(String ...guids) {
26+
ArrayList<String> l = new ArrayList<>();
27+
for (int idx = 0; idx < guids.length; idx++) {
28+
l.add(WindowsKnownFolders.knownFolderPath("{" + guids[idx] + "}"));
29+
}
30+
return l.toArray(new String[l.size()]);
31+
}
32+
};
33+
} else {
34+
getWinDirs = GetWinDirs.powerShellBased;
35+
}
36+
return ProjectDirectories.from("", "", "bloop", getWinDirs);
37+
}
38+
}

0 commit comments

Comments
 (0)