diff --git a/willow/proto/shell/BUILD b/willow/proto/shell/BUILD new file mode 100644 index 0000000..e40bf52 --- /dev/null +++ b/willow/proto/shell/BUILD @@ -0,0 +1,63 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") +load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@protobuf//bazel:proto_library.bzl", "proto_library") +load("@protobuf//rust:defs.bzl", "rust_proto_library") + +package( + default_visibility = ["//visibility:public"], +) + +# Parameters proto +proto_library( + name = "shell_parameters_proto", + srcs = ["parameters.proto"], +) + +cc_proto_library( + name = "shell_parameters_cc_proto", + deps = [":shell_parameters_proto"], +) + +rust_proto_library( + name = "shell_parameters_rust_proto", + deps = [":shell_parameters_proto"], +) + +# Utilities for parameters proto (e.g. conversion between rust structs and protos) +rust_library( + name = "shell_parameters_proto_utils", + srcs = ["parameters_proto_utils.rs"], + crate_root = "parameters_proto_utils.rs", + deps = [ + ":shell_parameters_rust_proto", + "@protobuf//rust:protobuf", + "//shell_wrapper:kahe", + "//shell_wrapper:status", + "//willow/src/shell:kahe_shell", + ], +) + +rust_test( + name = "shell_parameters_proto_utils_test", + crate = ":shell_parameters_proto_utils", + deps = [ + ":shell_parameters_proto_utils", + "@crate_index//:googletest", + "@protobuf//rust:protobuf_gtest_matchers", + "//shell_wrapper:status", + ], +) diff --git a/willow/src/shell/parameters.proto b/willow/proto/shell/parameters.proto similarity index 100% rename from willow/src/shell/parameters.proto rename to willow/proto/shell/parameters.proto diff --git a/willow/src/shell/parameters_utils.rs b/willow/proto/shell/parameters_proto_utils.rs similarity index 100% rename from willow/src/shell/parameters_utils.rs rename to willow/proto/shell/parameters_proto_utils.rs diff --git a/willow/src/shell/BUILD b/willow/src/shell/BUILD index eb679dd..6032aec 100644 --- a/willow/src/shell/BUILD +++ b/willow/src/shell/BUILD @@ -13,9 +13,6 @@ # limitations under the License. load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") -load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") -load("@protobuf//bazel:proto_library.bzl", "proto_library") -load("@protobuf//rust:defs.bzl", "rust_proto_library") package( default_applicable_licenses = [ @@ -100,47 +97,6 @@ rust_library( ], ) -# Parameters proto -proto_library( - name = "shell_parameters_proto", - srcs = ["parameters.proto"], -) - -cc_proto_library( - name = "shell_parameters_cc_proto", - deps = [":shell_parameters_proto"], -) - -rust_proto_library( - name = "shell_parameters_rust_proto", - deps = [":shell_parameters_proto"], -) - -# Parameters utilities (e.g. conversion between rust structs and protos) -rust_library( - name = "shell_parameters_utils", - srcs = ["parameters_utils.rs"], - crate_root = "parameters_utils.rs", - deps = [ - ":kahe_shell", - ":shell_parameters_rust_proto", - "@protobuf//rust:protobuf", - "//shell_wrapper:kahe", - "//shell_wrapper:status", - ], -) - -rust_test( - name = "shell_parameters_utils_test", - crate = ":shell_parameters_utils", - deps = [ - ":shell_parameters_utils", - "@crate_index//:googletest", - "@protobuf//rust:protobuf_gtest_matchers", - "//shell_wrapper:status", - ], -) - # Parameter generation rust_library( name = "shell_parameters_generation",