Skip to content

Commit

Permalink
Fix the remaining default providers in setup_scala_toolchain (#1577)
Browse files Browse the repository at this point in the history
These should also point to Scala version-specific artifacts.
See previous PR: #1561
  • Loading branch information
aszady authored May 15, 2024
1 parent fa23848 commit e2fe29c
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions scala/private/macros/setup_scala_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,23 @@ def setup_scala_toolchain(
deps = scala_macro_classpath,
)

if scala_xml_deps != None:
declare_deps_provider(
name = scala_xml_provider,
deps_id = "scala_xml",
visibility = visibility,
deps = scala_xml_deps,
)
else:
scala_xml_provider = "@io_bazel_rules_scala//scala:scala_xml_provider"
if scala_xml_deps == None:
scala_xml_deps = default_deps("scala_xml", scala_version)
declare_deps_provider(
name = scala_xml_provider,
deps_id = "scala_xml",
visibility = visibility,
deps = scala_xml_deps,
)

if parser_combinators_deps != None:
declare_deps_provider(
name = parser_combinators_provider,
deps_id = "parser_combinators",
visibility = visibility,
deps = parser_combinators_deps,
)
else:
parser_combinators_provider = "@io_bazel_rules_scala//scala:parser_combinators_provider"
if parser_combinators_deps == None:
parser_combinators_deps = default_deps("parser_combinators", scala_version)
declare_deps_provider(
name = parser_combinators_provider,
deps_id = "parser_combinators",
visibility = visibility,
deps = parser_combinators_deps,
)

dep_providers = [
scala_xml_provider,
Expand All @@ -78,17 +76,15 @@ def setup_scala_toolchain(
]

if enable_semanticdb == True:
if semanticdb_deps != None:
declare_deps_provider(
name = semanticdb_deps_provider,
deps_id = "semanticdb",
deps = [semanticdb_deps],
visibility = visibility,
)

dep_providers.append(semanticdb_deps_provider)
else:
dep_providers.append("@io_bazel_rules_scala//scala:semanticdb_provider")
if semanticdb_deps == None:
semanticdb_deps = default_deps("semanticdb", scala_version)
declare_deps_provider(
name = semanticdb_deps_provider,
deps_id = "semanticdb",
deps = semanticdb_deps,
visibility = visibility,
)
dep_providers.append(semanticdb_deps_provider)

scala_toolchain(
name = "%s_impl" % name,
Expand Down

0 comments on commit e2fe29c

Please sign in to comment.