daml/canton-3x/BUILD.bazel
azure-pipelines[bot] a483cabf16
update canton to 20240105.12177.0.v3ee6912f/2.9.0-snapshot.20240105.11680.0.v260fdcb4/3.0.0-snapshot.20240105.12177.0.v3ee6912f (#18094)
* update canton to 20240105.12177.0.v3ee6912f/2.9.0-snapshot.20240105.11680.0.v260fdcb4/3.0.0-snapshot.20240105.12177.0.v3ee6912f

tell-slack: canton

* fix canton-3x build

---------

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
Co-authored-by: Paul Brauner <paul.brauner@digitalasset.com>
2024-01-08 22:44:17 +01:00

1607 lines
57 KiB
Python

# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("//bazel_tools:proto.bzl", "proto_gen", "proto_jars")
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"scala_source_jar",
"scaladoc_jar",
)
load("//bazel_tools:java.bzl", "da_java_library")
load("//bazel_tools/java_testing:java_test_suite.bzl", "java_test_suite")
load("@os_info//:os_info.bzl", "is_windows")
load("//language-support/java:javaopts.bzl", "da_java_bindings_javacopts")
load("//language-support/java/codegen:codegen.bzl", "dar_to_java")
load("//rules_daml:daml.bzl", "daml_compile")
load("@build_environment//:configuration.bzl", "sdk_version")
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_binary", "scala_library", "scala_macro_library")
load("@scala_version//:index.bzl", "scala_major_version", "scala_version")
load(
"@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl",
"jar_jar",
)
load("//bazel_tools:haskell.bzl", "da_haskell_library")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
### build-info ###
# TODO(https://github.com/DACH-NY/canton/issues/15106): read 'version' from the canton repository
# once it is exposed in some file.
genrule(
name = "community_buildinfo_src",
outs = ["BuildInfo.scala"],
cmd = """
cat << EOF > $@
package com.digitalasset.canton.buildinfo
case object BuildInfo {{
val version: String = "2.7.0-SNAPSHOT"
val scalaVersion: String = "{scala_version}"
val sbtVersion: String = "bazel"
val damlLibrariesVersion: String = "{sdk_version}"
val protocolVersions = List("3", "4", "5")
override val toString: String = {{
"version: %s, scalaVersion: %s, sbtVersion: %s, damlLibrariesVersion: %s, protocolVersions: %s".format(
version, scalaVersion, sbtVersion, damlLibrariesVersion, protocolVersions
)
}}
}}
EOF
""".format(
scala_version = scala_version,
sdk_version = sdk_version,
),
)
scala_library(
name = "community_buildinfo",
srcs = [":community_buildinfo_src"],
)
### daml-common-staging/daml-errors ###
scala_library(
name = "daml-common-staging_daml-errors",
srcs = glob(["daml-common-staging/daml-errors/src/main/**/*.scala"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":ledger_api_proto_scala",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/lib/pekko ###
scala_library(
name = "pekko-stream-patch",
srcs = glob(["community/lib/pekko/src/main/**/*.scala"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_apache_pekko_pekko_stream_2_13",
],
)
jar_jar(
name = "pekko-stream-minus-patched-classes",
input_jar = "@maven//:org_apache_pekko_pekko_stream_2_13",
rules = "shade_rule",
)
### community/lib/Blake2b ###
java_library(
name = "community_lib_Blake2b",
srcs = glob(["community/lib/Blake2b/src/main/**/*.java"]),
deps = [
"@maven//:org_bouncycastle_bcprov_jdk15on",
],
)
### community/lib/slick ###
scala_macro_library(
name = "community_lib_slick_slick-fork",
srcs = glob(["community/lib/slick/src/main/**/*.scala"]),
scalacopts = ["-Wconf:cat=unused-imports:s"],
deps = [
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:org_reactivestreams_reactive_streams",
"@maven//:org_scala_lang_modules_scala_collection_compat_2_13",
],
)
### community/lib/wartremover ###
scala_macro_library(
name = "community_lib_wartremover",
srcs = glob(["community/lib/wartremover/src/main/**/*.scala"]),
scalacopts = [
"-Wconf:cat=unused-pat-vars:s",
"-Xsource:3",
],
unused_dependency_checker_mode = "error",
deps = [
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
"@maven//:org_wartremover_wartremover_2_13_11",
],
)
### community/util-logging ###
scala_library(
name = "community_util-logging",
srcs = glob(["community/util-logging/src/main/**/*.scala"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":daml-common-staging_daml-errors",
":pekko-stream-minus-patched-classes",
"//daml-lf/data",
"//libs-scala/contextualized-logging",
"//libs-scala/grpc-utils",
"//libs-scala/logging-entries",
"//libs-scala/nonempty",
"//observability/metrics",
"//observability/telemetry",
"//observability/tracing",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:io_grpc_grpc_api",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_context",
"@maven//:io_opentelemetry_opentelemetry_exporter_jaeger",
"@maven//:io_opentelemetry_opentelemetry_exporter_otlp_trace",
"@maven//:io_opentelemetry_opentelemetry_exporter_prometheus",
"@maven//:io_opentelemetry_opentelemetry_exporter_zipkin",
"@maven//:io_opentelemetry_opentelemetry_sdk",
"@maven//:io_opentelemetry_opentelemetry_sdk_common",
"@maven//:io_opentelemetry_opentelemetry_sdk_logs",
"@maven//:io_opentelemetry_opentelemetry_sdk_metrics",
"@maven//:io_opentelemetry_opentelemetry_sdk_trace",
"@maven//:io_opentelemetry_opentelemetry_semconv",
"@maven//:io_prometheus_simpleclient",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/util-external ###
scala_library(
name = "community_util-external",
srcs = glob(["community/util-external/src/main/scala/**/*.scala"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
"//daml-lf/data",
"//libs-scala/nonempty",
"@maven//:com_chuusai_shapeless_2_13",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_github_pureconfig_pureconfig_generic_2_13",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:io_grpc_grpc_api",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
],
)
### community/ledger/ledger-common ###
proto_jars(
name = "community_ledger_ledger-common_configuration_proto",
srcs = glob(["community/ledger/ledger-common/src/main/protobuf/**/*.proto"]),
maven_artifact_prefix = "ledger.configuration.protobuf",
maven_group = "com.daml",
deps = [
"@com_google_protobuf//:duration_proto",
],
)
scala_library(
name = "community_ledger_ledger-common",
srcs = glob(["community/ledger/ledger-common/src/main/scala/**/*.scala"]),
resource_strip_prefix = "canton-3x/community/ledger/ledger-common/src/resources",
resources = glob(["community/ledger/ledger-common/src/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":community_ledger_ledger-common_configuration_proto_java",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/language",
"//daml-lf/transaction",
"//daml-lf/validation",
"//libs-scala/contextualized-logging",
"//libs-scala/grpc-utils",
"//libs-scala/ledger-resources",
"//libs-scala/logging-entries",
"//libs-scala/resources",
"//libs-scala/resources-grpc",
"//libs-scala/resources-pekko",
"//libs-scala/scala-utils",
"//libs-scala/timer-utils",
"//observability/metrics",
"@maven//:com_github_ben_manes_caffeine_caffeine",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:commons_codec_commons_codec",
"@maven//:commons_io_commons_io",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_protobuf",
"@maven//:io_netty_netty_buffer",
"@maven//:io_netty_netty_handler",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_sdk_metrics",
"@maven//:io_spray_spray_json_2_13",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
],
)
### community/admin-api
proto_library(
name = "community_admin-api_proto",
srcs = glob(["community/admin-api/src/main/protobuf/**/*.proto"]),
strip_import_prefix = "community/admin-api/src/main/protobuf",
deps = [
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@go_googleapis//google/rpc:status_proto",
"@scalapb//:scalapb_proto",
],
)
proto_gen(
name = "community_admin-api_proto_scala",
srcs = [":community_admin-api_proto"],
plugin_exec = "//scala-protoc-plugins/scalapb:protoc-gen-scalapb",
plugin_name = "scalapb",
plugin_options = [
"flat_package",
"grpc",
],
)
scala_library(
name = "community_admin-api",
srcs = glob(["community/admin-api/src/main/protobuf/com/digitalasset/canton/version/ProtocolVersionAnnotation.scala"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
)
### community/base ###
proto_library(
name = "community_base_proto",
srcs = glob(["community/base/src/main/protobuf/**/*.proto"]),
strip_import_prefix = "community/base/src/main/protobuf",
deps = [
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@go_googleapis//google/rpc:status_proto",
"@scalapb//:scalapb_proto",
],
)
proto_gen(
name = "community_base_proto_scala",
srcs = [":community_base_proto"],
plugin_exec = "//scala-protoc-plugins/scalapb:protoc-gen-scalapb",
plugin_name = "scalapb",
plugin_options = [
"flat_package",
"grpc",
],
)
scala_library(
name = "community_base",
srcs = glob(["community/base/src/main/scala/**/*.scala"]) + [":community_base_proto_scala"] + [":community_admin-api_proto_scala"],
plugins = [kind_projector_plugin],
resource_strip_prefix = "canton-3x/community/base/src/main/resources",
resources = glob(["community/base/src/main/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
runtime_deps = [
# not used at compile time, but required by com.digitalasset.canton.util.PekkoUtil.createActorSystem
"@maven//:org_apache_pekko_pekko_slf4j_2_13",
],
deps = [
":bindings-java",
":community_admin-api",
":community_buildinfo",
":community_ledger_ledger-common",
":community_lib_slick_slick-fork",
":community_lib_wartremover",
":community_util-external",
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
"//daml-lf/data",
"//daml-lf/language",
"//daml-lf/transaction",
"//daml-lf/transaction:transaction_proto_java",
"//daml-lf/transaction:value_proto_java",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/executors",
"//libs-scala/logging-entries",
"//libs-scala/nameof",
"//libs-scala/nonempty",
"//libs-scala/nonempty-cats",
"//libs-scala/rs-grpc-bridge",
"//libs-scala/rs-grpc-pekko",
"//libs-scala/scala-utils",
"//observability/metrics",
"@canton_maven//:org_flywaydb_flyway_core",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_chuusai_shapeless_2_13",
"@maven//:com_github_ben_manes_caffeine_caffeine",
"@maven//:com_github_blemale_scaffeine_2_13",
"@maven//:com_github_pathikrit_better_files_2_13",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_lihaoyi_fansi_2_13",
"@maven//:com_lihaoyi_pprint_2_13",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:com_typesafe_slick_slick_hikaricp_2_13",
"@maven//:com_zaxxer_HikariCP",
"@maven//:dev_optics_monocle_core_2_13",
"@maven//:dev_optics_monocle_macro_2_13",
"@maven//:io_circe_circe_core_2_13",
"@maven//:io_circe_circe_generic_2_13",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_core",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_protobuf",
"@maven//:io_grpc_grpc_services",
"@maven//:io_grpc_grpc_stub",
"@maven//:io_grpc_grpc_util",
"@maven//:io_netty_netty_handler",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_context",
"@maven//:io_scalaland_chimney_2_13",
"@maven//:junit_junit",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_bouncycastle_bcpkix_jdk15on",
"@maven//:org_bouncycastle_bcprov_jdk15on",
"@maven//:org_postgresql_postgresql",
"@maven//:org_scala_lang_modules_scala_collection_compat_2_13",
"@maven//:org_scala_lang_modules_scala_collection_contrib_2_13",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/common ###
scala_library(
name = "community_common",
srcs = glob(["community/common/src/main/scala/**/*.scala"]),
plugins = [kind_projector_plugin],
resource_strip_prefix = "canton-3x/community/common/src/main/resources",
resources = glob(["community/common/src/main/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
runtime_deps = [
# not used at compile time, but required by com.digitalasset.canton.util.PekkoUtil.createActorSystem
"@maven//:org_apache_pekko_pekko_slf4j_2_13",
],
deps = [
":bindings-java",
":community_admin-api",
":community_base",
":community_buildinfo",
":community_ledger_ledger-common",
":community_lib_Blake2b",
":community_lib_slick_slick-fork",
":community_lib_wartremover",
":community_util-external",
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/data",
"//daml-lf/interpreter",
"//daml-lf/language",
"//daml-lf/transaction",
"//daml-lf/transaction:transaction_proto_java",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/executors",
"//libs-scala/nameof",
"//libs-scala/nonempty",
"//observability/metrics",
"//observability/tracing",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_github_pathikrit_better_files_2_13",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_github_pureconfig_pureconfig_generic_2_13",
"@maven//:com_google_crypto_tink_tink",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_lihaoyi_pprint_2_13",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:dev_optics_monocle_core_2_13",
"@maven//:dev_optics_monocle_macro_2_13",
"@maven//:io_circe_circe_core_2_13",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_services",
"@maven//:io_grpc_grpc_stub",
"@maven//:io_netty_netty_handler",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_scalaland_chimney_2_13",
"@maven//:junit_junit",
"@maven//:net_logstash_logback_logstash_logback_encoder",
"@maven//:org_apache_logging_log4j_log4j_core",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_bouncycastle_bcprov_jdk15on",
"@maven//:org_scala_lang_scala_reflect",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/ledger/ledger-api-core ###
proto_library(
name = "community_ledger_ledger-api-core_proto",
srcs = glob(["community/ledger/ledger-api-core/src/main/protobuf/**/*.proto"]),
strip_import_prefix = "community/ledger/ledger-api-core/src/main/protobuf",
deps = [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@go_googleapis//google/rpc:status_proto",
"@scalapb//:scalapb_proto",
],
)
proto_gen(
name = "community_ledger_ledger-api-core_proto_scala",
srcs = [":community_ledger_ledger-api-core_proto"],
plugin_exec = "//scala-protoc-plugins/scalapb:protoc-gen-scalapb",
plugin_name = "scalapb",
plugin_options = [
"grpc",
],
)
scala_library(
name = "community_ledger_ledger-api-core",
srcs = glob([
"community/ledger/ledger-api-core/src/main/scala/**/*.scala",
"community/ledger/ledger-api-core/src/main/scala/**/*.java",
]) + [":community_ledger_ledger-api-core_proto_scala"],
resource_strip_prefix = "canton-3x/community/ledger/ledger-api-core/src/main/resources",
resources = glob(["community/ledger/ledger-api-core/src/main/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":bindings-java",
":community_base",
":community_common",
":community_ledger_ledger-common",
":community_ledger_ledger-common_configuration_proto_java",
":community_util-external",
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
":pekko-stream-patch",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/language",
"//daml-lf/transaction",
"//daml-lf/transaction:value_proto_java",
"//daml-lf/validation",
"//libs-scala/build-info",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/crypto",
"//libs-scala/executors",
"//libs-scala/grpc-utils",
"//libs-scala/jwt",
"//libs-scala/ledger-resources",
"//libs-scala/logging-entries",
"//libs-scala/nameof",
"//libs-scala/nonempty",
"//libs-scala/ports",
"//libs-scala/resources",
"//libs-scala/resources-grpc",
"//libs-scala/resources-pekko",
"//libs-scala/rs-grpc-bridge",
"//libs-scala/rs-grpc-pekko",
"//libs-scala/scala-utils",
"//libs-scala/struct-json/struct-spray-json",
"//libs-scala/timer-utils",
"//observability/metrics",
"//observability/tracing",
"@canton_maven//:org_flywaydb_flyway_core",
"@maven//:com_auth0_java_jwt",
"@maven//:com_auth0_jwks_rsa",
"@maven//:com_chuusai_shapeless_2_13",
"@maven//:com_github_ben_manes_caffeine_caffeine",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_github_pureconfig_pureconfig_generic_2_13",
"@maven//:com_github_scopt_scopt_2_13",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_h2database_h2",
"@maven//:com_lihaoyi_pprint_2_13",
"@maven//:com_oracle_database_jdbc_ojdbc8",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:com_zaxxer_HikariCP",
"@maven//:io_circe_circe_core_2_13",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_context",
"@maven//:io_grpc_grpc_core",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_protobuf",
"@maven//:io_grpc_grpc_services",
"@maven//:io_grpc_grpc_stub",
"@maven//:io_netty_netty_handler",
"@maven//:io_netty_netty_transport",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_context",
"@maven//:io_scalaland_chimney_2_13",
"@maven//:io_spray_spray_json_2_13",
"@maven//:junit_junit",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_playframework_anorm_anorm_2_13",
"@maven//:org_playframework_anorm_anorm_tokenizer_2_13",
"@maven//:org_postgresql_postgresql",
"@maven//:org_reflections_reflections",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/ledger/ledger-json-api ###
scala_library(
name = "community_ledger_ledger-json-api",
srcs = glob(["community/ledger/ledger-json-api/src/main/scala/**/*.scala"]),
plugins = [kind_projector_plugin],
resource_strip_prefix = "canton-3x/community/ledger/ledger-json-api/src/main/resources",
resources = glob(["community/ledger/ledger-json-api/src/main/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":bindings-java",
":community_base",
":community_ledger_ledger-api-core",
":community_ledger_ledger-common",
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
"//daml-lf/api-type-signature",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/language",
"//daml-lf/transaction",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/jwt",
"//libs-scala/ledger-resources",
"//libs-scala/logging-entries",
"//libs-scala/nonempty",
"//libs-scala/ports",
"//libs-scala/resources",
"//libs-scala/resources-grpc",
"//libs-scala/resources-pekko",
"//libs-scala/rs-grpc-bridge",
"//libs-scala/rs-grpc-pekko",
"//libs-scala/scala-utils",
"//libs-scala/struct-json/struct-spray-json",
"//libs-scala/timer-utils",
"//observability/metrics",
"//observability/pekko-http-metrics",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_auth0_java_jwt",
"@maven//:com_chuusai_shapeless_2_13",
"@maven//:com_github_ben_manes_caffeine_caffeine",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_github_scopt_scopt_2_13",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:io_github_paoloboni_spray_json_derived_codecs_2_13",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_stub",
"@maven//:io_spray_spray_json_2_13",
"@maven//:junit_junit",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_apache_pekko_pekko_http_2_13",
"@maven//:org_apache_pekko_pekko_http_core_2_13",
"@maven//:org_parboiled_parboiled_2_13",
"@maven//:org_scala_lang_scala_reflect",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
],
)
### community/domain ###
proto_library(
name = "community_domain_proto",
srcs = glob(["community/domain/src/main/protobuf/**/*.proto"]),
strip_import_prefix = "community/domain/src/main/protobuf",
deps = [
":community_admin-api_proto",
":community_base_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@go_googleapis//google/rpc:status_proto",
"@scalapb//:scalapb_proto",
],
)
proto_gen(
name = "community_domain_proto_scala",
srcs = [":community_domain_proto"],
plugin_exec = "//scala-protoc-plugins/scalapb:protoc-gen-scalapb",
plugin_name = "scalapb",
plugin_options = [
"flat_package",
"grpc",
],
)
scala_library(
name = "community_domain",
srcs = glob(["community/domain/src/main/scala/**/*.scala"]) + [":community_domain_proto_scala"],
plugins = [kind_projector_plugin],
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":bindings-java",
":community_admin-api",
":community_base",
":community_common",
":community_ledger_ledger-common",
":community_lib_slick_slick-fork",
":community_lib_wartremover",
":community_sequencer-driver",
":community_util-external",
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
":pekko-stream-patch",
"//daml-lf/data",
"//daml-lf/transaction",
"//libs-scala/executors",
"//libs-scala/nameof",
"//libs-scala/nonempty",
"//libs-scala/nonempty-cats",
"//libs-scala/rs-grpc-bridge",
"//libs-scala/scala-utils",
"//observability/metrics",
"@maven//:com_github_ben_manes_caffeine_caffeine",
"@maven//:com_github_blemale_scaffeine_2_13",
"@maven//:com_github_pathikrit_better_files_2_13",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_h2database_h2",
"@maven//:com_lihaoyi_pprint_2_13",
"@maven//:com_oracle_database_jdbc_ojdbc8",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:com_zaxxer_HikariCP",
"@maven//:dev_optics_monocle_core_2_13",
"@maven//:dev_optics_monocle_macro_2_13",
"@maven//:io_circe_circe_core_2_13",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_services",
"@maven//:io_grpc_grpc_stub",
"@maven//:io_netty_netty_handler",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:junit_junit",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_postgresql_postgresql",
"@maven//:org_scala_lang_scala_reflect",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/participant/ ###
proto_library(
name = "community_participant_proto",
srcs = glob(["community/participant/src/main/protobuf/**/*.proto"]),
strip_import_prefix = "community/participant/src/main/protobuf",
deps = [
":community_admin-api_proto",
":community_base_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@go_googleapis//google/rpc:status_proto",
"@scalapb//:scalapb_proto",
],
)
proto_gen(
name = "community_participant_proto_scala",
srcs = [":community_participant_proto"],
plugin_exec = "//scala-protoc-plugins/scalapb:protoc-gen-scalapb",
plugin_name = "scalapb",
plugin_options = [
"flat_package",
"grpc",
],
)
genrule(
name = "community_participant_admin-workflows_dar",
srcs = glob(["community/participant/src/main/daml/*"]) + [
"//daml-script/daml3:daml3-script-2.1.dar",
],
outs = ["AdminWorkflows.dar"],
cmd = """
set -euo pipefail
project_dir=$$(dirname $(location community/participant/src/main/daml/daml.yaml))
tmpdir=$$(mktemp -d)
trap "rm -rf $$tmpdir" EXIT
cp -r $$project_dir/* $$tmpdir
cp $(location //daml-script/daml3:daml3-script-2.1.dar) $$tmpdir
sed -i 's/sdk-version:.*/sdk-version: {sdk_version}/' $$tmpdir/daml.yaml
sed -i 's/daml3-script/daml3-script-2.1.dar/' $$tmpdir/daml.yaml
$(location //compiler/damlc) build --project-root=$$tmpdir --ghc-option=-Werror -o $$PWD/$@
""".format(sdk_version = sdk_version),
tools = ["//compiler/damlc"],
visibility = ["//visibility:public"],
)
genrule(
name = "community_participant_admin-workflows-with-vacuuming_dar",
srcs = glob(["community/participant/src/main/daml/ping-pong-vacuum/*"]) + [
":community_participant_admin-workflows_dar",
"//daml-script/daml3:daml3-script-2.1.dar",
],
outs = ["AdminWorkflowsWithVacuuming.dar"],
cmd = """
set -euo pipefail
project_dir=$$(dirname $(location community/participant/src/main/daml/ping-pong-vacuum/daml.yaml))
tmpdir=$$(mktemp -d)
trap "rm -rf $$tmpdir" EXIT
cp -r $$project_dir/* $$tmpdir
cp $(location :community_participant_admin-workflows_dar) $$tmpdir
cp $(location //daml-script/daml3:daml3-script-2.1.dar) $$tmpdir
sed -i 's/sdk-version:.*/sdk-version: {sdk_version}/' $$tmpdir/daml.yaml
sed -i 's/-.*AdminWorkflows.dar/- AdminWorkflows.dar/' $$tmpdir/daml.yaml
sed -i 's/daml3-script/daml3-script-2.1.dar/' $$tmpdir/daml.yaml
$(location //compiler/damlc) build --project-root=$$tmpdir --ghc-option=-Werror -o $$PWD/$@
""".format(sdk_version = sdk_version),
tools = ["//compiler/damlc"],
visibility = ["//visibility:public"],
)
dar_to_java(
name = "community_participant_admin-workflows-with-vacuuming_java",
src = ":community_participant_admin-workflows-with-vacuuming_dar",
package_prefix = "com.digitalasset.canton.participant.admin.workflows.java",
)
copy_file(
name = "ledger-api-version-file",
src = ":api-version-files",
out = "VERSION",
)
scala_library(
name = "community_participant",
srcs = glob(["community/participant/src/main/scala/**/*.scala"]) + [
":community_participant_proto_scala",
],
plugins = [kind_projector_plugin],
resource_strip_prefix = "canton",
resources = [
":community_participant_admin-workflows-with-vacuuming_dar",
":community_participant_admin-workflows_dar",
":ledger-api-version-file",
],
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
exports = [
"@maven//:io_netty_netty_handler",
],
deps = [
":bindings-java",
":community_admin-api",
":community_base",
":community_common",
":community_ledger_ledger-api-core",
":community_ledger_ledger-common",
":community_ledger_ledger-json-api",
":community_lib_slick_slick-fork",
":community_lib_wartremover",
":community_participant_admin-workflows-with-vacuuming_java",
":community_util-external",
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
"//daml-lf/archive:daml_lf_archive_reader",
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/language",
"//daml-lf/transaction",
"//daml-lf/transaction:transaction_proto_java",
"//libs-scala/contextualized-logging",
"//libs-scala/executors",
"//libs-scala/jwt",
"//libs-scala/ledger-resources",
"//libs-scala/logging-entries",
"//libs-scala/nameof",
"//libs-scala/nonempty",
"//libs-scala/nonempty-cats",
"//libs-scala/resources",
"//libs-scala/resources-grpc",
"//libs-scala/resources-pekko",
"//libs-scala/rs-grpc-bridge",
"//libs-scala/scala-utils",
"//observability/metrics",
"//observability/tracing",
"@maven//:com_auth0_java_jwt",
"@maven//:com_github_ben_manes_caffeine_caffeine",
"@maven//:com_github_blemale_scaffeine_2_13",
"@maven//:com_github_pathikrit_better_files_2_13",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_lihaoyi_pprint_2_13",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:dev_optics_monocle_core_2_13",
"@maven//:dev_optics_monocle_macro_2_13",
"@maven//:io_circe_circe_core_2_13",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_services",
"@maven//:io_grpc_grpc_stub",
"@maven//:io_netty_netty_handler",
"@maven//:io_opentelemetry_instrumentation_opentelemetry_grpc_1_6",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_scalaland_chimney_2_13",
"@maven//:junit_junit",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_scala_lang_modules_scala_collection_compat_2_13",
"@maven//:org_scala_lang_scala_reflect",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/sequencer-driver
scala_library(
name = "community_sequencer-driver",
srcs = glob(["community/sequencer-driver/src/main/scala/**/*.scala"]),
resource_strip_prefix = "/canton-3x/community/sequencer-driver/src/main/resources",
resources = glob(["community/sequencer-driver/src/main/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":community_util-external",
":community_util-logging",
":pekko-stream-minus-patched-classes",
"//daml-lf/data",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:io_grpc_grpc_api",
"@maven//:org_slf4j_slf4j_api",
],
)
### community/app-base ###
scala_library(
name = "community_app-base",
srcs = glob(["community/app-base/src/main/scala/**/*.scala"]),
resource_strip_prefix = "/canton-3x/community/app-base/src/main/resources",
resources = glob(["community/app-base/src/main/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
deps = [
":bindings-java",
":community_admin-api",
":community_base",
":community_buildinfo",
":community_common",
":community_domain",
":community_ledger_ledger-api-core",
":community_ledger_ledger-common",
":community_ledger_ledger-json-api",
":community_lib_wartremover",
":community_participant",
":community_sequencer-driver",
":community_util-external",
":community_util-logging",
":daml-common-staging_daml-errors",
":ledger_api_proto_scala",
":pekko-stream-minus-patched-classes",
"//daml-lf/data",
"//daml-lf/transaction",
"//libs-scala/contextualized-logging",
"//libs-scala/executors",
"//libs-scala/jwt",
"//libs-scala/logging-entries",
"//libs-scala/nameof",
"//libs-scala/nonempty",
"//libs-scala/nonempty-cats",
"//libs-scala/rs-grpc-bridge",
"//libs-scala/scala-utils",
"//observability/metrics",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_chuusai_shapeless_2_13",
"@maven//:com_fasterxml_jackson_core_jackson_core",
"@maven//:com_github_pathikrit_better_files_2_13",
"@maven//:com_github_pureconfig_pureconfig_cats_2_13",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_github_pureconfig_pureconfig_generic_2_13",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_lihaoyi_ammonite_2_13_11",
"@maven//:com_lihaoyi_ammonite_compiler_interface_2_13_11",
"@maven//:com_lihaoyi_ammonite_repl_2_13_11",
"@maven//:com_lihaoyi_ammonite_runtime_2_13_11",
"@maven//:com_lihaoyi_ammonite_util_2_13",
"@maven//:com_lihaoyi_os_lib_2_13",
"@maven//:com_lihaoyi_pprint_2_13",
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:com_typesafe_slick_slick_2_13",
"@maven//:dev_optics_monocle_core_2_13",
"@maven//:dev_optics_monocle_macro_2_13",
"@maven//:io_circe_circe_core_2_13",
"@maven//:io_circe_circe_generic_2_13",
"@maven//:io_circe_circe_jawn_2_13",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_dropwizard_metrics_metrics_graphite",
"@maven//:io_dropwizard_metrics_metrics_jmx",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_services",
"@maven//:io_grpc_grpc_stub",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_exporter_otlp_common",
"@maven//:io_opentelemetry_opentelemetry_sdk",
"@maven//:io_opentelemetry_opentelemetry_sdk_metrics",
"@maven//:io_prometheus_simpleclient",
"@maven//:io_prometheus_simpleclient_dropwizard",
"@maven//:io_prometheus_simpleclient_httpserver",
"@maven//:io_scalaland_chimney_2_13",
"@maven//:junit_junit",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_apache_pekko_pekko_http_2_13",
"@maven//:org_apache_pekko_pekko_http_core_2_13",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_jul_to_slf4j",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
"@maven//:org_typelevel_cats_kernel_2_13",
],
)
### community/app ###
scala_library(
name = "community_app-lib",
srcs = glob(["community/app/src/main/scala/**/*.scala"]),
resource_strip_prefix = "/canton-3x/community/app/src/main/resources",
resources = glob(["community/app/src/main/resources/**"]),
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
unused_dependency_checker_mode = "error",
visibility = ["//visibility:public"],
runtime_deps = [
"@maven//:org_codehaus_janino_janino", # for parsing conditionals in logback configuration
],
deps = [
":community_app-base",
":community_base",
":community_buildinfo",
":community_common",
":community_domain",
":community_ledger_ledger-api-core",
":community_ledger_ledger-json-api",
":community_participant",
":community_util-external",
":community_util-logging",
":daml-common-staging_daml-errors",
":pekko-stream-minus-patched-classes",
"//daml-lf/data",
"//libs-scala/jwt",
"//libs-scala/nonempty",
"//libs-scala/rs-grpc-bridge",
"//observability/metrics",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_github_pathikrit_better_files_2_13",
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
"@maven//:com_github_scopt_scopt_2_13",
"@maven//:com_lihaoyi_ammonite_2_13_11",
"@maven//:com_lihaoyi_ammonite_compiler_2_13_11",
"@maven//:com_lihaoyi_ammonite_compiler_interface_2_13_11",
"@maven//:com_lihaoyi_ammonite_interp_2_13_11",
"@maven//:com_lihaoyi_ammonite_interp_api_2_13_11",
"@maven//:com_lihaoyi_ammonite_repl_2_13_11",
"@maven//:com_lihaoyi_ammonite_runtime_2_13_11",
"@maven//:com_lihaoyi_ammonite_util_2_13",
"@maven//:com_lihaoyi_os_lib_2_13",
"@maven//:com_typesafe_config",
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:io_get_coursier_interface",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:junit_junit",
"@maven//:org_apache_pekko_pekko_actor_2_13",
"@maven//:org_scalaz_scalaz_core_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_typelevel_cats_core_2_13",
],
)
scala_binary(
name = "community_app",
main_class = "com.digitalasset.canton.CantonCommunityApp",
visibility = ["//visibility:public"],
deps = [":community_app-lib"],
)
proto_gen(
name = "ledger-api-java",
srcs = [":ledger_api_proto"],
plugin_name = "java",
visibility = [
"//visibility:public",
],
)
# this is only needed for the uber-javadoc in //language-support/java:javadoc
java_library(
name = "ledger-api-java-lib-for-javadocs",
srcs = [
":ledger-api-java",
":ledger-api-java-grpc",
],
visibility = [
"//visibility:public",
],
deps = [
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_core",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_protobuf",
"@maven//:io_grpc_grpc_stub",
"@maven//:javax_annotation_javax_annotation_api",
],
)
proto_gen(
name = "ledger-api-java-grpc",
srcs = [":ledger_api_proto"],
plugin_exec = "@io_grpc_grpc_java//compiler:grpc_java_plugin",
plugin_name = "java-grpc",
visibility = [
"//visibility:public",
],
)
da_java_library(
name = "bindings-java",
srcs = glob(["community/bindings-java/src/main/java/**/*.java"]) + [
":ledger-api-java",
":ledger-api-java-grpc",
],
javacopts = da_java_bindings_javacopts,
tags = [
"javadoc_root_packages=com.daml.ledger.javaapi.data",
"maven_coordinates=com.daml:bindings-java:__VERSION__",
],
visibility = [
"//visibility:public",
],
deps = [
"@maven//:com_fasterxml_jackson_core_jackson_core",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_core",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_protobuf",
"@maven//:io_grpc_grpc_stub",
"@maven//:javax_annotation_javax_annotation_api",
"@maven//:org_checkerframework_checker_qual",
"@maven//:org_slf4j_slf4j_api",
],
)
java_test_suite(
name = "bindings-java-java-tests",
srcs = glob(["community/bindings-java/src/test/java/**/*Test.java"]),
strip = "src/test/java/",
use_short_names = is_windows,
deps = [
":bindings-java",
":bindings-java-test-helpers",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_junit_jupiter_junit_jupiter_api",
"@maven//:org_junit_jupiter_junit_jupiter_engine",
"@maven//:org_junit_platform_junit_platform_runner",
],
)
java_library(
name = "bindings-java-test-helpers",
testonly = True,
srcs = glob(["community/bindings-java/src/test/java/**/TestHelpers.java"]),
deps = [":bindings-java"],
)
da_scala_library(
name = "bindings-java-tests-lib",
srcs = glob(
["community/bindings-java/src/test/**/*.scala"],
exclude = [
"community/bindings-java/src/test/**/*Spec.scala",
"community/bindings-java/src/test/**/*Test.scala",
],
),
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
],
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
visibility = [
"//ledger-service/http-json:__subpackages__",
],
deps = [
":bindings-java",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_protobuf_protobuf_java",
],
)
da_scala_test_suite(
name = "bindings-java-tests",
srcs = glob([
"community/bindings-java/src/test/**/*Spec.scala",
"community/bindings-java/src/test/**/*Test.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",
],
scalacopts = [
"-Xsource:3",
"-language:postfixOps",
],
deps = [
":bindings-java",
":bindings-java-tests-lib",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:org_scalatest_scalatest_compatible",
],
)
filegroup(
name = "bindings-java-sources",
srcs = glob(["community/bindings-java/src/main/java/**/*.java"]),
visibility = ["//visibility:public"],
)
filegroup(
name = "api-version-files",
srcs = [
"community/ledger-api/VERSION",
],
visibility = [
"//visibility:public",
],
)
ledger_api_root = "canton-3x/community/ledger-api"
ledger_api_proto_source_root = "canton-3x/community/ledger-api/src/main/protobuf"
proto_jars(
name = "ledger_api_proto",
srcs = glob(["community/ledger-api/src/main/protobuf/com/daml/ledger/api/v*/**/*.proto"]),
grpc = True,
java_conversions = True,
maven_artifact_prefix = "ledger-api",
maven_artifact_scala_suffix = "scalapb",
maven_group = "com.daml",
strip_import_prefix = "community/ledger-api/src/main/protobuf",
visibility = ["//visibility:public"],
deps = [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@go_googleapis//google/rpc:errdetails_proto",
"@go_googleapis//google/rpc:status_proto",
],
)
google_protobuf_src = "external/com_google_protobuf/src"
genrule(
name = "google-protobuf-haskellpb-sources",
srcs = ["@com_google_protobuf//:well_known_type_protos"],
outs = ["Google/Protobuf/" + b for b in [
"Any.hs",
"Duration.hs",
"Empty.hs",
"Wrappers.hs",
"Struct.hs",
"FieldMask.hs",
]],
cmd = """
for src in \
external/com_google_protobuf/src/google/protobuf/any.proto \
external/com_google_protobuf/src/google/protobuf/duration.proto \
external/com_google_protobuf/src/google/protobuf/empty.proto \
external/com_google_protobuf/src/google/protobuf/wrappers.proto \
external/com_google_protobuf/src/google/protobuf/struct.proto \
external/com_google_protobuf/src/google/protobuf/field_mask.proto \
; do
$(location @proto3-suite//:compile-proto-file) \
--includeDir """ + google_protobuf_src + """ \
--proto google/protobuf/$$(basename $$src) \
--out $(@D)
done
""",
tools = [
"@proto3-suite//:compile-proto-file",
],
visibility = ["//visibility:public"],
)
google_rpc_src = "external/go_googleapis"
genrule(
name = "google-rpc-haskellpb-sources",
srcs = [
"@go_googleapis//google/rpc:status.proto",
"@com_google_protobuf//:well_known_type_protos",
],
outs = ["Google/Rpc/Status.hs"],
cmd = """
$(location @proto3-suite//:compile-proto-file) \
--includeDir """ + google_protobuf_src + """ \
--includeDir """ + google_rpc_src + """ \
--proto google/rpc/status.proto \
--out $$(dirname $$(dirname $(@D)))
#2x dirname because @D works differently for a single output
""",
tools = [
"@proto3-suite//:compile-proto-file",
],
visibility = ["//visibility:public"],
)
filegroup(
name = "ledger-api-protos-fg",
srcs = glob(["community/ledger-api/src/main/protobuf/com/daml/ledger/api/v1/*.proto"]),
visibility = ["//visibility:private"],
)
ledger_api_haskellpb_sources = [
"ActiveContractsService.hs",
"CommandCompletionService.hs",
"CommandService.hs",
"CommandSubmissionService.hs",
"Commands.hs",
"ContractMetadata.hs",
"Completion.hs",
"Event.hs",
"LedgerConfigurationService.hs",
"LedgerIdentityService.hs",
"LedgerOffset.hs",
"PackageService.hs",
"TraceContext.hs",
"Transaction.hs",
"TransactionFilter.hs",
"TransactionService.hs",
"Value.hs",
]
genrule(
name = "ledger-api-haskellpb-sources",
srcs = [
"@com_google_protobuf//:well_known_type_protos",
"@go_googleapis//google/rpc:status.proto",
":ledger-api-protos-fg",
],
outs = ["Com/Daml/Ledger/Api/V1/" + b for b in ledger_api_haskellpb_sources],
cmd = """
for src in $(locations :ledger-api-protos-fg); do
$(location @proto3-suite//:compile-proto-file) \
--includeDir """ + google_protobuf_src + """ \
--includeDir """ + google_rpc_src + """ \
--includeDir """ + ledger_api_proto_source_root + """ \
--proto com/daml/ledger/api/v1/$$(basename $$src) \
--out $(@D)
done
""",
tools = [
"@proto3-suite//:compile-proto-file",
],
)
filegroup(
name = "ledger-api-protos-fg-testing",
srcs = glob(["community/ledger-api/src/main/protobuf/com/daml/ledger/api/v1/testing/*.proto"]),
visibility = ["//visibility:private"],
)
genrule(
name = "ledger-api-haskellpb-sources-testing",
srcs = [
"@com_google_protobuf//:well_known_type_protos",
"@go_googleapis//google/rpc:status.proto",
":ledger-api-protos-fg-testing",
],
outs = ["Com/Daml/Ledger/Api/V1/Testing/TimeService.hs"],
cmd = """
$(location @proto3-suite//:compile-proto-file) \
--includeDir """ + google_protobuf_src + """ \
--includeDir """ + google_rpc_src + """ \
--includeDir """ + ledger_api_proto_source_root + """ \
--proto com/daml/ledger/api/v1/testing/time_service.proto \
--out $$(dirname $$(dirname $$(dirname $$(dirname $$(dirname $$(dirname $(@D)))))))
#6x dirname because @D works differently for a single output
""",
tools = [
"@proto3-suite//:compile-proto-file",
],
)
filegroup(
name = "ledger-api-protos-fg-admin",
srcs = glob(
["community/ledger-api/src/main/protobuf/com/daml/ledger/api/v1/admin/*.proto"],
exclude = ["community/ledger-api/src/main/protobuf/com/daml/ledger/api/v1/admin/participant_pruning_service.proto"], # TODO: haskell grpc client for participant pruning
),
visibility = ["//visibility:private"],
)
ledger_api_haskellpb_sources_admin = [
"PackageManagementService.hs",
"PartyManagementService.hs",
"MeteringReportService.hs",
"ObjectMeta.hs",
"UserManagementService.hs",
]
genrule(
name = "ledger-api-haskellpb-sources-admin",
srcs = [
"@com_google_protobuf//:well_known_type_protos",
"@go_googleapis//google/rpc:status.proto",
":ledger-api-protos-fg-admin",
],
outs = ["Com/Daml/Ledger/Api/V1/Admin/" + b for b in ledger_api_haskellpb_sources_admin],
cmd = """
for src in $(locations :ledger-api-protos-fg-admin); do
$(location @proto3-suite//:compile-proto-file) \
--includeDir """ + google_protobuf_src + """ \
--includeDir """ + google_rpc_src + """ \
--includeDir """ + ledger_api_proto_source_root + """ \
--proto com/daml/ledger/api/v1/admin/$$(basename $$src) \
--out $(@D)
done
""",
tools = [
"@proto3-suite//:compile-proto-file",
],
)
filegroup(
name = "all-ledger-api-haskellpb-sources",
srcs = [
":google-protobuf-haskellpb-sources",
":google-rpc-haskellpb-sources",
":ledger-api-haskellpb-sources",
":ledger-api-haskellpb-sources-admin",
":ledger-api-haskellpb-sources-testing",
],
visibility = ["//visibility:public"],
)
da_haskell_library(
name = "ledger-api-haskellpb",
srcs = [
":all-ledger-api-haskellpb-sources",
],
compiler_flags = [
"-O0",
],
hackage_deps = [
"base",
"bytestring",
"containers",
"deepseq",
"grpc-haskell",
"grpc-haskell-core",
"proto3-suite",
"proto3-wire",
"text",
"vector",
],
visibility = ["//visibility:public"],
)
proto_gen(
name = "ledger-api-docs-proto",
srcs = [":ledger_api_proto"],
plugin_exec = "@com_github_pseudomuto_protoc_gen_doc//cmd/protoc-gen-doc:protoc-gen-doc",
plugin_name = "doc",
plugin_options = [
ledger_api_root + "/docs/rst_mmd.tmpl",
"docs.rst",
],
# this is _slightly_ hacky. we need to include the markdown template in the plugin_runfiles
# and refer to the file with a workspace relative path in plugin_options
plugin_runfiles = ["community/ledger-api/docs/rst_mmd.tmpl"],
visibility = [
"//visibility:public",
],
)
genrule(
name = "ledger-api-docs",
srcs = [":ledger-api-docs-proto"],
outs = ["proto-docs.rst"],
cmd = """
unzip -q $(location :ledger-api-docs-proto)
$(location community/ledger-api/docs/post-process.sh)
mv docs.rst '$@'
""",
tools = ["community/ledger-api/docs/post-process.sh"],
visibility = ["//visibility:public"],
)