diff --git a/buf-kvutils.yaml b/buf-kvutils.yaml index 5007f04eb7c1..858c32d23a2a 100644 --- a/buf-kvutils.yaml +++ b/buf-kvutils.yaml @@ -9,14 +9,6 @@ build: - daml-lf/transaction/src/main/protobuf - ledger/ledger-configuration/protobuf - ledger/participant-state/kvutils/src/main/protobuf - excludes: - # We have to exclude these to avoid duplicate definitions of e.g. Unit - # within the same package. - - daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/ - - daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/ - - daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_13/ - - daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_14/ - - daml-lf/archive/src/main/protobuf/com/digitalasset/ lint: use: diff --git a/daml-lf/archive/BUILD.bazel b/daml-lf/archive/BUILD.bazel index 1d833ed8d886..043c7e71b1f2 100644 --- a/daml-lf/archive/BUILD.bazel +++ b/daml-lf/archive/BUILD.bazel @@ -28,9 +28,10 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar") filegroup( name = "daml_lf_%s_archive_proto_srcs" % version, srcs = glob([ - "src/main/protobuf/com/{package}/daml_lf_{version}/*.proto".format( - package = lf_version_package(version), - version = mangle_for_java(version), + "src/{directory}/protobuf/com/{package}/daml_lf_{version}/*.proto".format( + package = package, + version = mangled_version, + directory = directory, ), ]), ), @@ -39,17 +40,20 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar") srcs = [":daml_lf_%s_archive_proto_srcs" % version], javadoc_root_packages = [ "com.{package}.daml_lf_{version}".format( - package = lf_version_package(version), - version = mangle_for_java(version), + package = package, + version = mangled_version, ), ], maven_artifact_prefix = "daml-lf-%s-archive" % version, maven_group = "com.daml", - strip_import_prefix = "src/main/protobuf", + strip_import_prefix = "src/%s/protobuf" % directory, visibility = ["//visibility:public"], ), ] for version in PROTO_LF_VERSIONS + for package in [lf_version_package(version)] + for mangled_version in [mangle_for_java(version)] + for directory in ["main" if version == "dev" else "stable"] ] # FIXME(JM): Clean this up diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/NO_AUTO_COPYRIGHT b/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/NO_AUTO_COPYRIGHT deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/NO_AUTO_COPYRIGHT b/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/NO_AUTO_COPYRIGHT deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/NO_AUTO_COPYRIGHT b/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/NO_AUTO_COPYRIGHT deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/NO_AUTO_COPYRIGHT b/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/NO_AUTO_COPYRIGHT deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/NO_AUTO_COPYRIGHT b/daml-lf/archive/src/stable/NO_AUTO_COPYRIGHT similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/NO_AUTO_COPYRIGHT rename to daml-lf/archive/src/stable/NO_AUTO_COPYRIGHT diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/daml_lf.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_11/daml_lf.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/daml_lf.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_11/daml_lf.proto diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/daml_lf_1.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_11/daml_lf_1.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_11/daml_lf_1.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_11/daml_lf_1.proto diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/daml_lf.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_12/daml_lf.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/daml_lf.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_12/daml_lf.proto diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/daml_lf_1.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_12/daml_lf_1.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_12/daml_lf_1.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_12/daml_lf_1.proto diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_13/daml_lf.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_13/daml_lf.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_13/daml_lf.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_13/daml_lf.proto diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_13/daml_lf_1.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_13/daml_lf_1.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_13/daml_lf_1.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_13/daml_lf_1.proto diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_14/daml_lf.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_14/daml_lf.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_14/daml_lf.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_14/daml_lf.proto diff --git a/daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_14/daml_lf_1.proto b/daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_14/daml_lf_1.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/daml/daml_lf_1_14/daml_lf_1.proto rename to daml-lf/archive/src/stable/protobuf/com/daml/daml_lf_1_14/daml_lf_1.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/daml_lf.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_6/daml_lf.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/daml_lf.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_6/daml_lf.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_0.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_0.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_0.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_0.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_1.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_1.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_1.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_6/daml_lf_1.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_7/daml_lf.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_7/daml_lf.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_0.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_0.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_0.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_0.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_1.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_1.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_1.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_7/daml_lf_1.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/daml_lf.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_8/daml_lf.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/daml_lf.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_8/daml_lf.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_0.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_0.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_0.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_0.proto diff --git a/daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_1.proto b/daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_1.proto similarity index 100% rename from daml-lf/archive/src/main/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_1.proto rename to daml-lf/archive/src/stable/protobuf/com/digitalasset/daml_lf_1_8/daml_lf_1.proto diff --git a/daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/ProtoTest.scala b/daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/ProtoTest.scala index 24ce8fb040da..e0de0c25dc46 100644 --- a/daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/ProtoTest.scala +++ b/daml-lf/archive/src/test/scala/com/digitalasset/daml/lf/ProtoTest.scala @@ -206,7 +206,7 @@ class ProtoTest extends AnyWordSpec with Matchers with TableDrivenPropertyChecks s"daml_lf_1_$version files" should { val pkg = if (version < 11) "digitalasset" else "daml" - val rootDir = s"daml-lf/archive/src/main/protobuf/com/$pkg/daml_lf_1_$version" + val rootDir = s"daml-lf/archive/src/stable/protobuf/com/$pkg/daml_lf_1_$version" "not be modified" in { List( "daml_lf.proto" -> damlHashes,