aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules
diff options
context:
space:
mode:
authorGravatar Sergio Campama <kaipi@google.com>2016-06-22 18:00:40 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-06-23 11:09:43 +0000
commitdc3dad6a905be2ae76d3b1213d7154bf112d1220 (patch)
tree858032df447bf28d59c24d7d1a01463ca3171efe /src/main/java/com/google/devtools/build/lib/rules
parent002250a99fee65354567898269dedca5cfe316e2 (diff)
Support for the compatibility generation of pbobjc.h files by the PB2 library. Previously it was gated by the use_objc_header_names attribute. Now, if the flag isn't set, it will generate both the pb and pbobjc ones, simplifying switching between libraries.
-- MOS_MIGRATED_REVID=125584211
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ProtoSupport.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoSupport.java
index d53d37dc47..cc552eb1ca 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoSupport.java
@@ -419,8 +419,15 @@ final class ProtoSupport {
}
private ImmutableList<Artifact> getGeneratedHeaders() {
- boolean useObjcName = attributes.usesObjcHeaderNames() || usesProtobufLibrary();
- return generatedOutputArtifacts(FileType.of(".pb" + (useObjcName ? "objc.h" : ".h")));
+ ImmutableList.Builder<Artifact> headers = new ImmutableList.Builder<>();
+ headers.addAll(generatedOutputArtifacts(FileType.of(".pbobjc.h")));
+ if (!usesProtobufLibrary()) {
+ // As part of the compatibility layer between PB2 and protobuf, PB2 generates both pb.h and
+ // pbobjc.h files, easing the migration out of PB2.
+ headers.addAll(generatedOutputArtifacts(FileType.of(".pb.h")));
+ }
+
+ return headers.build();
}
private ImmutableList<Artifact> getGeneratedSources() {