Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Fix compilation error and make sure cli module is compiled #2512

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
"frontend/test:compile; \
backend/test; \
docs/compile; \
cli/compile; \
bloopRifle/test; \
frontend/testOnly bloop.ScalaVersionsSpec; \
frontend/testOnly -bloop.ScalaVersionsSpec; \
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/scala/bloop/cli/util/Artifacts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object Artifacts {
val maybeCoursierDependencies = {
val seq = dependencies
.map { dep =>
val maybeUrl = dep.userParams.get("url").flatten
val maybeUrl = dep.getUserParam("url")
if (maybeUrl.nonEmpty)
sys.error("unsupported")
dep
Expand Down
17 changes: 13 additions & 4 deletions cli/src/main/scala/bloop/cli/util/CoursierUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ object CoursierUtils {
}
}

implicit class AnyDependencyOps(private val dep: dependency.AnyDependency) extends AnyVal {
def getUserParam(key: String) = {
dep.userParams.collectFirst {
case (`key`, value) => value
}.flatten
}
}

implicit class DependencyOps(private val dep: dependency.Dependency) extends AnyVal {
def toCs: coursier.Dependency = {
val mod = dep.module.toCs
Expand All @@ -36,13 +44,14 @@ object CoursierUtils {
(coursier.Organization(mod.organization), coursier.ModuleName(mod.name))
}
}
for (clOpt <- dep.userParams.get("classifier"); cl <- clOpt)

for (cl <- dep.getUserParam("classifier"))
dep0 = dep0.withPublication(dep0.publication.withClassifier(coursier.core.Classifier(cl)))
for (tpeOpt <- dep.userParams.get("type"); tpe <- tpeOpt)
for (tpe <- dep.getUserParam("type"))
dep0 = dep0.withPublication(dep0.publication.withType(coursier.core.Type(tpe)))
for (extOpt <- dep.userParams.get("ext"); ext <- extOpt)
for (ext <- dep.getUserParam("ext"))
dep0 = dep0.withPublication(dep0.publication.withExt(coursier.core.Extension(ext)))
for (_ <- dep.userParams.get("intransitive"))
for (_ <- dep.getUserParam("intransitive"))
dep0 = dep0.withTransitive(false)
dep0
}
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object Dependencies {
val svm = "org.graalvm.nativeimage" % "svm" % "24.1.1"
val coursier = "io.get-coursier" %% "coursier" % coursierVersion
val coursierJvm = "io.get-coursier" %% "coursier-jvm" % coursierVersion
val dependency = "io.get-coursier" %% "dependency" % "0.2.4"
val dependency = "io.get-coursier" %% "dependency" % "0.3.1"
val scalaCollectionCompat = "org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0"
val shapeless = "com.chuusai" %% "shapeless" % shapelessVersion
val caseApp = "com.github.alexarchambault" %% "case-app" % caseAppVersion
Expand Down
Loading