Skip to content

Commit

Permalink
[eclipse-iceoryx#439] Add bazel support for rust examples
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Oct 11, 2024
1 parent 2290273 commit da32b08
Show file tree
Hide file tree
Showing 9 changed files with 302 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/rust/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

package(default_visibility = ["//visibility:public"])

load("@rules_rust//rust:defs.bzl", "rust_library")

rust_library(
name = "examples-common",
srcs = glob(["_examples_common/**/*.rs"]),
)
24 changes: 24 additions & 0 deletions examples/rust/complex_data_types/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "complex_data_types",
srcs = [
"complex_data_types.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//iceoryx2-bb/container:iceoryx2-bb-container",
],
)
23 changes: 23 additions & 0 deletions examples/rust/discovery/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "discovery",
srcs = [
"discovery.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
],
)
54 changes: 54 additions & 0 deletions examples/rust/domains/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "discovery",
srcs = [
"discovery.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//iceoryx2-bb/log:iceoryx2-bb-log",
"@//iceoryx2-bb/system-types:iceoryx2-bb-system-types",
"@crate_index//:clap",
],
)

rust_binary(
name = "publisher",
srcs = [
"publisher.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//iceoryx2-bb/log:iceoryx2-bb-log",
"@//iceoryx2-bb/system-types:iceoryx2-bb-system-types",
"@//examples/rust:examples-common",
"@crate_index//:clap",
],
)

rust_binary(
name = "subscriber",
srcs = [
"subscriber.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//iceoryx2-bb/log:iceoryx2-bb-log",
"@//iceoryx2-bb/system-types:iceoryx2-bb-system-types",
"@//examples/rust:examples-common",
"@crate_index//:clap",
],
)
33 changes: 33 additions & 0 deletions examples/rust/event/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "listener",
srcs = [
"listener.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
],
)

rust_binary(
name = "notifier",
srcs = [
"notifier.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
],
)
35 changes: 35 additions & 0 deletions examples/rust/publish_subscribe/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "publisher",
srcs = [
"publisher.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//examples/rust:examples-common",
],
)

rust_binary(
name = "subscriber",
srcs = [
"subscriber.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//examples/rust:examples-common",
],
)
35 changes: 35 additions & 0 deletions examples/rust/publish_subscribe_dynamic_data/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "publisher",
srcs = [
"publisher.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//examples/rust:examples-common",
],
)

rust_binary(
name = "subscriber",
srcs = [
"subscriber.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//examples/rust:examples-common",
],
)
35 changes: 35 additions & 0 deletions examples/rust/publish_subscribe_with_user_header/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "publisher",
srcs = [
"publisher.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//examples/rust:examples-common",
],
)

rust_binary(
name = "subscriber",
srcs = [
"subscriber.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
"@//examples/rust:examples-common",
],
)
43 changes: 43 additions & 0 deletions examples/rust/service_attributes/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "creator",
srcs = [
"creator.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
],
)

rust_binary(
name = "incompatible",
srcs = [
"incompatible.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
],
)

rust_binary(
name = "opener",
srcs = [
"opener.rs",
],
deps = [
"@//iceoryx2:iceoryx2",
],
)

0 comments on commit da32b08

Please sign in to comment.