blob: aff34202aa27f1d511e79b580eb1545d0bdc18f3 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001load("//frc971/downloader:downloader.bzl", "aos_downloader")
2load("//tools/build_rules:label.bzl", "expand_label")
Lee Mracek6821fe02018-11-01 17:27:30 -04003
Austin Schuhed5b26d2019-12-05 20:51:59 -08004def robot_downloader(start_binaries, binaries = [], data = [], dirs = None, default_target = None):
Alex Perrycb7da4b2019-08-28 19:35:56 -07005 """Sets up the standard robot download targets.
Lee Mracek6821fe02018-11-01 17:27:30 -04006
Alex Perrycb7da4b2019-08-28 19:35:56 -07007 Attrs:
8 start_binaries: A list of cc_binary targets to start on the robot.
9 dirs: Passed through to aos_downloader.
10 default_target: Passed through to aos_downloader.
11 """
Lee Mracek6821fe02018-11-01 17:27:30 -040012
Alex Perrycb7da4b2019-08-28 19:35:56 -070013 aos_downloader(
14 name = "download",
15 start_srcs = [
16 "//aos:prime_start_binaries",
17 ] + start_binaries,
18 srcs = [
19 "//aos:prime_binaries",
Austin Schuhed5b26d2019-12-05 20:51:59 -080020 ] + binaries + data,
Alex Perrycb7da4b2019-08-28 19:35:56 -070021 dirs = dirs,
22 default_target = default_target,
23 restricted_to = ["//tools:roborio"],
24 )
Lee Mracek6821fe02018-11-01 17:27:30 -040025
Alex Perrycb7da4b2019-08-28 19:35:56 -070026 aos_downloader(
27 name = "download_stripped",
28 start_srcs = [
29 "//aos:prime_start_binaries_stripped",
30 ] + [expand_label(binary) + ".stripped" for binary in start_binaries],
31 srcs = [
32 "//aos:prime_binaries_stripped",
Austin Schuhed5b26d2019-12-05 20:51:59 -080033 ] + [expand_label(binary) + ".stripped" for binary in binaries] + data,
Alex Perrycb7da4b2019-08-28 19:35:56 -070034 dirs = dirs,
35 default_target = default_target,
36 restricted_to = ["//tools:roborio"],
37 )