xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/sys/basic/BUILD.bazel (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifan# Copyright 2020 The Bazel Authors. All rights reserved.
2*d4726bddSHONG Yifan#
3*d4726bddSHONG Yifan# Licensed under the Apache License, Version 2.0 (the "License");
4*d4726bddSHONG Yifan# you may not use this file except in compliance with the License.
5*d4726bddSHONG Yifan# You may obtain a copy of the License at
6*d4726bddSHONG Yifan#
7*d4726bddSHONG Yifan#    http://www.apache.org/licenses/LICENSE-2.0
8*d4726bddSHONG Yifan#
9*d4726bddSHONG Yifan# Unless required by applicable law or agreed to in writing, software
10*d4726bddSHONG Yifan# distributed under the License is distributed on an "AS IS" BASIS,
11*d4726bddSHONG Yifan# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d4726bddSHONG Yifan# See the License for the specific language governing permissions and
13*d4726bddSHONG Yifan# limitations under the License.
14*d4726bddSHONG Yifan
15*d4726bddSHONG Yifanload("@rules_rust//rust:defs.bzl", "rust_binary")
16*d4726bddSHONG Yifan
17*d4726bddSHONG Yifanpackage(default_visibility = ["//visibility:public"])
18*d4726bddSHONG Yifan
19*d4726bddSHONG Yifanrust_binary(
20*d4726bddSHONG Yifan    name = "hello_sys",
21*d4726bddSHONG Yifan    srcs = ["src/main.rs"],
22*d4726bddSHONG Yifan    edition = "2018",
23*d4726bddSHONG Yifan    # Note the `crate_unvierse` dependencies here need to have been loaded
24*d4726bddSHONG Yifan    # in the WORKSPACE file. See `//sys:sys_deps.bzl` for rmore details.
25*d4726bddSHONG Yifan    deps = ["//sys/basic/3rdparty/crates:bzip2"],
26*d4726bddSHONG Yifan)
27*d4726bddSHONG Yifan
28*d4726bddSHONG Yifansh_test(
29*d4726bddSHONG Yifan    name = "test",
30*d4726bddSHONG Yifan    srcs = ["test.sh"],
31*d4726bddSHONG Yifan    args = ["$(location :hello_sys)"],
32*d4726bddSHONG Yifan    data = [":hello_sys"],
33*d4726bddSHONG Yifan)
34