Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 1 | load("//frc971/downloader:downloader.bzl", "aos_downloader") |
| 2 | load("//tools/build_rules:label.bzl", "expand_label") |
Lee Mracek | 6821fe0 | 2018-11-01 17:27:30 -0400 | [diff] [blame] | 3 | |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 4 | def robot_downloader(start_binaries, binaries = [], data = [], dirs = None, default_target = None): |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 5 | """Sets up the standard robot download targets. |
Lee Mracek | 6821fe0 | 2018-11-01 17:27:30 -0400 | [diff] [blame] | 6 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 7 | 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 Mracek | 6821fe0 | 2018-11-01 17:27:30 -0400 | [diff] [blame] | 12 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 13 | aos_downloader( |
| 14 | name = "download", |
| 15 | start_srcs = [ |
| 16 | "//aos:prime_start_binaries", |
| 17 | ] + start_binaries, |
| 18 | srcs = [ |
| 19 | "//aos:prime_binaries", |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 20 | ] + binaries + data, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 21 | dirs = dirs, |
| 22 | default_target = default_target, |
| 23 | restricted_to = ["//tools:roborio"], |
| 24 | ) |
Lee Mracek | 6821fe0 | 2018-11-01 17:27:30 -0400 | [diff] [blame] | 25 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 26 | 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 Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 33 | ] + [expand_label(binary) + ".stripped" for binary in binaries] + data, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 34 | dirs = dirs, |
| 35 | default_target = default_target, |
| 36 | restricted_to = ["//tools:roborio"], |
| 37 | ) |