Skip to content

Commit

Permalink
Factor kind projector target into a variable (#11759)
Browse files Browse the repository at this point in the history
Seems nicer than trying to format a string everywhere

changelog_begin
changelog_end
  • Loading branch information
cocreature authored Nov 18, 2021
1 parent e78bfc7 commit c8ace8b
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 49 deletions.
1 change: 1 addition & 0 deletions bazel_tools/scala.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ default_compile_arguments = {
}

silencer_plugin = "@maven//:com_github_ghik_silencer_plugin_{}".format(scala_version_suffix)
kind_projector_plugin = "@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix)

default_initial_heap_size = "128m"
default_max_heap_size = "1g"
Expand Down
4 changes: 2 additions & 2 deletions daml-lf/data-scalacheck/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"kind_projector_plugin",
"lf_scalacopts_stricter",
)
load("@scala_version//:index.bzl", "scala_version_suffix")

da_scala_library(
name = "data-scalacheck",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
Expand Down
5 changes: 3 additions & 2 deletions daml-lf/data/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test",
"kind_projector_plugin",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_major_version", "scala_version_suffix")
load("@scala_version//:index.bzl", "scala_major_version")

da_scala_library(
name = "data",
Expand All @@ -18,7 +19,7 @@ da_scala_library(
"src/main/{}/**/*.scala".format(scala_major_version),
]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down
4 changes: 2 additions & 2 deletions daml-lf/transaction-test-lib/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"kind_projector_plugin",
"lf_scalacopts_stricter",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_version_suffix")

da_scala_library(
name = "transaction-test-lib",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down
4 changes: 2 additions & 2 deletions language-support/scala/bindings-akka/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_version_suffix")

da_scala_library(
name = "bindings-akka",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
resources = glob(["src/main/resources/**/*"]),
Expand Down
7 changes: 4 additions & 3 deletions language-support/scala/bindings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
)
load("@scala_version//:index.bzl", "scala_major_version", "scala_version_suffix")
load("@scala_version//:index.bzl", "scala_major_version")

da_scala_library(
name = "bindings",
Expand All @@ -15,7 +16,7 @@ da_scala_library(
"src/main/{}/**/*.scala".format(scala_major_version),
]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
Expand Down Expand Up @@ -46,7 +47,7 @@ da_scala_test_suite(
size = "small",
srcs = glob(["src/test/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
Expand Down
4 changes: 2 additions & 2 deletions language-support/scala/codegen-sample-app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test",
"kind_projector_plugin",
"silencer_plugin",
)
load(
Expand All @@ -16,7 +17,6 @@ load(
"//daml-lf/language:daml-lf.bzl",
"lf_version_configuration",
)
load("@scala_version//:index.bzl", "scala_version_suffix")

daml_compile(
name = "MyMain",
Expand Down Expand Up @@ -45,7 +45,7 @@ da_scala_library(
name = "daml-lf-codegen-sample-app",
srcs = [":MyMain.srcjar"] + glob(["src/main/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down
9 changes: 4 additions & 5 deletions language-support/scala/codegen-testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_major_version", "scala_version_suffix")
load("@scala_version//:index.bzl", "scala_major_version")

da_scala_library(
name = "codegen-testing",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
# Plugins have to be specified as JARs.
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down Expand Up @@ -53,8 +53,7 @@ da_scala_library(
name = "codegen-testing-testing",
srcs = testing_utils + glob(["src/test/{}/com/**/*.scala".format(scala_major_version)]),
plugins = [
# Plugins have to be specified as JARs.
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
Expand Down
5 changes: 2 additions & 3 deletions language-support/scala/codegen/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ load(
"da_scala_binary",
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_version_suffix")

common_scalacopts = [
"-Xelide-below",
Expand All @@ -27,8 +27,7 @@ da_scala_library(
],
),
plugins = [
# Plugins have to be specified as JARs.
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down
6 changes: 3 additions & 3 deletions ledger-service/fetch-contracts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test",
"kind_projector_plugin",
"lf_scalacopts",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_version_suffix")

hj_scalacopts = lf_scalacopts + [
"-P:wartremover:traverser:org.wartremover.warts.NonUnitStatements",
Expand All @@ -18,7 +18,7 @@ da_scala_library(
name = "fetch-contracts",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down Expand Up @@ -51,7 +51,7 @@ da_scala_test(
size = "medium",
srcs = glob(["src/test/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down
6 changes: 3 additions & 3 deletions ledger-service/http-json-oracle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# SPDX-License-Identifier: Apache-2.0

load("@oracle//:index.bzl", "oracle_testing")
load("@scala_version//:index.bzl", "scala_version_suffix")
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"lf_scalacopts",
)

Expand All @@ -18,7 +18,7 @@ da_scala_library(
name = "integration-tests-lib",
srcs = glob(["src/itlib/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
Expand Down Expand Up @@ -73,7 +73,7 @@ da_scala_test_suite(
"//ledger/test-common/test-certificates",
],
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
resources = glob(["src/it/resources/**/*"]),
scala_deps = [
Expand Down
5 changes: 3 additions & 2 deletions ledger-service/http-json-perf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
"da_scala_library",
"kind_projector_plugin",
"lf_scalacopts",
)
load(
"//rules_daml:daml.bzl",
"daml_compile",
)
load("@scala_version//:index.bzl", "scala_major_version", "scala_version_suffix")
load("@scala_version//:index.bzl", "scala_major_version")
load(
"//daml-lf/language:daml-lf.bzl",
"lf_version_configuration",
Expand All @@ -33,7 +34,7 @@ perf_runtime_deps = {
name = "http-json-perf-{}".format(edition),
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
Expand Down
4 changes: 2 additions & 2 deletions ledger-service/http-json-testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"kind_projector_plugin",
"lf_scalacopts",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_version_suffix")

hj_scalacopts = lf_scalacopts + [
"-P:wartremover:traverser:org.wartremover.warts.NonUnitStatements",
Expand All @@ -18,7 +18,7 @@ hj_scalacopts = lf_scalacopts + [
name = "{}".format(edition),
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down
13 changes: 7 additions & 6 deletions ledger-service/http-json/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ load(
"da_scala_library",
"da_scala_test",
"da_scala_test_suite",
"kind_projector_plugin",
"lf_scalacopts",
"silencer_plugin",
)
load("//rules_daml:daml.bzl", "daml_compile")
load("@os_info//:os_info.bzl", "is_windows")
load("@scala_version//:index.bzl", "scala_major_version", "scala_version_suffix")
load("@scala_version//:index.bzl", "scala_major_version")

hj_scalacopts = lf_scalacopts + [
"-P:wartremover:traverser:org.wartremover.warts.NonUnitStatements",
Expand All @@ -24,7 +25,7 @@ hj_scalacopts = lf_scalacopts + [
name = "http-json-{}".format(edition),
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down Expand Up @@ -202,7 +203,7 @@ daml_compile(
"//ledger/test-common/test-certificates",
],
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down Expand Up @@ -348,7 +349,7 @@ alias(
"src/itpostgres/scala/**/*.scala",
]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
Expand Down Expand Up @@ -419,7 +420,7 @@ alias(
# TODO https://github.com/digital-asset/daml/issues/11585
flaky = True,
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
silencer_plugin,
],
resources = glob(["src/it/resources/**/*"]),
Expand Down Expand Up @@ -506,7 +507,7 @@ test_suite(
# See https://github.com/digital-asset/daml/issues/9886
flaky = True,
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
resources = glob(["src/failure/resources/**/*"]),
scala_deps = [
Expand Down
5 changes: 3 additions & 2 deletions ledger/ledger-api-common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_major_version", "scala_version_suffix")
load("@scala_version//:index.bzl", "scala_major_version")

da_scala_library(
name = "ledger-api-common",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
Expand Down
4 changes: 2 additions & 2 deletions libs-scala/concurrent/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test",
"kind_projector_plugin",
"lf_scalacopts",
)
load("@scala_version//:index.bzl", "scala_major_version", "scala_version_suffix")

scalacopts = lf_scalacopts + [
"-P:wartremover:traverser:org.wartremover.warts.NonUnitStatements",
Expand All @@ -17,7 +17,7 @@ da_scala_library(
name = "concurrent",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
"@maven//:org_typelevel_kind_projector_{}".format(scala_version_suffix),
kind_projector_plugin,
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
Expand Down
Loading

0 comments on commit c8ace8b

Please sign in to comment.