@Override public AspectDefinition getDefinition(AspectParameters aspectParameters) { AspectDefinition.Builder builder = new AspectDefinition.Builder("parametrized_definition_aspect") .attributeAspect("foo", ParametrizedDefinitionAspect.class); ImmutableCollection<String> baz = aspectParameters.getAttribute("baz"); if (baz != null) { try { builder.add(attr("$dep", LABEL).value(Label.parseAbsolute(baz.iterator().next()))); } catch (LabelSyntaxException e) { throw new IllegalStateException(); } } return builder.build(); }
@Override protected AspectDefinition.Builder addAdditionalAttributes(AspectDefinition.Builder builder) { return builder .add( attr("$protoc_darwin", LABEL) .cfg(HOST) .exec() .value(parseLabel("//tools/objc:compile_protos"))) .add( attr("$protoc_support_darwin", LABEL) .cfg(HOST) .exec() .value(parseLabel("//tools/objc:proto_support"))) .add( attr("$j2objc_plugin", LABEL) .cfg(HOST) .exec() .value(parseLabel("//third_party/java/j2objc:proto_plugin"))); }