Skip to content

migrate to MODULE.bazel and remove unused files and submodules #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
* @Simba-Avionic/avionic-admin
communication-core/someip @bartoszsnieg
communication-core/someip-controller @bartoszsnieg
communication-core/network-data @bartoszsnieg
communication-core/sockets @bartoszsnieg
communication-core/network-data @Simba-Avionic/avionic-admin
communication-core/sockets @Simba-Avionic/avionic-admin
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[submodule "desktop_gui"]
path = tools/desktop_gui
url = git@github.com:Simba-Avionic/desktop_gui.git
[submodule "deployment/system_definition"]
path = deployment/system_definition
url = git@github.com:Simba-Avionic/system_definition.git
[submodule "third_party/python/someipy"]
path = third_party/python/someipy
url = git@github.com:Simba-Avionic/someipy.git
[submodule "libdoip"]
path = libdoip
url = https://github.com/Simba-Avionic/libdoip
31 changes: 31 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,34 @@
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
module(name="srp")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "bazel_skylib", version = "1.7.1")

bazel_dep(name = "nlohmann_json", version = "3.12.0", repo_name = "com_json")
bazel_dep(name = "google_benchmark", version = "1.9.2", repo_name = "com_google_benchmark")
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
bazel_dep(name = "rules_python", version = "1.4.1")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

srp_mavlink_version = "0.3"
http_archive(
name = "srp_mavlink",
strip_prefix = "simba_mavlink-"+srp_mavlink_version,
urls = ["https://github.com/Simba-Avionic/simba_mavlink/archive/refs/tags/"+srp_mavlink_version+".zip"],
type = "zip",
)



python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.defaults(
# Use python.defaults if you have defined multiple toolchain versions.
python_version = "3.9",
python_version_env = "BAZEL_PYTHON_VERSION",
)
python.toolchain(
configure_coverage_tool = True,
python_version = "3.9",
)
63 changes: 8 additions & 55 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
workspace(name="srp")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//bazel/toolchain:toolchain.bzl", "register_all_toolchains")
register_all_toolchains()

load("//third_party:deps.bzl", "deps")
deps()

load("//bazel/libs:third_party_repositories.bzl", "include_srp_platform", "include_srp_mavlink", "include_gtest_mock", "include_json")
include_srp_platform("0.0.6SQF")
srp_platform_version = "0.0.6SQF"
http_archive(
name = "srp_platform",
strip_prefix = "srp_platform-"+srp_platform_version,
urls = ["https://github.com/SRP-Platform/srp_platform/archive/refs/tags/"+srp_platform_version+".zip"],
type = "zip",
)

load("@srp_platform//:download.bzl", "download")
download()

Expand All @@ -20,51 +21,3 @@ install_python()

load("@srp_platform//:pip_install.bzl", "pip_install")
pip_install()



include_srp_mavlink("0.3")
include_gtest_mock()
include_json("3.11.3")

##### PYTHON

http_archive(
name = "doipclient",
strip_prefix = "python-doipclient-1.1.1/doipclient",
build_file = "//bazel/libs:doipclient.BUILD",
urls = ["https://github.com/jacobschaer/python-doipclient/archive/refs/tags/v1.1.1.zip"],
type = "zip",
)

http_archive(
name = "rules_python",
sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b",
strip_prefix = "rules_python-0.26.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
name = "python_3_11",
# Available versions are listed in @rules_python//python:versions.bzl.
# We recommend using the same version your team is already standardized on.
python_version = "3.11",
)

load("@python_3_11//:defs.bzl", "interpreter")

load("@rules_python//python:pip.bzl", "pip_parse")

pip_parse(
name = "pip_deps",
requirements_lock = "//third_party/python:requirements.txt",
)

load("@pip_deps//:requirements.bzl", "install_deps")

install_deps()
37 changes: 0 additions & 37 deletions bazel/libs/third_party_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,3 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""

def include_json(ver):
http_archive(
name = "com_json",
strip_prefix = "json-"+ver,
urls = ["https://github.com/nlohmann/json/archive/refs/tags/v"+ver+".zip"],
sha256 = "04022b05d806eb5ff73023c280b68697d12b93e1b7267a0b22a1a39ec7578069"
)

def include_srp_platform(ver):
http_archive(
name = "srp_platform",
strip_prefix = "srp_platform-"+ver,
urls = ["https://github.com/SRP-Platform/srp_platform/archive/refs/tags/"+ver+".zip"],
type = "zip",
)

def include_srp_mavlink(ver):
http_archive(
name = "srp_mavlink",
strip_prefix = "simba_mavlink-"+ver,
urls = ["https://github.com/Simba-Avionic/simba_mavlink/archive/refs/tags/"+ver+".zip"],
type = "zip",
)
def include_gtest_mock():
http_archive(
name = "com_google_benchmark",
sha256 = "bdefa4b03c32d1a27bd50e37ca466d8127c1688d834800c38f3c587a396188ee",
strip_prefix = "benchmark-1.5.3",
urls = ["https://github.com/google/benchmark/archive/v1.5.3.zip"],
)

http_archive(
name = "com_google_googletest",
strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015",
sha256 = "755f9a39bc7205f5a0c428e920ddad092c33c8a1b46997def3f1d4a82aded6e1",
urls = ["https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip"],
)
1 change: 0 additions & 1 deletion libdoip
Submodule libdoip deleted from 889214
Empty file removed third_party/BUILD
Empty file.
4 changes: 0 additions & 4 deletions third_party/deps.bzl

This file was deleted.

Empty file removed third_party/toolchains/BUILD
Empty file.

This file was deleted.

8 changes: 0 additions & 8 deletions third_party/toolchains/arm-cortex_a8-linux-gnueabihf.BUILD

This file was deleted.

18 changes: 0 additions & 18 deletions third_party/toolchains/toolchains.bzl

This file was deleted.

1 change: 0 additions & 1 deletion tools/desktop_gui
Submodule desktop_gui deleted from fe4782