Skip to content

Commit

Permalink
Merge pull request #3405 from Gedochao/feature/bloop-snapshots
Browse files Browse the repository at this point in the history
Allow to use Bloop snapshot versions
  • Loading branch information
Gedochao authored Jan 9, 2025
2 parents 73183b4 + 2bac0d2 commit 51bebb0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ trait Core extends ScalaCliCrossSbtModule
with HasTests
with ScalaCliScalafixModule {
def crossScalaVersion = crossValue

def moduleDeps = Seq(
config(crossScalaVersion)
)
Expand All @@ -378,6 +379,9 @@ trait Core extends ScalaCliCrossSbtModule
super.scalacOptions() ++ asyncScalacOptions(crossScalaVersion)
}

def repositoriesTask =
T.task(super.repositoriesTask() ++ deps.customRepositories)

def ivyDeps = super.ivyDeps() ++ Agg(
Deps.bloopRifle.exclude(("org.scala-lang.modules", "scala-collection-compat_2.13")),
Deps.collectionCompat,
Expand Down
5 changes: 4 additions & 1 deletion modules/build/src/main/scala/scala/build/Bloop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ object Bloop {
val res = value {
Artifacts.artifacts(
Seq(Positioned.none(dep)),
Nil,
Seq(
coursier.Repositories.sonatype("snapshots"),
coursier.Repositories.sonatypeS01("snapshots")
),
Some(params),
logger,
cache.withMessage(s"Downloading compilation server ${dep.version}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,15 @@ class BloopTests extends ScalaCliSuite {
assert(compilationError.contains(message))
}
}

{
val bloopSnapshotVersion = "2.0.6-51-38c118d4-SNAPSHOT"
test(s"compilation works with a Bloop snapshot version: $bloopSnapshotVersion") {
val input = "script.sc"
TestInputs(os.rel / input -> """println("Hello")""").fromRoot { root =>
os.proc(TestUtil.cli, "compile", input, "--bloop-version", bloopSnapshotVersion)
.call(cwd = root)
}
}
}
}

0 comments on commit 51bebb0

Please sign in to comment.