daml/daml-lf/interpreter/BUILD.bazel
Stephen Compall f85f7816c7
rename interface library to api-type-signature; alias symbols (#14783)
* move interface directory to api-type-signature; change bazel target; move scala files

* rename iface package to typesig; rename EnvironmentInterface to EnvironmentSignature

* rename Interface to PackageSignature

* rename fromReaderInterfaces to fromPackageSignatures

* rename InterfaceReader to SignatureReader

* rename InterfaceReader to SignatureReader in deprecation note

* rename readInterface to readPackageSignature

* rename InterfaceReaderError to Error

* rename InterfaceReaderMain to SignatureReaderMain

* rename InterfaceType to PackageSignature.TypeDecl

* rename astInterfaces to interfaces

* rename astInterfaces to interfaces in PackageSignature

* rename findAstInterface to findInterface

* rename a couple arguments

CHANGELOG_BEGIN
- [Scala API] The "quasi-public" API in ``com.daml.lf.iface`` has moved
  to the new ``com.daml.lf.typesig`` package, with many accompanying
  name changes as documented in `issue #13669
  <https://github.com/digital-asset/daml/issues/13669>`__.

  Daml 2.5.0 or later will remove the old names, and also rename the
  Maven artifact from ``daml-lf-interface`` to
  ``daml-lf-api-type-signature``.  We recommend that users of this API
  use the deprecation guidance in 2.4.0 to port their applications
  before this happens.
CHANGELOG_END
2022-08-23 15:21:45 +00:00

150 lines
4.4 KiB
Python

# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"//bazel_tools:scala.bzl",
"da_scala_benchmark_jmh",
"da_scala_library",
"da_scala_test",
"da_scala_test_suite",
"lf_scalacopts",
"lf_scalacopts_stricter",
)
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repl")
da_scala_library(
name = "interpreter",
srcs = glob(["src/main/**/*.scala"]),
scala_deps = [
"@maven//:io_spray_spray_json",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_typelevel_paiges_core",
],
scalacopts = lf_scalacopts_stricter,
tags = ["maven_coordinates=com.daml:daml-lf-interpreter:__VERSION__"],
visibility = [
"//compiler/repl-service:__subpackages__",
"//compiler/scenario-service:__subpackages__",
"//daml-lf:__subpackages__",
"//daml-script:__subpackages__",
"//ledger:__subpackages__",
"//triggers:__subpackages__",
],
deps = [
"//daml-lf/data",
"//daml-lf/language",
"//daml-lf/transaction",
"//daml-lf/validation",
"//libs-scala/contextualized-logging",
"//libs-scala/nameof",
"//libs-scala/scala-utils",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_apache_commons_commons_text",
"@maven//:org_slf4j_slf4j_api",
],
)
da_scala_library(
name = "interpreter-test-lib",
srcs = glob(["src/test/**/*Lib.scala"]),
scala_deps = [
"@maven//:org_scalatest_scalatest_matchers_core",
],
scalacopts = lf_scalacopts_stricter,
deps = [
":interpreter",
"//daml-lf/data",
"//daml-lf/language",
"//daml-lf/parser",
"//daml-lf/transaction",
"//daml-lf/validation",
"//libs-scala/contextualized-logging",
"//libs-scala/scala-utils",
],
)
da_scala_test_suite(
name = "tests",
size = "small",
srcs = glob(
["src/test/**/*.scala"],
exclude = [
"src/test/**/*Lib.scala",
],
),
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalatest_scalatest_wordspec",
"@maven//:org_scalatestplus_scalacheck_1_15",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scalaz_scalaz_scalacheck_binding",
"@maven//:org_typelevel_paiges_core",
],
scalacopts = lf_scalacopts,
deps = [
":interpreter",
":interpreter-test-lib",
"//daml-lf/api-type-signature",
"//daml-lf/data",
"//daml-lf/language",
"//daml-lf/parser",
"//daml-lf/transaction",
"//daml-lf/transaction-test-lib",
"//libs-scala/contextualized-logging",
"//libs-scala/logging-entries",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_scalatest_scalatest_compatible",
"@maven//:org_slf4j_slf4j_api",
],
)
scala_repl(
name = "interpreter@repl",
deps = [
":interpreter",
],
)
da_scala_benchmark_jmh(
name = "speedy-compilation-benchmark",
srcs = glob(["src/bench/**/SpeedyCompilationBench.scala"]),
data = [
"//ledger/test-common:model-tests-1.14.dar",
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
],
visibility = ["//visibility:public"],
deps = [
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/interpreter",
"//daml-lf/language",
"//daml-lf/scenario-interpreter",
"//daml-lf/transaction",
"//daml-lf/validation",
"//ledger/test-common:dar-files-default-lib",
"@maven//:com_google_protobuf_protobuf_java",
],
)
da_scala_benchmark_jmh(
name = "speedy-struct-proj-bench",
srcs = glob(["src/bench/**/StructProjBench.scala"]),
visibility = ["//visibility:public"],
deps = [
"//daml-lf/data",
"//daml-lf/interpreter",
"//daml-lf/language",
"//daml-lf/parser",
"//daml-lf/validation",
"//libs-scala/contextualized-logging",
],
)