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 | 32 |
1 files changed, 23 insertions, 9 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 dec8cc582c..32716a65d6 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 @@ -83,7 +83,7 @@ public class ObjcRuleClasses { ruleContext.getBinOrGenfilesDirectory()); } - static IntermediateArtifacts intermediateArtifacts(RuleContext ruleContext) { + public static IntermediateArtifacts intermediateArtifacts(RuleContext ruleContext) { return new IntermediateArtifacts( ruleContext.getAnalysisEnvironment(), ruleContext.getBinOrGenfilesDirectory(), ruleContext.getLabel(), /*archiveFileNameSuffix=*/""); @@ -314,7 +314,20 @@ public class ObjcRuleClasses { private static final FileType NON_CPP_SOURCES = FileType.of(".m", ".c"); - static final FileTypeSet SRCS_TYPE = FileTypeSet.of(NON_CPP_SOURCES, CPP_SOURCES); + /** + * Header files, which are not compiled directly, but may be included/imported from source files. + */ + static final FileType HEADERS = FileType.of(".h"); + + /** + * Files allowed in the srcs attribute. This includes private headers. + */ + static final FileTypeSet SRCS_TYPE = FileTypeSet.of(NON_CPP_SOURCES, CPP_SOURCES, HEADERS); + + /** + * Files that should actually be compiled. + */ + static final FileTypeSet COMPILABLE_SRCS_TYPE = FileTypeSet.of(NON_CPP_SOURCES, CPP_SOURCES); static final FileTypeSet NON_ARC_SRCS_TYPE = FileTypeSet.of(FileType.of(".m", ".mm")); @@ -494,8 +507,8 @@ public class ObjcRuleClasses { public RuleClass build(Builder builder, RuleDefinitionEnvironment env) { return builder /* <!-- #BLAZE_RULE($objc_compile_dependency_rule).ATTRIBUTE(hdrs) --> - The list of Objective-C files that are included as headers by source - files in this rule or by users of this library. + The list of C, C++, Objective-C, and Objective-C++ files that are + included as headers by source files in this rule or by users of this library. ${SYNOPSIS} <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/ .add(attr("hdrs", LABEL_LIST) @@ -551,12 +564,13 @@ public class ObjcRuleClasses { public RuleClass build(Builder builder, RuleDefinitionEnvironment env) { return builder /* <!-- #BLAZE_RULE($objc_compiling_rule).ATTRIBUTE(srcs) --> - The list of C, C++, Objective-C, and Objective-C++ files that are - processed to create the library target. + The list of C, C++, Objective-C, and Objective-C++ source and header + files that are processed to create the library target. ${SYNOPSIS} - These are your checked-in source files, plus any generated files. - These are compiled into .o files with Clang, so headers should not go - here (see the hdrs attribute). + These are your checked-in files, plus any generated files. + Source files are compiled into .o files with Clang. Header files + may be included/imported by any source or header in this target, + but not by any targets that depend on this rule. <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/ .add(attr("srcs", LABEL_LIST) .direct_compile_time_input() |