Files
Eric F d398a6ced2 Add extracted tools: CitrineOS, OpenOCPP, ShapeShifter
- 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
2026-06-08 00:38:27 -04:00

171 lines
5.1 KiB
Python

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_import", "cc_library", "cc_shared_library")
load("@rules_python//python:py_binary.bzl", "py_binary")
load("//third-party/bazel/toolchains:defs.bzl", "CROSS_PYTHON_INCOMPATIBLE")
py_binary(
name = "collect_migration_files",
srcs = [
".ci/build-kit/scripts/collect_migration_files.py",
],
imports = ["."],
main = ".ci/build-kit/scripts/collect_migration_files.py",
target_compatible_with = CROSS_PYTHON_INCOMPATIBLE,
)
genrule(
name = "compile_time_settings",
srcs = ["//lib/everest/framework/schemas/migrations"],
outs = ["include/everest/compile_time_settings.hpp"],
cmd = """
echo "#define EVEREST_INSTALL_PREFIX \\"/usr\\"" > $@
echo "#define EVEREST_INSTALL_LIBDIR \\"/lib\\"" >> $@
echo "#define EVEREST_NAMESPACE (\\"everest\\")" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY_LATENCY 1" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY_GREEDY 2" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY_CONSERVATIVE 3" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY_FIXED_SIZE 4" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY_CUSTOM 5" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY_LATENCY" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_LATENCY_THRESHOLD_MS 50" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_LATENCY_TICK_MS 5" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_FIXED_SIZE_THRESHOLD 3" >> $@
echo "#define EVEREST_FRAMEWORK_THREAD_POOL_SCALING_POLICY_CUSTOM_TYPE void" >> $@
$(location :collect_migration_files) --migration-files $(locations //lib/everest/framework/schemas/migrations) --output $@
""",
tools = [":collect_migration_files"],
)
genrule(
name = "version_information",
outs = ["include/generated/version_information.hpp"],
cmd = """
echo "#pragma once" > $@
echo "#define PROJECT_NAME \\"everest-framework\\"" >> $@
echo "#define PROJECT_DESCRIPTION \\"\\"" >> $@
echo "#define PROJECT_VERSION \\"\\"" >> $@
echo "#define GIT_VERSION \\"\\"" >> $@
""",
)
config_setting(
name = "_dynamic_mode_fully",
values = {"dynamic_mode": "fully"},
visibility = ["//visibility:public"],
)
cc_library(
name = "framework_lib",
srcs = glob(["lib/**/*.cpp"]),
hdrs = glob(["include/**/*.hpp"]) + [
":compile_time_settings",
":version_information",
],
cxxopts = ["-std=c++17"],
# See https://github.com/HowardHinnant/date/issues/324
local_defines = [
"BUILD_TZ_LIB=ON",
"USE_SYSTEM_TZ_DB=ON",
"USE_OS_TZDB=1",
"USE_AUTOLOAD=0",
"HAS_REMOTE_API=0",
],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//lib/everest/io:io",
"//lib/everest/helpers",
"//lib/everest/log:liblog",
"//lib/everest/sqlite:everest-sqlite",
"//lib/everest/util",
"//lib/everest/yaml:everest_yaml",
"@boost.program_options",
"@boost.uuid",
"@com_github_HowardHinnant_date//:date",
"@com_github_fmtlib_fmt//:fmt",
"@com_github_nlohmann_json//:json",
"@com_github_pboettch_json-schema-validator//:json-schema-validator",
],
)
cc_shared_library(
name = "framework_so",
shared_lib_name = "libframework.so",
deps = [":framework_lib"],
exports_filter = [":framework_lib"],
)
cc_import(
name = "framework_dynamic",
shared_library = ":framework_so",
deps = [":framework_lib"],
linkopts = ["-lframework"],
)
alias(
name = "framework",
actual = select({
":_dynamic_mode_fully": ":framework_dynamic",
"//conditions:default": ":framework_lib",
}),
visibility = ["//visibility:public"],
)
cc_library(
name = "controller-ipc",
srcs = ["src/controller/ipc.cpp"],
hdrs = ["src/controller/ipc.hpp"],
cxxopts = ["-std=c++17"],
strip_include_prefix = "src",
deps = [
"@com_github_nlohmann_json//:json",
],
)
cc_binary(
name = "controller",
srcs = glob(
[
"src/controller/*.cpp",
"src/controller/*.hpp",
],
exclude = [
"src/controller/ipc.cpp",
"src/controller/ipc.hpp",
],
),
cxxopts = ["-std=c++17"],
deps = [
":controller-ipc",
":framework",
"//lib/everest/log:liblog",
"@com_github_fmtlib_fmt//:fmt",
"@com_github_warmcatt_libwebsockets//:libwebsockets",
"@libcap",
],
)
cc_binary(
name = "manager",
srcs = glob(
[
"src/*.cpp",
"src/*.hpp",
],
),
cxxopts = ["-std=c++17"],
visibility = ["//visibility:public"],
deps = [
":controller-ipc",
":framework",
"//lib/everest/log:liblog",
"@boost.program_options",
"@com_github_fmtlib_fmt//:fmt",
"@com_github_pboettch_json-schema-validator//:json-schema-validator",
"@libcap",
],
)
exports_files([
"dependencies.yaml",
])