diff --git a/bazel_migration/README.md b/bazel_migration/README.md index 1acfdffeaca..1e7425e6f82 100644 --- a/bazel_migration/README.md +++ b/bazel_migration/README.md @@ -51,13 +51,18 @@ OpenBSW Bazel migration │ │ ├── cmsis ✅ │ │ ├── etl ✅ │ │ └── freeRtos ✅ +│ │ └── printf ✅ │ ├── bsp/ │ │ └── bspInterrupts ✅ │ ├── bsw/ │ │ ├── async ✅ +│ │ ├── asyncConsole ✅ │ │ ├── asyncFreeRtos ✅ │ │ ├── asyncImpl ✅ +│ │ ├── cpp2can ✅ +│ │ ├── cpp2ethernet ✅ │ │ ├── io ✅ +│ │ ├── lifecycle ✅ │ │ ├── logger ✅ │ │ ├── middleware ✅ │ │ ├── bsp ✅ diff --git a/libs/3rdparty/printf/.riminfo b/libs/3rdparty/printf/.riminfo index c3f59e12914..d21dee3fc24 100644 --- a/libs/3rdparty/printf/.riminfo +++ b/libs/3rdparty/printf/.riminfo @@ -1,4 +1,4 @@ -e28bd7bd1c45852561a3b76fb4f8a76902b9dd95 +022ef680ff54d2ab6a201c762bb6167b5c77cef0 RIM Info file. You're welcome to read but don't write it. Instead, use RIM commands to do the things you want to do. @@ -7,7 +7,7 @@ BEWARE: Any manual modification will invalidate the file! remote_url : https://github.com/eyalroz/printf.git revision_sha1 : 5f2d0585a4d5a6117002d8296e68b68232a549f8 target_revision: v5.2.0 -ignores : benchmark/*,fuzz/*,test/gtest/*,Project.meta +ignores : benchmark/*,BUILD.bazel,fuzz/*,test/gtest/*,Project.meta checksum : 067b8567ea0c739e8ef11396335129519f8def2e subdir : diff --git a/libs/3rdparty/printf/BUILD.bazel b/libs/3rdparty/printf/BUILD.bazel new file mode 100644 index 00000000000..f615e564bc9 --- /dev/null +++ b/libs/3rdparty/printf/BUILD.bazel @@ -0,0 +1,50 @@ +# ******************************************************************************* +# Copyright (c) 2026 Accenture +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +expand_template( + name = "printf_config_h", + out = "include/printf_config.h", + substitutions = { + "@PRINTF_SUPPORT_DECIMAL_SPECIFIERS@": "0", + "@PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS@": "0", + "@PRINTF_SUPPORT_WRITEBACK_SPECIFIER@": "1", + "@PRINTF_SUPPORT_LONG_LONG@": "1", + "@PRINTF_ALIAS_STANDARD_FUNCTION_NAMES@": "0", + "@PRINTF_INTEGER_BUFFER_SIZE@": "32", + "@PRINTF_DECIMAL_BUFFER_SIZE@": "32", + "@DEFAULT_FLOAT_PRECISION@": "6", + "@MAX_INTEGRAL_DIGITS_FOR_DECIMAL@": "9", + }, + template = "printf_config.h.in", +) + +cc_library( + name = "printf", + srcs = [ + "src/printf/printf.c", + ":printf_config_h", + ], + hdrs = [ + "src/printf/printf.h", + ], + copts = [ + "-std=c99", + "-pedantic", + "-Wall", + "-Wextra", + "-I$(GENDIR)/libs/3rdparty/printf/include", + ], + local_defines = ["PRINTF_INCLUDE_CONFIG_H"], + strip_include_prefix = "src", + visibility = ["//visibility:public"], +) diff --git a/libs/bsw/asyncConsole/BUILD.bazel b/libs/bsw/asyncConsole/BUILD.bazel new file mode 100644 index 00000000000..5964bdce81f --- /dev/null +++ b/libs/bsw/asyncConsole/BUILD.bazel @@ -0,0 +1,33 @@ +# ******************************************************************************* +# Copyright (c) 2026 Accenture +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +cc_library( + name = "async_console", + srcs = [ + "src/console/AsyncCommandWrapper.cpp", + "src/console/AsyncConsole.cpp", + "src/console/SyncCommandWrapper.cpp", + "src/logger/ConsoleLogger.cpp", + ], + hdrs = [ + "include/console/AsyncCommandWrapper.h", + "include/console/AsyncConsole.h", + "include/console/SyncCommandWrapper.h", + "include/logger/ConsoleLogger.h", + ], + strip_include_prefix = "include", + visibility = ["//visibility:public"], + deps = [ + "//libs/bsw/async", + "//libs/bsw/util", + ], +) diff --git a/libs/bsw/cpp2can/BUILD.bazel b/libs/bsw/cpp2can/BUILD.bazel new file mode 100644 index 00000000000..52ad1b3b427 --- /dev/null +++ b/libs/bsw/cpp2can/BUILD.bazel @@ -0,0 +1,35 @@ +# ******************************************************************************* +# Copyright (c) 2026 Accenture +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +cc_library( + name = "cpp2can", + srcs = [ + "src/can/CanLogger.cpp", + "src/can/canframes/CANFrame.cpp", + "src/can/filter/AbstractStaticBitFieldFilter.cpp", + "src/can/filter/BitFieldFilter.cpp", + "src/can/filter/IntervalFilter.cpp", + "src/can/transceiver/AbstractCANTransceiver.cpp", + ], + hdrs = glob(["include/**/*.h"]), + implementation_deps = [ + "//libs/bsp/bspInterrupts:bsp_interrupts", + "//libs/bsw/bsp", + ], + strip_include_prefix = "include", + visibility = ["//visibility:public"], + deps = [ + "//libs/3rdparty/etl", + "//libs/bsw/common", + "//libs/bsw/util", + ], +) diff --git a/libs/bsw/cpp2ethernet/BUILD.bazel b/libs/bsw/cpp2ethernet/BUILD.bazel new file mode 100644 index 00000000000..65df9dedc38 --- /dev/null +++ b/libs/bsw/cpp2ethernet/BUILD.bazel @@ -0,0 +1,26 @@ +# ******************************************************************************* +# Copyright (c) 2026 Accenture +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +cc_library( + name = "cpp2ethernet", + srcs = glob(["src/**/*.cpp"]), + hdrs = glob(["include/**/*.h"]), + strip_include_prefix = "include", + visibility = ["//visibility:public"], + deps = [ + "//libs/3rdparty/etl", + "//libs/bsw/async", + "//libs/bsw/bsp", + "//libs/bsw/common", + "//libs/bsw/util", + ], +) diff --git a/libs/bsw/lifecycle/BUILD.bazel b/libs/bsw/lifecycle/BUILD.bazel new file mode 100644 index 00000000000..db580130c91 --- /dev/null +++ b/libs/bsw/lifecycle/BUILD.bazel @@ -0,0 +1,32 @@ +# ******************************************************************************* +# Copyright (c) 2026 Accenture +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +cc_library( + name = "lifecycle", + srcs = [ + "src/lifecycle/AsyncLifecycleComponent.cpp", + "src/lifecycle/LifecycleComponent.cpp", + "src/lifecycle/LifecycleLogger.cpp", + "src/lifecycle/LifecycleManager.cpp", + "src/lifecycle/LifecycleManagerForwarder.cpp", + "src/lifecycle/SimpleLifecycleComponent.cpp", + "src/lifecycle/SingleContextLifecycleComponent.cpp", + ], + hdrs = glob(["include/**/*.h"]), + strip_include_prefix = "include", + visibility = ["//visibility:public"], + deps = [ + "//libs/3rdparty/etl", + "//libs/bsw/async", + "//libs/bsw/util", + ], +)