Skip to content

Commit

Permalink
Merge pull request #2512 from tgodzik/fix-ci
Browse files Browse the repository at this point in the history
bugfix: Fix compilation error and make sure cli module is compiled
  • Loading branch information
tgodzik authored Nov 20, 2024
2 parents dd524e6 + 2c3ea28 commit 7bac89a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
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

0 comments on commit 7bac89a

Please sign in to comment.