daml/navigator/backend/BUILD.bazel
Moritz Kiefer 76b6fd86fb
Upgrade Scala dependencies for 2.13 compatibility (#8268)
* Upgrade Scala dependencies for 2.13 compatibility

This upgrades a bunch of Scala libraries to versions that have 2.13
support. There are two libraries that are still missing:

- diffson, this has a new version but with significant breaking
  changes and it is only used in Naigator console which I hope to kill
  before I have to worry about this.

- ai.x:diff, this is used in the ledger API test tool. The library is
  abondened but there are a few alternatives.

changelog_begin
changelog_end

* Fix pureconfig

changelog_begin
changelog_end

* Fix Navigator

changelog_begin
changelog_end
2020-12-14 09:59:00 +01:00

199 lines
6.5 KiB
Python

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
"da_scala_library",
"da_scala_test_suite",
)
navigator_scalacopts = [
"-Xelide-below",
"CONFIG",
]
# All frontend resource files.
# These come in a manually created JAR file, this rule is just wrapping it in
# a java_import, so that it is a valid target for the 'resources' property of
# scala_binary.
java_import(
name = "frontend-resources",
jars = [
"//navigator/frontend:frontend.jar",
],
visibility = ["//visibility:public"],
)
# Static backend resources.
java_library(
name = "backend-resources",
resources = glob(["src/main/resources/**/*"]),
visibility = ["//visibility:public"],
)
da_scala_library(
name = "navigator-library",
srcs = glob([
"src/main/scala/**/*.scala",
]),
scalacopts = navigator_scalacopts,
silent_annotations = True,
visibility = ["//visibility:public"],
runtime_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_typesafe_akka_akka_slf4j_2_12",
"@maven//:org_xerial_sqlite_jdbc",
],
deps = [
"//daml-assistant/scala-daml-project-config",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/language",
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//ledger-api/rs-grpc-akka",
"//ledger-api/rs-grpc-bridge",
"//ledger-service/lf-value-json",
"//ledger/ledger-api-client",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//libs-scala/build-info",
"//libs-scala/grpc-utils",
"@maven//:com_chuusai_shapeless_2_12",
"@maven//:com_github_pureconfig_pureconfig_core_2_12",
"@maven//:com_github_pureconfig_pureconfig_generic_2_12",
"@maven//:com_github_scopt_scopt_2_12",
"@maven//:com_lihaoyi_sourcecode_2_12",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_http_2_12",
"@maven//:com_typesafe_akka_akka_http_core_2_12",
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_netty_netty_handler",
"@maven//:io_spray_spray_json_2_12",
"@maven//:org_gnieh_diffson_core_2_12",
"@maven//:org_gnieh_diffson_spray_json_2_12",
"@maven//:org_jline_jline",
"@maven//:org_sangria_graphql_sangria_2_12",
"@maven//:org_sangria_graphql_sangria_marshalling_api_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_tpolecat_doobie_core_2_12",
"@maven//:org_tpolecat_doobie_free_2_12",
"@maven//:org_typelevel_cats_core_2_12",
"@maven//:org_typelevel_cats_effect_2_12",
"@maven//:org_typelevel_cats_free_2_12",
"@maven//:org_typelevel_cats_kernel_2_12",
],
)
da_scala_library(
name = "navigator-tests-library",
srcs = glob(
["src/test/**/*.scala"],
exclude = [
"src/test/**/*Spec.scala",
"src/test/**/*Test.scala",
],
),
scalacopts = navigator_scalacopts,
runtime_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_typesafe_akka_akka_stream_testkit_2_12",
"@maven//:io_grpc_grpc_netty",
"@maven//:org_xerial_sqlite_jdbc",
],
deps = [
":navigator-library",
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//ledger-service/lf-value-json",
"//ledger/ledger-api-common",
"@maven//:org_scalaz_scalaz_core_2_12",
],
)
da_scala_binary(
name = "navigator-binary",
main_class = "com.daml.navigator.NavigatorBackend",
tags = [
"maven_coordinates=com.daml:navigator:__VERSION__",
"no_scala_version_suffix",
],
visibility = [
"//visibility:public",
],
deps = [
":backend-resources",
":frontend-resources",
":navigator-library",
],
)
# Static test resources.
java_library(
name = "test-resources",
resources = glob(["src/test/resources/**/*"]),
)
da_scala_test_suite(
name = "navigator-scala-tests",
size = "small",
srcs = glob([
"src/test/**/*Spec.scala",
"src/test/**/*Test.scala",
]),
data = ["//ledger/test-common:dar-files"],
scalacopts = navigator_scalacopts,
deps = [
":navigator-library",
":navigator-tests-library",
":test-resources",
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger-service/lf-value-json",
"//ledger/ledger-api-auth",
"//ledger/ledger-api-client",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//ledger/ledger-resources",
"//ledger/sandbox-classic",
"//ledger/sandbox-classic:sandbox-classic-scala-tests-lib",
"//ledger/sandbox-common",
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//libs-scala/build-info",
"//libs-scala/ports",
"//libs-scala/resources",
"//libs-scala/timer-utils",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_http_2_12",
"@maven//:com_typesafe_akka_akka_http_core_2_12",
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
"@maven//:com_typesafe_akka_akka_http_testkit_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
"@maven//:io_spray_spray_json_2_12",
"@maven//:org_sangria_graphql_sangria_2_12",
"@maven//:org_sangria_graphql_sangria_marshalling_api_2_12",
"@maven//:org_scalacheck_scalacheck_2_12",
"@maven//:org_scalatest_scalatest_2_12",
"@maven//:org_scalatestplus_scalacheck_1_14_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
],
)
exports_files(["src/main/resources/logback.xml"])