daml/extractor/BUILD.bazel

256 lines
8.5 KiB
Python
Raw Normal View History

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2019-04-04 11:33:38 +03:00
# SPDX-License-Identifier: Apache-2.0
load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
"da_scala_library",
"da_scala_test_suite",
2019-04-04 11:33:38 +03:00
)
load(
"//rules_daml:daml.bzl",
"daml_compile",
2019-04-04 11:33:38 +03:00
)
load(
"//daml-lf/language:daml-lf.bzl",
"lf_dev_version",
"lf_stable_version",
)
2019-04-04 11:33:38 +03:00
TEST_DARS = [
"RecordsAndVariants",
"PrimitiveTypes",
"TransactionExample",
]
2019-04-04 11:33:38 +03:00
[
daml_compile(
name = darmod,
srcs = ["src/test/resources/damls/%s.daml" % darmod],
# FixMe: https://github.com/digital-asset/daml/issues/2289
# change version to lf_latest_version when freezing numeric in the next language version
target = lf_dev_version,
)
for darmod in TEST_DARS
]
2019-04-04 11:33:38 +03:00
genrule(
name = "VeryLargeArchive_src",
outs = ["VeryLargeArchive/Blobs.daml"] + ["VeryLargeArchive/Blob%s.daml" % n for n in range(
1,
32 + 1,
)],
cmd =
'''
filecount=32
outs=($(OUTS))
main="$${outs[0]}"
echo 'daml 1.2
module VeryLargeArchive.Blobs where
import VeryLargeArchive.Blob1()' > "$$main"
firstfil="$${outs[1]}"
echo 'daml 1.2
module VeryLargeArchive.Blob1 where
' > "$$firstfil"
{ for linen in `seq 1 1024`; do
echo -n "x$$linen = "\\"
for charn in `seq 1 16`; do
echo -n qqqqqqqq
done;
echo \\"
done; } >> $$firstfil
for filen in `seq 2 $$filecount`; do
echo "import VeryLargeArchive.Blob$$filen()" >> "$$main"
sed -e '2s/^\\(module .*\\)1/\\1'$$filen/ "$$firstfil" > "$${outs[$$filen]}"
done
''',
)
daml_compile(
name = "VeryLargeArchive",
srcs = [
":VeryLargeArchive/Blobs.daml",
":VeryLargeArchive_src",
],
)
2019-04-04 11:33:38 +03:00
da_scala_library(
name = "extractor",
srcs = glob(["src/main/scala/**/*.scala"]),
resources = glob(["src/main/resources/**/*"]),
visibility = ["//visibility:public"],
runtime_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
Remove unused dependencies to da_scala_library (#3938) * Inline all scala_library dependencies * Run //:buildifier-fix * TMP scala_library_suite --> scala_library * da_scala_library: Enable unused dependency checker * scala_library: Enable unused dependency checker * //daml-lf/data:data * //daml-lf/engine:engine * //ledger-api/rs-grpc-akka:rs-grpc-akka * //ledger/participant-state:participant-state * //ledger/ledger-api-client:ledger-api-client * //scala-protoc-plugins/scala-logging:scala-logging-lib * //ledger/ledger-api-scala-logging:ledger-api-scala-logging * //ledger/ledger-api-common:ledger-api-common * //ledger-service/utils:utils * //ledger-service/jwt:jwt * //ledger/ledger-api-auth:ledger-api-auth * //extractor:extractor * //daml-assistant/scala-daml-project-config:scala-daml-project-config * //language-support/codegen-common:codegen-common * //language-support/scala/codegen:codegen * //language-support/codegen-main:codegen-main-lib * //ledger-service/db-backend:db-backend * //ledger-service/http-json:http-json * //daml-lf/scenario-interpreter:scenario-interpreter * //ledger/sandbox:sandbox * //navigator/backend:navigator-library * //daml-assistant/daml-sdk:sdk-lib * //daml-lf/data-scalacheck:data-scalacheck * //daml-script/test:test-lib * //ledger/ledger-api-common:ledger-api-common-scala-tests-lib * //ledger/test-common:test-common * //ledger/sandbox:sandbox-scala-tests-lib * //extractor:extractor-scala-tests-lib * //language-support/java/bindings:bindings-java-tests-lib * //language-support/java/bindings-rxjava:bindings-java-tests-lib * //language-support/scala/bindings-akka-testing:bindings-akka-testing * //language-support/scala/codegen-testing:codegen-testing * //language-support/scala/codegen-sample-app:daml-lf-codegen-sample-app * //language-support/scala/codegen-sample-app:daml-lf-codegen-sample-app-testing * //language-support/scala/codegen-testing:codegen-testing-testing * //ledger-api/sample-service:sample-service * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests-lib * //ledger/ledger-api-test-tool:ledger-api-test-tool-lib * //ledger/ledger-api-test-tool:ledger-api-test-tool-tests * //ledger/participant-state/kvutils:kvutils * //ledger/sandbox:ledger-api-server * //ledger/sandbox-perf:sandbox-perf-lib * //navigator/backend:navigator-tests-library * UNDO scala_library_suite --> scala_library This reverts commit ab3eb1ae23139e2ec431ab4551fbb0371e0354e1. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-06 20:14:21 +03:00
"@maven//:org_tpolecat_doobie_postgres_2_12",
],
deps = [
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//ledger-api/rs-grpc-akka",
"//ledger-api/rs-grpc-bridge",
"//ledger-service/lf-value-json",
"//ledger-service/utils",
"//ledger/ledger-api-client",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//libs-scala/auth-utils",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/timer-utils",
"@maven//:com_chuusai_shapeless_2_12",
"@maven//:com_github_scopt_scopt_2_12",
"@maven//:com_lihaoyi_fansi_2_12",
"@maven//:com_lihaoyi_pprint_2_12",
"@maven//:com_lihaoyi_sourcecode_2_12",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
"@maven//:io_circe_circe_core_2_12",
"@maven//:io_circe_circe_generic_2_12",
"@maven//:io_circe_circe_parser_2_12",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_netty_netty_handler",
"@maven//:io_spray_spray_json_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_tpolecat_doobie_core_2_12",
"@maven//:org_tpolecat_doobie_free_2_12",
"@maven//:org_typelevel_cats_core_2_12",
"@maven//:org_typelevel_cats_effect_2_12",
"@maven//:org_typelevel_cats_free_2_12",
"@maven//:org_typelevel_cats_kernel_2_12",
],
2019-04-04 11:33:38 +03:00
)
da_scala_binary(
name = "extractor-binary",
main_class = "com.daml.extractor.Main",
tags = [
"maven_coordinates=com.daml:extractor:__VERSION__",
"no_scala_version_suffix",
],
visibility = ["//visibility:public"],
deps = [
":extractor",
],
2019-04-04 11:33:38 +03:00
)
da_scala_library(
name = "extractor-scala-tests-lib",
srcs = glob(["src/test/lib/**/*.scala"]),
Remove unused dependencies to da_scala_library (#3938) * Inline all scala_library dependencies * Run //:buildifier-fix * TMP scala_library_suite --> scala_library * da_scala_library: Enable unused dependency checker * scala_library: Enable unused dependency checker * //daml-lf/data:data * //daml-lf/engine:engine * //ledger-api/rs-grpc-akka:rs-grpc-akka * //ledger/participant-state:participant-state * //ledger/ledger-api-client:ledger-api-client * //scala-protoc-plugins/scala-logging:scala-logging-lib * //ledger/ledger-api-scala-logging:ledger-api-scala-logging * //ledger/ledger-api-common:ledger-api-common * //ledger-service/utils:utils * //ledger-service/jwt:jwt * //ledger/ledger-api-auth:ledger-api-auth * //extractor:extractor * //daml-assistant/scala-daml-project-config:scala-daml-project-config * //language-support/codegen-common:codegen-common * //language-support/scala/codegen:codegen * //language-support/codegen-main:codegen-main-lib * //ledger-service/db-backend:db-backend * //ledger-service/http-json:http-json * //daml-lf/scenario-interpreter:scenario-interpreter * //ledger/sandbox:sandbox * //navigator/backend:navigator-library * //daml-assistant/daml-sdk:sdk-lib * //daml-lf/data-scalacheck:data-scalacheck * //daml-script/test:test-lib * //ledger/ledger-api-common:ledger-api-common-scala-tests-lib * //ledger/test-common:test-common * //ledger/sandbox:sandbox-scala-tests-lib * //extractor:extractor-scala-tests-lib * //language-support/java/bindings:bindings-java-tests-lib * //language-support/java/bindings-rxjava:bindings-java-tests-lib * //language-support/scala/bindings-akka-testing:bindings-akka-testing * //language-support/scala/codegen-testing:codegen-testing * //language-support/scala/codegen-sample-app:daml-lf-codegen-sample-app * //language-support/scala/codegen-sample-app:daml-lf-codegen-sample-app-testing * //language-support/scala/codegen-testing:codegen-testing-testing * //ledger-api/sample-service:sample-service * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests-lib * //ledger/ledger-api-test-tool:ledger-api-test-tool-lib * //ledger/ledger-api-test-tool:ledger-api-test-tool-tests * //ledger/participant-state/kvutils:kvutils * //ledger/sandbox:ledger-api-server * //ledger/sandbox-perf:sandbox-perf-lib * //navigator/backend:navigator-tests-library * UNDO scala_library_suite --> scala_library This reverts commit ab3eb1ae23139e2ec431ab4551fbb0371e0354e1. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-06 20:14:21 +03:00
runtime_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:io_grpc_grpc_netty",
"@maven//:org_tpolecat_doobie_postgres_2_12",
],
deps = [
":extractor",
"//daml-lf/data",
"//daml-lf/interface",
"//language-support/scala/bindings",
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger-service/utils",
"//ledger/ledger-api-client",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//ledger/sandbox",
"//ledger/sandbox:sandbox-scala-tests-lib",
"//libs-scala/auth-utils",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
"@maven//:com_chuusai_shapeless_2_12",
"@maven//:com_lihaoyi_sourcecode_2_12",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
"@maven//:io_circe_circe_core_2_12",
"@maven//:io_circe_circe_parser_2_12",
"@maven//:io_netty_netty_handler",
"@maven//:org_postgresql_postgresql",
"@maven//:org_scalacheck_scalacheck_2_12",
"@maven//:org_scalactic_scalactic_2_12",
"@maven//:org_scalatest_scalatest_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_tpolecat_doobie_core_2_12",
"@maven//:org_tpolecat_doobie_free_2_12",
"@maven//:org_typelevel_cats_core_2_12",
"@maven//:org_typelevel_cats_effect_2_12",
"@maven//:org_typelevel_cats_free_2_12",
"@maven//:org_typelevel_cats_kernel_2_12",
],
2019-04-04 11:33:38 +03:00
)
da_scala_test_suite(
name = "extractor-scala-tests",
size = "medium",
srcs = glob(["src/test/suite/**/*.scala"]),
2019-04-04 11:33:38 +03:00
data = [
"//daml-lf/encoder:testing-dar-dev",
"//daml-lf/encoder:testing-dar-latest",
2019-04-15 17:45:08 +03:00
"//extractor:PrimitiveTypes.dar",
"//extractor:RecordsAndVariants.dar",
"//extractor:TransactionExample.dar",
"//extractor:VeryLargeArchive.dar",
"//ledger/test-common:Test-stable.dar",
"//ledger/test-common/test-certificates",
2019-04-04 11:33:38 +03:00
],
resources = glob(["src/test/resources/**/*"]),
2019-04-04 11:33:38 +03:00
deps = [
Remove unused dependencies to da_scala_test(_suite) (#3925) * Remove unused scala.bzl imports * override_targets org.scalatest.scalatest_2.12 Otherwise, rules_scala implicitly adds a different version to scala_test than other packages transitively depending on scalatest. This causes unused dependency checker to raise an error. * Handle rules_scala scalatest in pom_file.bzl * Inline all scala_test dependencies So that `unused_dependency_checker = "error"` can be applied to them. * Run //:buildifier-fix * TMP scala_test_suite --> scala_test * da_scala_test: Enable unused dependency checker * //navigator/backend:navigator-scala-tests * //ledger/sandbox:sandbox-scala-tests * //ledger/participant-state/kvutils:kvutils-tests * //ledger/participant-state:participant-state-tests * //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test * //ledger/ledger-api-common:ledger-api-common-scala-tests * //ledger/ledger-api-client:ledger-api-client-tests * //ledger/ledger-api-auth:ledger-api-auth-scala-tests * //ledger-service/lf-value-json:tests * //ledger-service/jwt:tests * //ledger-service/http-json:tests * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests * //language-support/scala/codegen-sample-app:tests * //language-support/scala/codegen-sample-app:ScalaCodeGenIT * //language-support/scala/codegen:tests * //language-support/scala/bindings-akka:tests * //language-support/java/codegen:test * //language-support/java/codegen:ledger-tests * //language-support/java/bindings-rxjava:bindings-java-tests * //language-support/codegen-common:test * //extractor:extractor-scala-tests * //daml-lf/scenario-interpreter:scenario-interpreter_tests * //daml-lf/language:language-test * //daml-lf/interface:tests * //daml-lf/engine:tests * //daml-lf/encoder:tests * //daml-lf/archive:daml_lf_archive_reader_tests * //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests * UNDO scala_test_suite --> scala_test This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 16:49:59 +03:00
":extractor",
":extractor-scala-tests-lib",
Remove unused dependencies to da_scala_test(_suite) (#3925) * Remove unused scala.bzl imports * override_targets org.scalatest.scalatest_2.12 Otherwise, rules_scala implicitly adds a different version to scala_test than other packages transitively depending on scalatest. This causes unused dependency checker to raise an error. * Handle rules_scala scalatest in pom_file.bzl * Inline all scala_test dependencies So that `unused_dependency_checker = "error"` can be applied to them. * Run //:buildifier-fix * TMP scala_test_suite --> scala_test * da_scala_test: Enable unused dependency checker * //navigator/backend:navigator-scala-tests * //ledger/sandbox:sandbox-scala-tests * //ledger/participant-state/kvutils:kvutils-tests * //ledger/participant-state:participant-state-tests * //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test * //ledger/ledger-api-common:ledger-api-common-scala-tests * //ledger/ledger-api-client:ledger-api-client-tests * //ledger/ledger-api-auth:ledger-api-auth-scala-tests * //ledger-service/lf-value-json:tests * //ledger-service/jwt:tests * //ledger-service/http-json:tests * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests * //language-support/scala/codegen-sample-app:tests * //language-support/scala/codegen-sample-app:ScalaCodeGenIT * //language-support/scala/codegen:tests * //language-support/scala/bindings-akka:tests * //language-support/java/codegen:test * //language-support/java/codegen:ledger-tests * //language-support/java/bindings-rxjava:bindings-java-tests * //language-support/codegen-common:test * //extractor:extractor-scala-tests * //daml-lf/scenario-interpreter:scenario-interpreter_tests * //daml-lf/language:language-test * //daml-lf/interface:tests * //daml-lf/engine:tests * //daml-lf/encoder:tests * //daml-lf/archive:daml_lf_archive_reader_tests * //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests * UNDO scala_test_suite --> scala_test This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 16:49:59 +03:00
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/data",
"//daml-lf/data-scalacheck",
"//daml-lf/interface",
"//daml-lf/transaction",
"//daml-lf/transaction-scalacheck",
"//language-support/scala/bindings",
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger-service/utils",
"//ledger/ledger-api-auth",
"//ledger/ledger-api-client",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//ledger/participant-state",
"//ledger/sandbox",
"//ledger/sandbox:sandbox-scala-tests-lib",
"//ledger/test-common",
"//libs-scala/auth-utils",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
"//libs-scala/resources",
Remove unused dependencies to da_scala_test(_suite) (#3925) * Remove unused scala.bzl imports * override_targets org.scalatest.scalatest_2.12 Otherwise, rules_scala implicitly adds a different version to scala_test than other packages transitively depending on scalatest. This causes unused dependency checker to raise an error. * Handle rules_scala scalatest in pom_file.bzl * Inline all scala_test dependencies So that `unused_dependency_checker = "error"` can be applied to them. * Run //:buildifier-fix * TMP scala_test_suite --> scala_test * da_scala_test: Enable unused dependency checker * //navigator/backend:navigator-scala-tests * //ledger/sandbox:sandbox-scala-tests * //ledger/participant-state/kvutils:kvutils-tests * //ledger/participant-state:participant-state-tests * //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test * //ledger/ledger-api-common:ledger-api-common-scala-tests * //ledger/ledger-api-client:ledger-api-client-tests * //ledger/ledger-api-auth:ledger-api-auth-scala-tests * //ledger-service/lf-value-json:tests * //ledger-service/jwt:tests * //ledger-service/http-json:tests * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests * //language-support/scala/codegen-sample-app:tests * //language-support/scala/codegen-sample-app:ScalaCodeGenIT * //language-support/scala/codegen:tests * //language-support/scala/bindings-akka:tests * //language-support/java/codegen:test * //language-support/java/codegen:ledger-tests * //language-support/java/bindings-rxjava:bindings-java-tests * //language-support/codegen-common:test * //extractor:extractor-scala-tests * //daml-lf/scenario-interpreter:scenario-interpreter_tests * //daml-lf/language:language-test * //daml-lf/interface:tests * //daml-lf/engine:tests * //daml-lf/encoder:tests * //daml-lf/archive:daml_lf_archive_reader_tests * //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests * UNDO scala_test_suite --> scala_test This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 16:49:59 +03:00
"//libs-scala/timer-utils",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_chuusai_shapeless_2_12",
"@maven//:com_github_scopt_scopt_2_12",
"@maven//:com_lihaoyi_sourcecode_2_12",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
"@maven//:io_circe_circe_core_2_12",
"@maven//:io_circe_circe_parser_2_12",
"@maven//:io_netty_netty_handler",
Remove unused dependencies to da_scala_test(_suite) (#3925) * Remove unused scala.bzl imports * override_targets org.scalatest.scalatest_2.12 Otherwise, rules_scala implicitly adds a different version to scala_test than other packages transitively depending on scalatest. This causes unused dependency checker to raise an error. * Handle rules_scala scalatest in pom_file.bzl * Inline all scala_test dependencies So that `unused_dependency_checker = "error"` can be applied to them. * Run //:buildifier-fix * TMP scala_test_suite --> scala_test * da_scala_test: Enable unused dependency checker * //navigator/backend:navigator-scala-tests * //ledger/sandbox:sandbox-scala-tests * //ledger/participant-state/kvutils:kvutils-tests * //ledger/participant-state:participant-state-tests * //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test * //ledger/ledger-api-common:ledger-api-common-scala-tests * //ledger/ledger-api-client:ledger-api-client-tests * //ledger/ledger-api-auth:ledger-api-auth-scala-tests * //ledger-service/lf-value-json:tests * //ledger-service/jwt:tests * //ledger-service/http-json:tests * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests * //language-support/scala/codegen-sample-app:tests * //language-support/scala/codegen-sample-app:ScalaCodeGenIT * //language-support/scala/codegen:tests * //language-support/scala/bindings-akka:tests * //language-support/java/codegen:test * //language-support/java/codegen:ledger-tests * //language-support/java/bindings-rxjava:bindings-java-tests * //language-support/codegen-common:test * //extractor:extractor-scala-tests * //daml-lf/scenario-interpreter:scenario-interpreter_tests * //daml-lf/language:language-test * //daml-lf/interface:tests * //daml-lf/engine:tests * //daml-lf/encoder:tests * //daml-lf/archive:daml_lf_archive_reader_tests * //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests * UNDO scala_test_suite --> scala_test This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 16:49:59 +03:00
"@maven//:org_scalacheck_scalacheck_2_12",
"@maven//:org_scalactic_scalactic_2_12",
"@maven//:org_scalatest_scalatest_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_scalaz_scalaz_scalacheck_binding_2_12",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_tpolecat_doobie_core_2_12",
"@maven//:org_tpolecat_doobie_free_2_12",
"@maven//:org_typelevel_cats_core_2_12",
"@maven//:org_typelevel_cats_effect_2_12",
"@maven//:org_typelevel_cats_free_2_12",
"@maven//:org_typelevel_cats_kernel_2_12",
],
2019-04-04 11:33:38 +03:00
)
exports_files(["src/main/resources/logback.xml"])