daml/ledger/error/generator/BUILD.bazel

110 lines
3.5 KiB
Python
Raw Normal View History

# 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_binary",
"da_scala_library",
"da_scala_test_suite",
)
load("@scala_version//:index.bzl", "scala_major_version")
da_scala_binary(
name = "export-error-codes-json-app",
srcs = glob(["app/src/main/scala/**/*.scala"]),
main_class = "com.daml.error.generator.app.Main",
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:io_circe_circe_core",
"@maven//:org_typelevel_cats_core",
],
visibility = ["//visibility:public"],
runtime_deps = [
# Add the KVErrors to the classpath so they can be picked up by the generator
"//ledger/participant-state/kvutils",
],
deps = [
"//ledger/error",
"//ledger/error/generator:lib",
"@maven//:io_grpc_grpc_api",
"@maven//:org_slf4j_slf4j_api",
],
)
da_scala_binary(
name = "generate-docs-error-codes-inventory-app",
srcs = glob(["app/src/main/scala/**/*.scala"]),
main_class = "com.daml.error.generator.app.ErrorCodeInventoryDocsGenApp",
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:io_circe_circe_core",
"@maven//:org_typelevel_cats_core",
],
visibility = ["//visibility:public"],
runtime_deps = [
# Add the KVErrors to the classpath so they can be picked up by the generator
"//ledger/participant-state/kvutils",
],
deps = [
"//ledger/error",
"//ledger/error/generator:lib",
"@maven//:io_grpc_grpc_api",
"@maven//:org_slf4j_slf4j_api",
],
)
da_scala_binary(
name = "generate-docs-error-categories-inventory-app",
srcs = glob(["app/src/main/scala/**/*.scala"]),
main_class = "com.daml.error.generator.app.ErrorCategoryInventoryDocsGenApp",
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:io_circe_circe_core",
"@maven//:org_typelevel_cats_core",
],
visibility = ["//visibility:public"],
deps = [
"//ledger/error",
"//ledger/error/generator:lib",
"@maven//:io_grpc_grpc_api",
"@maven//:org_slf4j_slf4j_api",
],
)
da_scala_library(
name = "lib",
srcs = glob(["lib/src/main/scala/**/*.scala"]),
tags = ["maven_coordinates=com.daml:error-generator-lib:__VERSION__"],
visibility = ["//visibility:public"],
deps = [
"//ledger/error",
"@maven//:org_reflections_reflections",
],
)
da_scala_test_suite(
name = "error-docs-generator-tests",
srcs = glob(["test/suite/scala/**/*.scala"]),
scala_deps = [
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
],
deps = [
":export-error-codes-json-app",
":lib",
"//ledger/error",
"//ledger/error:error-test-utils",
"//ledger/test-common",
"//libs-scala/contextualized-logging",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_protobuf",
"@maven//:org_scalatest_scalatest_compatible",
"@maven//:org_slf4j_slf4j_api",
],
)