daml/ledger/test-common/BUILD.bazel
Samir Talwar 052f69cde9
ledger-api: Use proto_jars, and publish Protobuf sources separately from the Scala classes. [KVL-714] (#8091)
* ledger-api: Use `proto_jars`.

CHANGELOG_BEGIN
- [Ledger API] The Scala JARs containing the gRPC definitions no longer
  contain the *.proto files used to generate the ScalaPB-based classes.
CHANGELOG_END

* Create a source JAR for *.proto files in `proto_jars`.

* ledger-api: Publish the protobuf sources as "ledger-api-proto".

CHANGELOG_BEGIN
- [Ledger API] The *.proto files containing the gRPC definitions are now
  provided by a new Maven Central artifact, with the group "com.daml"
  and the artifact name "ledger-api-proto".
CHANGELOG_END

* release: We don't need the "main-jar" option.

* Bazel: Proto JARs will always have a Maven artifact suffix.

* Bazel: Simplify Protobuf source file TAR and JAR targets.

* Bazel: Extract out Protobuf functions.
2020-11-27 17:14:48 +00:00

75 lines
2.0 KiB
Python

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"//rules_daml:daml.bzl",
"daml_compile",
)
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
)
load(
"//language-support/scala/codegen:codegen.bzl",
"dar_to_scala",
)
load(
"//daml-lf/language:daml-lf.bzl",
"lf_stable_version",
)
da_scala_library(
name = "test-common",
srcs = glob(["src/main/scala/**/*.scala"]),
visibility = [
"//visibility:public",
],
deps = [
"//ledger-api/grpc-definitions:ledger_api_proto_scala",
"//libs-scala/timer-utils",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:io_grpc_grpc_context",
],
)
[
[
daml_compile(
name = "%s-tests" % test_name,
srcs = glob(["src/main/daml/%s/*.daml" % test_name]),
target = target,
visibility = ["//visibility:public"],
),
dar_to_scala(
name = "%s-tests.scala-codegen" % test_name,
srcs = [":%s-tests.dar" % test_name],
package_prefix = "com.daml.ledger.test.%s" % test_name,
srcjar_out = "%s.scala.srcjar" % test_name,
verbosity = 2,
visibility = ["//visibility:public"],
),
da_scala_library(
name = "%s-tests.scala" % test_name,
srcs = [":%s-tests.scala-codegen" % test_name],
visibility = ["//visibility:public"],
deps = ["//language-support/scala/bindings"],
),
]
for (test_name, target) in [
("model", lf_stable_version),
("semantic", lf_stable_version),
("performance", lf_stable_version),
]
]
filegroup(
name = "dar-files",
srcs = [
":model-tests.dar",
":performance-tests.dar",
":semantic-tests.dar",
],
visibility = ["//visibility:public"],
)