Turn the --explicit_jre_deps flag into a noop.
RELNOTES: Flag --explicit_jre_deps is now a noop.

PiperOrigin-RevId: 156570342
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 876fa3e..8f6c700 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 @@
 
   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 @@
       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 @@
     }
   };
 
-  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 @@
             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 7913e67..48025e15 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 @@
     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 b03de74..315080a 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 @@
 
   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 @@
   }
 
   /**
-   * 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 904f232..95c0c74 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 @@
         .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()