- CitrineOS core extracted (CSMS OCPP 2.0.1) - OpenOCPP extracted (firmware OCPP 1.6J/2.0.1) - ShapeShifter library installed (pip install -e) - ShapeShifter specification extracted - EVerest extracted TODO updated with progress
57 lines
1.7 KiB
Python
57 lines
1.7 KiB
Python
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
|
|
interface_srcs = glob(["*.yaml"])
|
|
interface_names = [name[:-5] for name in interface_srcs]
|
|
cpp_headers = [
|
|
"generated/interfaces/{}/Implementation.hpp".format(name) for name in interface_names
|
|
] + [
|
|
"generated/interfaces/{}/Interface.hpp".format(name) for name in interface_names
|
|
] + [
|
|
"generated/interfaces/{}/Types.hpp".format(name) for name in interface_names
|
|
]
|
|
|
|
# This separate label we need to resolve path to
|
|
# the directory later in the genrule
|
|
some_output = cpp_headers[0]
|
|
|
|
filegroup(
|
|
name = "interfaces",
|
|
srcs = interface_srcs,
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
genrule(
|
|
name = "cpp-headers",
|
|
outs = cpp_headers,
|
|
srcs = interface_srcs + [
|
|
"//lib/everest/framework/schemas:schemas",
|
|
"//lib/everest/framework:dependencies.yaml",
|
|
"@everest-core//types",
|
|
"@everest-core//errors",
|
|
"@everest-core//:MODULE.bazel",
|
|
],
|
|
tools = [
|
|
"//applications/utils/ev-dev-tools:ev-cli",
|
|
],
|
|
cmd = """
|
|
$(location //applications/utils/ev-dev-tools:ev-cli) interface generate-headers \
|
|
--work-dir `dirname $(location @everest-core//:MODULE.bazel)` \
|
|
--everest-dir `dirname $(location @everest-core//:MODULE.bazel)` \
|
|
--schemas-dir `dirname $(location //lib/everest/framework:dependencies.yaml)`/schemas \
|
|
--disable-clang-format \
|
|
--output-dir `dirname $(location {some_output})`/..
|
|
""".format(
|
|
some_output = some_output
|
|
)
|
|
)
|
|
|
|
cc_library(
|
|
name = "interfaces_lib",
|
|
hdrs = [":cpp-headers"],
|
|
visibility = ["//visibility:public"],
|
|
includes = ["."],
|
|
deps = [
|
|
"//types:types_lib",
|
|
],
|
|
copts = ["-std=c++17"],
|
|
) |