James Kuszmaul | 464012b | 2024-03-20 14:12:08 -0700 | [diff] [blame] | 1 | def clean_dep(target): |
| 2 | """Returns string to 'target' in @org_frc971 repository. |
| 3 | |
| 4 | Use this function when referring to targets in the @org_frc971 |
| 5 | repository from macros that may be called from external repositories. |
| 6 | |
| 7 | This is stolen from tensorflow.bzl (https://github.com/tensorflow/tensorflow/blob/69b50ff7537c7e9bea8ad45b973f75e66a9a0fb9/tensorflow/tensorflow.bzl#L102C1-L111C30). |
| 8 | """ |
| 9 | |
| 10 | # A repo-relative label is resolved relative to the file in which the |
| 11 | # Label() call appears, i.e. @org_frc971. |
| 12 | return str(Label(target)) |
James Kuszmaul | ac0912d | 2024-05-21 15:56:59 -0700 | [diff] [blame] | 13 | |
| 14 | def aos_repo_name(): |
| 15 | """Returns a string representing the current name of the @org_frc971/@aos repo.""" |
| 16 | |
| 17 | # Use an arbitrary target for our label |
| 18 | label_name = Label("//:fake_target").workspace_name |
| 19 | return label_name if label_name else "org_frc971" |