aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java12
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ProtoAttributes.java16
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ProtocolBuffers2Support.java13
3 files changed, 5 insertions, 36 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java
index 8bf1c8f6aa..64070dbac4 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java
@@ -34,7 +34,6 @@ import com.google.devtools.build.lib.packages.RuleClass;
import com.google.devtools.build.lib.packages.RuleClass.Builder;
import com.google.devtools.build.lib.rules.apple.AppleConfiguration;
import com.google.devtools.build.lib.rules.proto.ProtoSourceFileBlacklist;
-import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.util.FileType;
/**
@@ -44,7 +43,6 @@ import com.google.devtools.build.lib.util.FileType;
*/
public class ObjcProtoLibraryRule implements RuleDefinition {
static final String OPTIONS_FILE_ATTR = "options_file";
- static final String OUTPUT_CPP_ATTR = "output_cpp";
static final String USE_OBJC_HEADER_NAMES_ATTR = "use_objc_header_names";
static final String PER_PROTO_INCLUDES_ATTR = "per_proto_includes";
static final String PORTABLE_PROTO_FILTERS_ATTR = "portable_proto_filters";
@@ -82,10 +80,6 @@ public class ObjcProtoLibraryRule implements RuleDefinition {
whitelist/blacklist settings).
<!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
.add(attr(OPTIONS_FILE_ATTR, LABEL).legacyAllowAnyFileType().singleArtifact().cfg(HOST))
- /* <!-- #BLAZE_RULE(objc_proto_library).ATTRIBUTE(output_cpp)[DEPRECATED] -->
- If true, output C++ rather than ObjC.
- <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
- .add(attr(OUTPUT_CPP_ATTR, BOOLEAN).value(false))
/* <!-- #BLAZE_RULE(objc_proto_library).ATTRIBUTE(use_objc_header_names) -->
If true, output headers with .pbobjc.h, rather than .pb.h.
<!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
@@ -135,15 +129,13 @@ public class ObjcProtoLibraryRule implements RuleDefinition {
attr(PROTO_LIB_ATTR, LABEL)
.allowedRuleClasses("objc_library")
.value(
- new ComputedDefault(PORTABLE_PROTO_FILTERS_ATTR, OUTPUT_CPP_ATTR) {
+ new ComputedDefault(PORTABLE_PROTO_FILTERS_ATTR) {
@Override
public Object getDefault(AttributeMap rule) {
if (rule.isAttributeValueExplicitlySpecified(PORTABLE_PROTO_FILTERS_ATTR)) {
return env.getLabel("//external:objc_protobuf_lib");
} else {
- return rule.get(OUTPUT_CPP_ATTR, Type.BOOLEAN)
- ? env.getLabel("//external:objc_proto_cpp_lib")
- : env.getLabel("//external:objc_proto_lib");
+ return env.getLabel("//external:objc_proto_lib");
}
}
}))
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoAttributes.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoAttributes.java
index 9257c26990..6b5c42101a 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoAttributes.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ProtoAttributes.java
@@ -119,8 +119,7 @@ final class ProtoAttributes {
ruleContext.throwWithRuleError(PORTABLE_PROTO_FILTERS_EMPTY_ERROR);
}
- if (outputsCpp()
- || usesObjcHeaderNames()
+ if (usesObjcHeaderNames()
|| needsPerProtoIncludes()
|| getOptionsFile().isPresent()) {
ruleContext.throwWithRuleError(PORTABLE_PROTO_FILTERS_NOT_EXCLUSIVE_ERROR);
@@ -134,11 +133,6 @@ final class ProtoAttributes {
ruleContext.throwWithRuleError(NO_PROTOS_ERROR);
}
- if (outputsCpp()) {
- ruleContext.ruleWarning(
- "The output_cpp attribute has been deprecated. Please "
- + "refer to b/29342376 for information on possible alternatives.");
- }
if (!usesObjcHeaderNames()) {
ruleContext.ruleWarning(
"As part of the migration process, it is recommended to enable "
@@ -150,14 +144,6 @@ final class ProtoAttributes {
}
}
- /** Returns whether the generated files should be C++ or Objective C. */
- boolean outputsCpp() {
- if (ruleContext.attributes().has(ObjcProtoLibraryRule.OUTPUT_CPP_ATTR, Type.BOOLEAN)) {
- return ruleContext.attributes().get(ObjcProtoLibraryRule.OUTPUT_CPP_ATTR, Type.BOOLEAN);
- }
- return false;
- }
-
/** Returns whether the generated header files should have be of type pb.h or pbobjc.h. */
boolean usesObjcHeaderNames() {
if (ruleContext
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ProtocolBuffers2Support.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ProtocolBuffers2Support.java
index fd2694f5cb..fb051d20e0 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ProtocolBuffers2Support.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ProtocolBuffers2Support.java
@@ -134,7 +134,7 @@ final class ProtocolBuffers2Support {
}
private String getSourceExtension() {
- return ".pb" + (attributes.outputsCpp() ? ".cc" : ".m");
+ return ".pb.m";
}
private ObjcCommon getCommon() {
@@ -189,10 +189,6 @@ final class ProtocolBuffers2Support {
.add(attributes.getOptionsFile().get().getExecPathString());
}
- if (attributes.outputsCpp()) {
- commandLineBuilder.add("--generate-cpp");
- }
-
if (attributes.usesObjcHeaderNames()) {
commandLineBuilder.add("--use-objc-header-names");
}
@@ -232,12 +228,7 @@ final class ProtocolBuffers2Support {
ImmutableList.Builder<Artifact> builder = new ImmutableList.Builder<>();
for (Artifact protoFile : attributes.filterWellKnownProtos(attributes.getProtoFiles())) {
String protoFileName = FileSystemUtils.removeExtension(protoFile.getFilename());
- String generatedOutputName;
- if (attributes.outputsCpp()) {
- generatedOutputName = protoFileName;
- } else {
- generatedOutputName = attributes.getGeneratedProtoFilename(protoFileName, false);
- }
+ String generatedOutputName = attributes.getGeneratedProtoFilename(protoFileName, false);
PathFragment generatedFilePath =
new PathFragment(