2022-01-03 19:36:51 +03:00
|
|
|
# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2021-11-05 03:23:38 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
load(
|
|
|
|
"//bazel_tools:scala.bzl",
|
|
|
|
"da_scala_binary",
|
2021-11-10 21:08:33 +03:00
|
|
|
"da_scala_library",
|
2021-11-05 03:23:38 +03:00
|
|
|
"da_scala_test_suite",
|
|
|
|
)
|
|
|
|
load("@scala_version//:index.bzl", "scala_major_version")
|
|
|
|
|
|
|
|
da_scala_binary(
|
|
|
|
name = "export-error-codes-json-app",
|
2021-11-10 21:08:33 +03:00
|
|
|
srcs = glob(["app/src/main/scala/**/*.scala"]),
|
|
|
|
main_class = "com.daml.error.generator.app.Main",
|
2021-11-05 03:23:38 +03:00
|
|
|
resources = glob(["src/main/resources/**/*"]),
|
|
|
|
scala_deps = [
|
|
|
|
"@maven//:io_circe_circe_core",
|
|
|
|
"@maven//:org_typelevel_cats_core",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
2021-11-10 21:08:33 +03:00
|
|
|
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",
|
2021-11-26 12:22:14 +03:00
|
|
|
"@maven//:io_grpc_grpc_api",
|
|
|
|
"@maven//:org_slf4j_slf4j_api",
|
2021-11-10 21:08:33 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-11-23 17:30:48 +03:00
|
|
|
da_scala_binary(
|
2021-11-26 12:22:14 +03:00
|
|
|
name = "generate-docs-error-codes-inventory-app",
|
2021-11-23 17:30:48 +03:00
|
|
|
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",
|
2021-11-26 12:22:14 +03:00
|
|
|
"@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",
|
2021-11-23 17:30:48 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-11-10 21:08:33 +03:00
|
|
|
da_scala_library(
|
|
|
|
name = "lib",
|
|
|
|
srcs = glob(["lib/src/main/scala/**/*.scala"]),
|
|
|
|
tags = ["maven_coordinates=com.daml:error-generator-lib:__VERSION__"],
|
|
|
|
visibility = ["//visibility:public"],
|
2021-11-05 03:23:38 +03:00
|
|
|
deps = [
|
|
|
|
"//ledger/error",
|
|
|
|
"@maven//:org_reflections_reflections",
|
|
|
|
],
|
2021-11-10 21:08:33 +03:00
|
|
|
)
|
2021-11-05 03:23:38 +03:00
|
|
|
|
|
|
|
da_scala_test_suite(
|
2021-11-26 12:22:14 +03:00
|
|
|
name = "error-docs-generator-tests",
|
|
|
|
srcs = glob(["test/suite/scala/**/*.scala"]),
|
2021-11-05 03:23:38 +03:00
|
|
|
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",
|
2021-11-26 12:22:14 +03:00
|
|
|
":lib",
|
2021-11-05 03:23:38 +03:00
|
|
|
"//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",
|
|
|
|
],
|
2021-11-22 20:37:49 +03:00
|
|
|
)
|