aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-05-19 19:49:42 +0200
committerGravatar Irina Iancu <elenairina@google.com>2017-05-22 14:38:16 +0200
commit0f5b170ceea1eaaebd06565bb70b429b898d72c3 (patch)
tree34378b6c0e69fb16abdf1d93ce3de3dda6d295e2 /src/main/java/com/google/devtools/build/lib/rules/objc
parent7e26731b3a76a089629d11f1bd4ca690bbfa1457 (diff)
Turn the --explicit_jre_deps flag into a noop.
RELNOTES: Flag --explicit_jre_deps is now a noop. PiperOrigin-RevId: 156570342
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java20
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcCommandLineOptions.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcConfiguration.java10
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryBaseRule.java5
4 files changed, 5 insertions, 32 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java
index 876fa3e65c..8f6c700579 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java
@@ -87,7 +87,7 @@ public class J2ObjcAspect extends NativeAspectClass implements ConfiguredAspectF
private static final ImmutableList<Attribute> JAVA_DEPENDENT_ATTRIBUTES =
ImmutableList.of(
- new Attribute(":jre_lib", Mode.TARGET),
+ new Attribute("$jre_lib", Mode.TARGET),
new Attribute("deps", Mode.TARGET),
new Attribute("exports", Mode.TARGET),
new Attribute("runtime_deps", Mode.TARGET));
@@ -96,12 +96,6 @@ public class J2ObjcAspect extends NativeAspectClass implements ConfiguredAspectF
ImmutableList.of(
new Attribute("$protobuf_lib", Mode.TARGET), new Attribute("deps", Mode.TARGET));
- private static final Label JRE_CORE_LIB =
- Label.parseAbsoluteUnchecked("//third_party/java/j2objc:jre_core_lib");
-
- private static final Label JRE_EMUL_LIB =
- Label.parseAbsoluteUnchecked("//third_party/java/j2objc:jre_emul_lib");
-
private static final String PROTO_SOURCE_FILE_BLACKLIST_ATTR = "$j2objc_proto_blacklist";
/** Flags passed to J2ObjC proto compiler plugin. */
@@ -116,15 +110,6 @@ public class J2ObjcAspect extends NativeAspectClass implements ConfiguredAspectF
}
};
- private static final LateBoundLabel<BuildConfiguration> JRE_LIB =
- new LateBoundLabel<BuildConfiguration>(JRE_CORE_LIB, J2ObjcConfiguration.class) {
- @Override
- public Label resolve(Rule rule, AttributeMap attributes, BuildConfiguration configuration) {
- return configuration.getFragment(J2ObjcConfiguration.class).explicitJreDeps()
- ? JRE_CORE_LIB : JRE_EMUL_LIB;
- }
- };
-
/** Adds additional attribute aspects and attributes to the given AspectDefinition.Builder. */
protected AspectDefinition.Builder addAdditionalAttributes(AspectDefinition.Builder builder) {
return builder.add(
@@ -198,7 +183,8 @@ public class J2ObjcAspect extends NativeAspectClass implements ConfiguredAspectF
attr(":dead_code_report", LABEL)
.cfg(HOST)
.value(DEAD_CODE_REPORT))
- .add(attr(":jre_lib", LABEL).value(JRE_LIB))
+ .add(attr("$jre_lib", LABEL)
+ .value(Label.parseAbsoluteUnchecked("//third_party/java/j2objc:jre_core_lib")))
.add(
attr("$protobuf_lib", LABEL)
.value(Label.parseAbsoluteUnchecked("//third_party/java/j2objc:proto_runtime")))
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcCommandLineOptions.java b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcCommandLineOptions.java
index 7913e67cde..48025e15b2 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcCommandLineOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcCommandLineOptions.java
@@ -64,7 +64,7 @@ public class J2ObjcCommandLineOptions extends FragmentOptions {
name = "explicit_jre_deps",
defaultValue = "true",
category = "flags",
- help = "Requires JRE dependencies to be declared in j2objc_library's jre_deps attribute."
+ help = "This flag is a noop and will be removed."
)
public boolean explicitJreDeps;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcConfiguration.java
index b03de747b3..315080a619 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcConfiguration.java
@@ -88,13 +88,11 @@ public class J2ObjcConfiguration extends Fragment {
private final List<String> translationFlags;
private final boolean removeDeadCode;
- private final boolean explicitJreDeps;
private final boolean experimentalJ2ObjcHeaderMap;
private final Optional<Label> deadCodeReport;
J2ObjcConfiguration(J2ObjcCommandLineOptions j2ObjcOptions) {
this.removeDeadCode = j2ObjcOptions.removeDeadCode;
- this.explicitJreDeps = j2ObjcOptions.explicitJreDeps;
this.experimentalJ2ObjcHeaderMap = j2ObjcOptions.experimentalJ2ObjcHeaderMap;
this.deadCodeReport = Optional.fromNullable(j2ObjcOptions.deadCodeReport);
this.translationFlags = ImmutableList.<String>builder()
@@ -134,14 +132,6 @@ public class J2ObjcConfiguration extends Fragment {
}
/**
- * Returns whether explicit JRE dependencies are required. If true, all j2objc_library rules will
- * implicitly depend on jre_core_lib instead of jre_full_lib.
- */
- public boolean explicitJreDeps() {
- return explicitJreDeps;
- }
-
- /**
* Returns whether to generate J2ObjC header map in a separate action in parallel of the J2ObjC
* transpilation action.
*/
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryBaseRule.java b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryBaseRule.java
index 904f232119..95c0c745f5 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryBaseRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryBaseRule.java
@@ -48,10 +48,7 @@ public class J2ObjcLibraryBaseRule implements RuleDefinition {
.add(attr("entry_classes", STRING_LIST))
/* <!-- #BLAZE_RULE(j2objc_library).ATTRIBUTE(jre_deps) -->
The list of additional JRE emulation libraries required by all Java code translated by this
- <code>j2objc_library</code> rule. When --explicit_jre_deps is enabled only core JRE
- functionality is included by default, so specifying additional JRE dependencies here is
- necessary. Use with --explicit_jre_deps to reduce the size of dependent binary targets.
- --explicit_jre_deps will eventually become the default behavior.
+ <code>j2objc_library</code> rule. Only core JRE functionality is linked by default.
<!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
.add(attr("jre_deps", LABEL_LIST)
.direct_compile_time_input()