aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar Sergio Campama <kaipi@google.com>2016-06-23 19:32:09 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-06-24 08:12:16 +0000
commite36a9bb5699be1d0e2d08eb11e9c353e6e6fa92d (patch)
tree1a976b324c0de8d9dc4f4bbf44d25d4e39c25e02 /src/main/java/com/google/devtools/build
parent353988a97bfef72151d7e45d4ab9bed1ea456071 (diff)
*** Reason for rollback *** Needs more design as it would fail on some edge cases *** Original change description *** 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=125705664
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ProtoSupport.java11
1 files changed, 2 insertions, 9 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 cc552eb1ca..d53d37dc47 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,15 +419,8 @@ final class ProtoSupport {
}
private ImmutableList<Artifact> getGeneratedHeaders() {
- 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();
+ boolean useObjcName = attributes.usesObjcHeaderNames() || usesProtobufLibrary();
+ return generatedOutputArtifacts(FileType.of(".pb" + (useObjcName ? "objc.h" : ".h")));
}
private ImmutableList<Artifact> getGeneratedSources() {