daml/daml-script/export/BUILD.bazel
Stefano Baghino aec3390904
Replace silencer plugin with built-in warning configuration (#12543)
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.

[Here][1] is s a blog post by the Scala team about it.

Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.

Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.

changelog_begin
changelog_end

[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
2022-01-24 15:01:35 +00:00

76 lines
2.3 KiB
Python

# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("@build_environment//:configuration.bzl", "ghc_version")
load(
"//bazel_tools/client_server:client_server_build.bzl",
"client_server_build",
)
load(
"//bazel_tools/sh:sh.bzl",
"sh_inline_test",
)
load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
"da_scala_test",
)
exports_files(["src/main/resources/logback.xml"])
da_scala_binary(
name = "export",
srcs = glob(["src/main/scala/**/*.scala"]),
main_class = "com.daml.script.export.Main",
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:com_github_scopt_scopt",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:io_spray_spray_json",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_typelevel_paiges_core",
"@maven//:io_circe_circe_core",
"@maven//:io_circe_circe_yaml",
],
visibility = ["//visibility:public"],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/data",
"//daml-lf/language",
"//language-support/scala/bindings",
"//language-support/scala/bindings-akka",
"//ledger-api/rs-grpc-bridge",
"//ledger-service/cli-opts",
"//ledger/ledger-api-client",
"//ledger/ledger-api-common",
"//libs-scala/auth-utils",
"@maven//:org_apache_commons_commons_text",
],
)
da_scala_test(
name = "tests",
srcs = glob(["src/test/scala/**/*.scala"]),
data = [
"//ledger/test-common/test-certificates",
],
scala_deps = [
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_freespec",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_typelevel_paiges_core",
],
visibility = ["//visibility:public"],
deps = [
":export",
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/data",
"//daml-lf/language",
"//language-support/scala/bindings",
"//ledger/ledger-api-common",
"//libs-scala/auth-utils",
],
)