Skip to content

Commit

Permalink
refactor: start using newly published bloop-gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 authored and tgodzik committed Dec 15, 2022
1 parent 75b458f commit 47d10d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions build.sbt
Expand Up @@ -446,6 +446,7 @@ lazy val metals = project
"sbtBloopVersion" -> V.sbtBloop,
"gradleBloopVersion" -> V.gradleBloop,
"mavenBloopVersion" -> V.mavenBloop,
"gradleBloopVersion" -> V.gradleBloop,
"scalametaVersion" -> V.scalameta,
"semanticdbVersion" -> V.semanticdb,
"javaSemanticdbVersion" -> V.javaSemanticdb,
Expand Down Expand Up @@ -648,6 +649,7 @@ lazy val metalsDependencies = project
"com.lihaoyi" % "mill-contrib-testng" % V.mill,
"org.virtuslab.scala-cli" % "cli_3" % V.scalaCli intransitive (),
"ch.epfl.scala" % "bloop-maven-plugin" % V.mavenBloop,
"ch.epfl.scala" %% "gradle-bloop" % V.gradleBloop,
),
)
.disablePlugins(ScalafixPlugin)
Expand Down
Expand Up @@ -6,6 +6,7 @@ import java.nio.file.Path

import scala.util.Properties

import scala.meta.internal.metals.BuildInfo
import scala.meta.internal.metals.UserConfiguration
import scala.meta.io.AbsolutePath

Expand All @@ -14,14 +15,15 @@ case class GradleBuildTool(userConfig: () => UserConfiguration)
with BloopInstallProvider {

private val initScriptName = "init-script.gradle"
private def initScript(versionToUse: String) =
private val gradleBloopVersion = BuildInfo.gradleBloopVersion
private val initScript =
s"""
|initscript {
| repositories{
| mavenCentral()
| }
| dependencies {
| classpath 'ch.epfl.scala:gradle-bloop_2.12:$versionToUse'
| classpath 'ch.epfl.scala:gradle-bloop_2.12:$gradleBloopVersion'
| }
|}
|allprojects {
Expand All @@ -30,8 +32,7 @@ case class GradleBuildTool(userConfig: () => UserConfiguration)
""".stripMargin.getBytes()

private lazy val initScriptPath: Path = {
val bloopVersion = userConfig().currentBloopVersion
Files.write(tempDir.resolve(initScriptName), initScript(bloopVersion))
Files.write(tempDir.resolve(initScriptName), initScript)
}

private lazy val gradleWrapper = {
Expand Down
2 changes: 1 addition & 1 deletion project/V.scala
Expand Up @@ -21,7 +21,7 @@ object V {
val coursierInterfaces = "1.0.11"
val debugAdapter = "3.0.4"
val genyVersion = "0.7.1"
val gradleBloop = bloop
val gradleBloop = "1.5.7-RC1"
val java8Compat = "1.0.2"
val javaSemanticdb = "0.7.4"
val jsoup = "1.15.3"
Expand Down

0 comments on commit 47d10d6

Please sign in to comment.