2020-03-27 03:26:10 +03:00
|
|
|
# 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(
|
2019-04-12 14:10:16 +03:00
|
|
|
"//bazel_tools:scala.bzl",
|
|
|
|
"da_scala_binary",
|
|
|
|
"da_scala_library",
|
|
|
|
"da_scala_test_suite",
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
load(
|
2019-04-12 14:10:16 +03:00
|
|
|
"//rules_daml:daml.bzl",
|
|
|
|
"daml_compile",
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
2019-10-17 14:17:21 +03:00
|
|
|
load(
|
|
|
|
"//daml-lf/language:daml-lf.bzl",
|
|
|
|
"lf_dev_version",
|
2019-11-07 12:51:18 +03:00
|
|
|
"lf_stable_version",
|
2019-10-17 14:17:21 +03:00
|
|
|
)
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2019-05-28 22:13:54 +03:00
|
|
|
TEST_DARS = [
|
|
|
|
"RecordsAndVariants",
|
|
|
|
"PrimitiveTypes",
|
|
|
|
"TransactionExample",
|
|
|
|
]
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2019-05-28 22:13:54 +03:00
|
|
|
[
|
|
|
|
daml_compile(
|
|
|
|
name = darmod,
|
2020-03-19 02:06:55 +03:00
|
|
|
srcs = ["src/test/resources/damls/%s.daml" % darmod],
|
2019-10-17 14:17:21 +03:00
|
|
|
# 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,
|
2019-05-28 22:13:54 +03:00
|
|
|
)
|
|
|
|
for darmod in TEST_DARS
|
|
|
|
]
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2019-06-07 18:49:30 +03:00
|
|
|
genrule(
|
|
|
|
name = "VeryLargeArchive_src",
|
|
|
|
outs = ["VeryLargeArchive/Blobs.daml"] + ["VeryLargeArchive/Blob%s.daml" % n for n in range(
|
|
|
|
1,
|
2019-06-07 22:06:33 +03:00
|
|
|
32 + 1,
|
2019-06-07 18:49:30 +03:00
|
|
|
)],
|
|
|
|
cmd =
|
|
|
|
'''
|
2019-06-07 22:06:33 +03:00
|
|
|
filecount=32
|
2019-06-07 18:49:30 +03:00
|
|
|
outs=($(OUTS))
|
|
|
|
main="$${outs[0]}"
|
|
|
|
echo 'daml 1.2
|
|
|
|
module VeryLargeArchive.Blobs where
|
2019-07-03 20:48:42 +03:00
|
|
|
import VeryLargeArchive.Blob1()' > "$$main"
|
2019-06-07 18:49:30 +03:00
|
|
|
firstfil="$${outs[1]}"
|
|
|
|
echo 'daml 1.2
|
|
|
|
module VeryLargeArchive.Blob1 where
|
|
|
|
' > "$$firstfil"
|
2019-06-07 22:06:33 +03:00
|
|
|
{ for linen in `seq 1 1024`; do
|
2019-06-07 18:49:30 +03:00
|
|
|
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
|
2019-07-03 20:48:42 +03:00
|
|
|
echo "import VeryLargeArchive.Blob$$filen()" >> "$$main"
|
2019-06-07 18:49:30 +03:00
|
|
|
sed -e '2s/^\\(module .*\\)1/\\1'$$filen/ "$$firstfil" > "$${outs[$$filen]}"
|
|
|
|
done
|
|
|
|
''',
|
|
|
|
)
|
|
|
|
|
|
|
|
daml_compile(
|
|
|
|
name = "VeryLargeArchive",
|
2020-03-19 02:06:55 +03:00
|
|
|
srcs = [
|
|
|
|
":VeryLargeArchive/Blobs.daml",
|
|
|
|
":VeryLargeArchive_src",
|
|
|
|
],
|
2019-06-07 18:49:30 +03:00
|
|
|
)
|
|
|
|
|
2019-04-04 11:33:38 +03:00
|
|
|
da_scala_library(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "extractor",
|
|
|
|
srcs = glob(["src/main/scala/**/*.scala"]),
|
|
|
|
resources = glob(["src/main/resources/**/*"]),
|
2019-11-29 16:26:47 +03:00
|
|
|
visibility = ["//visibility:public"],
|
2019-04-12 14:10:16 +03:00
|
|
|
runtime_deps = [
|
2019-10-28 15:53:14 +03:00
|
|
|
"@maven//:ch_qos_logback_logback_classic",
|
|
|
|
"@maven//:ch_qos_logback_logback_core",
|
2020-01-06 20:14:21 +03:00
|
|
|
"@maven//:org_tpolecat_doobie_postgres_2_12",
|
2019-04-12 14:10:16 +03:00
|
|
|
],
|
2020-01-06 15:58:56 +03:00
|
|
|
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",
|
2020-03-03 11:59:15 +03:00
|
|
|
"//libs-scala/ports",
|
2020-01-06 15:58:56 +03:00
|
|
|
"//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(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "extractor-binary",
|
2020-04-05 20:49:57 +03:00
|
|
|
main_class = "com.daml.extractor.Main",
|
2019-04-12 19:30:49 +03:00
|
|
|
tags = [
|
2020-04-01 12:41:18 +03:00
|
|
|
"maven_coordinates=com.daml:extractor:__VERSION__",
|
2019-04-12 19:30:49 +03:00
|
|
|
"no_scala_version_suffix",
|
|
|
|
],
|
2019-04-12 14:10:16 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":extractor",
|
|
|
|
],
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_library(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "extractor-scala-tests-lib",
|
|
|
|
srcs = glob(["src/test/lib/**/*.scala"]),
|
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",
|
|
|
|
],
|
2020-01-06 15:58:56 +03:00
|
|
|
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",
|
2020-03-03 11:59:15 +03:00
|
|
|
"//libs-scala/ports",
|
2020-01-24 14:48:36 +03:00
|
|
|
"//libs-scala/postgresql-testing",
|
2020-01-06 15:58:56 +03:00
|
|
|
"@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",
|
2020-03-12 18:04:46 +03:00
|
|
|
"@maven//:io_netty_netty_handler",
|
2020-01-06 15:58:56 +03:00
|
|
|
"@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",
|
2019-06-17 10:40:28 +03:00
|
|
|
size = "medium",
|
2019-04-12 14:10:16 +03:00
|
|
|
srcs = glob(["src/test/suite/**/*.scala"]),
|
2019-04-04 11:33:38 +03:00
|
|
|
data = [
|
2019-11-28 15:31:28 +03:00
|
|
|
"//daml-lf/encoder:testing-dar-dev",
|
2019-07-12 22:06:44 +03:00
|
|
|
"//daml-lf/encoder:testing-dar-latest",
|
2019-04-15 17:45:08 +03:00
|
|
|
"//extractor:PrimitiveTypes.dar",
|
|
|
|
"//extractor:RecordsAndVariants.dar",
|
|
|
|
"//extractor:TransactionExample.dar",
|
2019-06-07 18:49:30 +03:00
|
|
|
"//extractor:VeryLargeArchive.dar",
|
2019-11-19 19:12:25 +03:00
|
|
|
"//ledger/test-common:Test-stable.dar",
|
2020-03-13 14:12:34 +03:00
|
|
|
"//ledger/test-common/test-certificates",
|
2019-04-04 11:33:38 +03:00
|
|
|
],
|
2019-04-12 14:10:16 +03:00
|
|
|
resources = glob(["src/test/resources/**/*"]),
|
2019-04-04 11:33:38 +03:00
|
|
|
deps = [
|
2019-12-30 16:49:59 +03:00
|
|
|
":extractor",
|
2019-04-12 14:10:16 +03:00
|
|
|
":extractor-scala-tests-lib",
|
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",
|
2020-03-03 11:59:15 +03:00
|
|
|
"//libs-scala/ports",
|
2020-01-24 14:48:36 +03:00
|
|
|
"//libs-scala/postgresql-testing",
|
2020-02-14 16:52:45 +03:00
|
|
|
"//libs-scala/resources",
|
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",
|
2020-03-12 18:04:46 +03:00
|
|
|
"@maven//:io_netty_netty_handler",
|
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
|
|
|
)
|
2019-12-12 16:02:23 +03:00
|
|
|
|
|
|
|
exports_files(["src/main/resources/logback.xml"])
|