19
19
_phase_coverage_jacoco = "phase_coverage_jacoco" ,
20
20
_phase_ijinfo = "phase_ijinfo" ,
21
21
_phase_javainfo = "phase_javainfo" ,
22
+ _phase_labeledjars = "phase_labeledjars" ,
22
23
_phase_library_defaultinfo = "phase_library_defaultinfo" ,
23
24
_phase_outputgroupinfo = "phase_outputgroupinfo" ,
24
25
_phase_resources = "phase_resources" ,
@@ -75,7 +76,19 @@ _compile_private_attributes = {
75
76
),
76
77
}
77
78
78
- _compile_attributes = {
79
+ _deps_checker_label_attributes = {
80
+ "deps_checker_label" : attr .string (
81
+ doc = """\
82
+ The label to identify this target in the output of the dependency checker.
83
+
84
+ By default, this is just the label of the target. But sometimes—for example, when overriding an artifact with
85
+ `rules_jvm_external` to point to your own, or defining an alias to target—you want the dependency checker to suggest
86
+ you add or remove a different label as a dependency. In that case, you can set this attribute to that label.
87
+ """ ,
88
+ ),
89
+ }
90
+
91
+ _compile_attributes = _deps_checker_label_attributes | {
79
92
"srcs" : attr .label_list (
80
93
cfg = _scala_outgoing_transition ,
81
94
doc = "The source Scala and Java files (and `-sources.jar` `.srcjar` `-src.jar` files of those)." ,
@@ -213,6 +226,7 @@ def _scala_library_implementation(ctx):
213
226
("resources" , _phase_resources ),
214
227
("classpaths" , _phase_classpaths ),
215
228
("javainfo" , _phase_javainfo ),
229
+ ("labeledjars" , _phase_labeledjars ),
216
230
("semanticdb" , _phase_semanticdb ),
217
231
("singlejar" , _phase_singlejar ),
218
232
("coverage" , _phase_coverage_jacoco ),
@@ -227,6 +241,7 @@ def _scala_binary_implementation(ctx):
227
241
("resources" , _phase_resources ),
228
242
("classpaths" , _phase_classpaths ),
229
243
("javainfo" , _phase_javainfo ),
244
+ ("labeledjars" , _phase_labeledjars ),
230
245
("semanticdb" , _phase_semanticdb ),
231
246
("singlejar" , _phase_singlejar ),
232
247
("coverage" , _phase_coverage_jacoco ),
@@ -242,6 +257,7 @@ def _scala_test_implementation(ctx):
242
257
("resources" , _phase_resources ),
243
258
("classpaths" , _phase_classpaths ),
244
259
("javainfo" , _phase_javainfo ),
260
+ ("labeledjars" , _phase_labeledjars ),
245
261
("semanticdb" , _phase_semanticdb ),
246
262
("singlejar" , _phase_singlejar ),
247
263
("coverage" , _phase_coverage_jacoco ),
@@ -458,6 +474,7 @@ To run: `bazel run <target>`
458
474
scala_import = rule (
459
475
attrs = _dicts .add (
460
476
_scala_import_private_attributes ,
477
+ _deps_checker_label_attributes ,
461
478
{
462
479
"deps" : attr .label_list (
463
480
doc = "Libraries used by this one." ,
0 commit comments