diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java index 9849565699..65b98ca456 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java @@ -81,41 +81,18 @@ public class ObjcRuleClasses { /** * Returns a {@link IntermediateArtifacts} to be used to compile and link the ObjC source files - * in {@code j2ObjcSource}. + * generated by J2ObjC. */ - static IntermediateArtifacts j2objcIntermediateArtifacts(RuleContext ruleContext, - J2ObjcSource j2ObjcSource) { + static IntermediateArtifacts j2objcIntermediateArtifacts(RuleContext ruleContext) { // We need to append "_j2objc" to the name of the generated archive file to distinguish it from // the C/C++ archive file created by proto_library targets with attribute cc_api_version // specified. return new IntermediateArtifacts( ruleContext, - j2ObjcSource.getTargetLabel(), /*archiveFileNameSuffix=*/"_j2objc"); } /** - * Returns an {@link Iterable} of {@link Artifact}s containing all the j2objc archives from the - * transitive closure of the rule through the "deps" attribute. This is useful for ensuring that - * the j2objc archives are present for linking. - * - * @param ruleContext the {@link RuleContext} of the current rule - * @return an {@link Iterable} of j2objc library archive artifacts. - */ - static Iterable<Artifact> j2ObjcLibraries(RuleContext ruleContext) { - ImmutableList.Builder<Artifact> j2objcLibraries = new ImmutableList.Builder<>(); - - // TODO(bazel-team): Refactor the code to stop flattening the nested set here. - for (J2ObjcSource j2ObjcSource : J2ObjcSrcsProvider.buildFrom(ruleContext).getSrcs()) { - if (j2ObjcSource.hasSourceFiles()) { - j2objcLibraries.add(j2objcIntermediateArtifacts(ruleContext, j2ObjcSource).archive()); - } - } - - return j2objcLibraries.build(); - } - - /** * Returns a {@link J2ObjcMappingFileProvider} containing J2ObjC mapping files from rules * that can be reached transitively through the "deps" attribute. * @@ -763,6 +740,8 @@ public class ObjcRuleClasses { .singleArtifact() .value(env.getLabel( env.getToolsRepository() + "//tools/objc:j2objc_dead_code_pruner"))) + .add(attr("$dummy_lib", LABEL) + .value(env.getLabel("//tools/objc:dummy_lib"))) .build(); } @Override |