Skip to content

Commit

Permalink
Stop exporting unused java builtins to native
Browse files Browse the repository at this point in the history
`BootClassPathInfo.create` was unused after the android rules deletion.

PiperOrigin-RevId: 679546563
Change-Id: I3e8f56c4f808c9cb6d53685fc297dc9d95ff630d
  • Loading branch information
hvadehra authored and copybara-github committed Sep 27, 2024
1 parent 1b9870e commit 56882d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@

import static com.google.devtools.build.lib.skyframe.BzlLoadValue.keyForBuiltins;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.Depset;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
Expand All @@ -29,12 +25,10 @@
import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException;
import com.google.devtools.build.lib.packages.StarlarkInfo;
import com.google.devtools.build.lib.packages.StarlarkInfoWithSchema;
import com.google.devtools.build.lib.packages.StarlarkProvider;
import com.google.devtools.build.lib.packages.StarlarkProviderWrapper;
import com.google.devtools.build.lib.packages.StructImpl;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Optional;
import net.starlark.java.eval.EvalException;
import net.starlark.java.eval.Starlark;

/** Information about the system APIs for a Java compilation. */
Expand Down Expand Up @@ -76,29 +70,6 @@ public static BootClassPathInfo empty() {
return EMPTY;
}

public static BootClassPathInfo create(RuleContext ruleContext, NestedSet<Artifact> bootclasspath)
throws RuleErrorException, InterruptedException {
if (bootclasspath.isEmpty()) {
return empty();
}
ruleContext.initStarlarkRuleContext();
StructImpl javaCommon = (StructImpl) ruleContext.getStarlarkDefinedBuiltin("java_common");
try {
StarlarkProvider starlarkProvider =
javaCommon.getValue("BootClassPathInfo", StarlarkProvider.class);
StarlarkInfo starlarkBootClassPathInfo =
(StarlarkInfo)
Starlark.call(
ruleContext.getStarlarkThread(),
starlarkProvider.createRawConstructor(),
ImmutableList.of(),
ImmutableMap.of("bootclasspath", Depset.of(Artifact.class, bootclasspath)));
return PROVIDER.wrap(starlarkBootClassPathInfo);
} catch (EvalException e) {
throw new RuleErrorException(e);
}
}

private BootClassPathInfo(StructImpl underlying) {
super(underlying);
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/starlark/builtins_bzl/common/exports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ load(":common/cc/fdo/fdo_prefetch_hints.bzl", "fdo_prefetch_hints")
load(":common/cc/fdo/fdo_profile.bzl", "fdo_profile")
load(":common/cc/fdo/memprof_profile.bzl", "memprof_profile")
load(":common/cc/fdo/propeller_optimize.bzl", "propeller_optimize")
load(":common/java/java_binary_deploy_jar.bzl", get_java_build_info = "get_build_info")
load(":common/java/java_common.bzl", "java_common")
load(":common/java/java_info.bzl", "JavaInfo", "JavaPluginInfo")
load(":common/objc/apple_common.bzl", "apple_common")
Expand Down Expand Up @@ -104,7 +103,5 @@ exported_to_java = {
"j2objc_mapping_file_info_union": objc_common.j2objc_mapping_file_info_union,
"j2objc_entry_class_info_union": objc_common.j2objc_entry_class_info_union,
"init_cc_compilation_context": cc_compilation_helper.init_cc_compilation_context,
"java_common": java_common,
"get_build_info": get_java_build_info,
"get_toolchain_global_make_variables": cc_helper.get_toolchain_global_make_variables,
}

0 comments on commit 56882d5

Please sign in to comment.