Skip to content

Commit

Permalink
Add load() statements for the Bazel builtin top-level java symbols
Browse files Browse the repository at this point in the history
Loads are being added in preparation for moving the symbols out of Bazel and into `rules_java`.

PiperOrigin-RevId: 624181985
Change-Id: I503f2dce02bef4e8031ef69368614d91cdd1b623
  • Loading branch information
A Googler authored and copybara-github committed Apr 12, 2024
1 parent 39aa253 commit ac2386d
Show file tree
Hide file tree
Showing 39 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module(

bazel_dep(name = "platforms", version = "0.0.5")
bazel_dep(name = "rules_license", version = "0.0.4")
bazel_dep(name = "rules_java", version = "7.4.0")
bazel_dep(name = "rules_java", version = "7.5.0")
bazel_dep(name = "stardoc", version = "0.6.2")

rules_java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains")
Expand Down
2 changes: 2 additions & 0 deletions mobile_install/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ bzl_library(
"//mobile_install/adapters:bzl",
"//rules:bzl",
"//rules:min_sdk_version_bzl",
"@rules_java//java/common",
],
)

Expand Down Expand Up @@ -88,5 +89,6 @@ bzl_library(
":constants",
"//rules:min_sdk_version_bzl",
"//rules/flags:bzl",
"@rules_java//java/common",
],
)
1 change: 1 addition & 0 deletions mobile_install/adapters/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ bzl_library(
"//mobile_install:resources",
"//mobile_install:transform",
"//mobile_install:utils",
"@rules_java//java/common",
],
)

Expand Down
1 change: 1 addition & 0 deletions mobile_install/adapters/aar_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ load(
load("//mobile_install:resources.bzl", "liteparse")
load("//mobile_install:transform.bzl", "dex")
load("//rules:java.bzl", _java = "java")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":base.bzl", "make_adapter")

def _aspect_attrs():
Expand Down
1 change: 1 addition & 0 deletions mobile_install/adapters/android_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ load(
load("//mobile_install:transform.bzl", "dex", "filter_jars")
load("//mobile_install:utils.bzl", "utils")
load("//rules/flags:flags.bzl", "flags")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":base.bzl", "make_adapter")

def _aspect_attrs():
Expand Down
1 change: 1 addition & 0 deletions mobile_install/adapters/android_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ load(
)
load("//mobile_install:resources.bzl", "get_assets_dir")
load("//mobile_install:transform.bzl", "dex", "filter_jars")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":base.bzl", "make_adapter")

def _aspect_attrs():
Expand Down
1 change: 1 addition & 0 deletions mobile_install/adapters/java_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ load(
)
load("//mobile_install:transform.bzl", "dex", "extract_jar_resources")
load("//mobile_install:utils.bzl", "utils")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":base.bzl", "make_adapter")

def _aspect_attrs():
Expand Down
1 change: 1 addition & 0 deletions mobile_install/adapters/java_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ load(
"providers",
)
load("//mobile_install:transform.bzl", "dex", "extract_jar_resources")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":base.bzl", "make_adapter")

def _aspect_attrs():
Expand Down
1 change: 1 addition & 0 deletions mobile_install/adapters/java_lite_grpc_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

load("//mobile_install:providers.bzl", "MIAndroidDexInfo", "MIJavaResourcesInfo", "providers")
load("//mobile_install:transform.bzl", "dex", "extract_jar_resources")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":base.bzl", "make_adapter")

def _aspect_attrs():
Expand Down
1 change: 1 addition & 0 deletions mobile_install/adapters/proto_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

load("//mobile_install:providers.bzl", "MIAndroidDexInfo", "providers")
load("//mobile_install:transform.bzl", "dex")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":base.bzl", "make_adapter")

def _aspect_attrs():
Expand Down
1 change: 1 addition & 0 deletions mobile_install/mi.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
load("//rules:min_sdk_version.bzl", "min_sdk_version")
load("//rules:utils.bzl", "ANDROID_SDK_TOOLCHAIN_TYPE")
load("//rules/flags:flags.bzl", "flags")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":adapters.bzl", "adapters")
load(":debug.bzl", "debug")
load(":tools.bzl", "TOOL_ATTRS")
Expand Down
1 change: 1 addition & 0 deletions mobile_install/r_java.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
"""Methods to create and process R.java."""

load("@rules_java//java/common:java_common.bzl", "java_common")
load(":utils.bzl", "utils")

def _make_r_java(ctx, resource_src_jar, main_r_java, out_r_java):
Expand Down
1 change: 1 addition & 0 deletions mobile_install/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

load("//rules:min_sdk_version.bzl", _min_sdk_version = "min_sdk_version")
load("//rules/flags:flags.bzl", "flags")
load("@rules_java//java/common:java_common.bzl", "java_common")
load(":constants.bzl", "constants")

_PACKAGE_NAME_EXTRACTION_SCRIPT = """
Expand Down
4 changes: 2 additions & 2 deletions prereqs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def rules_android_prereqs(dev_mode = False):
http_archive,
name = "rules_java",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/7.4.0/rules_java-7.4.0.tar.gz",
"https://github.com/bazelbuild/rules_java/releases/download/7.5.0/rules_java-7.5.0.tar.gz",
],
sha256 = "976ef08b49c929741f201790e59e3807c72ad81f428c8bc953cdbeff5fed15eb",
sha256 = "4da3761f6855ad916568e2bfe86213ba6d2637f56b8360538a7fb6125abf6518",
)

maybe(
Expand Down
1 change: 1 addition & 0 deletions rules/aar_import/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ load(
"//rules:attrs.bzl",
_attrs = "attrs",
)
load("@rules_java//java/common:java_info.bzl", "JavaInfo")

ATTRS = _attrs.add(
dict(
Expand Down
2 changes: 2 additions & 0 deletions rules/aar_import/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ load(
_get_android_toolchain = "get_android_toolchain",
_utils = "utils",
)
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")

RULE_PREFIX = "_aar"
ANDROID_MANIFEST = "AndroidManifest.xml"
Expand Down
1 change: 1 addition & 0 deletions rules/aar_import/rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ load(
"//rules:utils.bzl",
"ANDROID_SDK_TOOLCHAIN_TYPE",
)
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":attrs.bzl", _ATTRS = "ATTRS")
load(":impl.bzl", _impl = "impl")

Expand Down
1 change: 1 addition & 0 deletions rules/android_application/android_application_rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ load(
"AndroidArchivedSandboxedSdkInfo",
"AndroidSandboxedSdkBundleInfo",
)
load("@rules_java//java/common:java_common.bzl", "java_common")
load(":android_feature_module_rule.bzl", "get_feature_module_paths")
load(":attrs.bzl", "ANDROID_APPLICATION_ATTRS")

Expand Down
1 change: 1 addition & 0 deletions rules/android_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ load(
"android_binary_internal_macro",
"sanitize_attrs",
)
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":common.bzl", "common")
load(":migration_tag_DONOTUSE.bzl", "add_migration_tag")
load(":proguard.bzl", "proguard")
Expand Down
1 change: 1 addition & 0 deletions rules/android_binary_internal/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ load(
"split_config_aspect",
)
load("//rules:providers.bzl", "StarlarkApkInfo")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")

def make_deps(allow_rules, providers, aspects):
return attr.label_list(
Expand Down
3 changes: 3 additions & 0 deletions rules/android_binary_internal/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ load(
"get_android_toolchain",
"utils",
)
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("@rules_java//java/common:java_plugin_info.bzl", "JavaPluginInfo")
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load(":r8.bzl", "process_r8", "process_resource_shrinking_r8")

Expand Down
2 changes: 2 additions & 0 deletions rules/android_library/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ load(
_attrs = "attrs",
)
load("//rules:providers.bzl", "StarlarkApkInfo")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("@rules_java//java/common:java_plugin_info.bzl", "JavaPluginInfo")

ATTRS = _attrs.add(
dict(
Expand Down
2 changes: 2 additions & 0 deletions rules/android_library/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ load("//rules:providers.bzl", "AndroidLintRulesInfo", "StarlarkApkInfo")
load("//rules:resources.bzl", _resources = "resources")
load("//rules:utils.bzl", "get_android_sdk", "get_android_toolchain", "log", "utils")
load("//rules/flags:flags.bzl", _flags = "flags")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("@rules_java//java/common:java_plugin_info.bzl", "JavaPluginInfo")

_USES_DEPRECATED_IMPLICIT_EXPORT_ERROR = (
"Setting `deps` without `srcs` or `resource_files` is not supported. Consider using " +
Expand Down
1 change: 1 addition & 0 deletions rules/android_library/rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ load(
"//rules:attrs.bzl",
_attrs = "attrs",
)
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":attrs.bzl", _ATTRS = "ATTRS")
load(":impl.bzl", _impl = "impl")

Expand Down
1 change: 1 addition & 0 deletions rules/android_local_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bzl_library(
deps = [
"//rules:common_bzl",
"//rules/flags:bzl",
"@rules_java//java/common",
"@bazel_skylib//rules:common_settings",
],
)
2 changes: 2 additions & 0 deletions rules/android_local_test/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ load(
"//rules:attrs.bzl",
_attrs = "attrs",
)
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")

def make_attrs(additional_aspects = [], native_libs_transition = None):
return _attrs.add(
Expand Down
3 changes: 3 additions & 0 deletions rules/android_local_test/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ load(
"log",
"utils",
)
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("@rules_java//java/common:java_plugin_info.bzl", "JavaPluginInfo")
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")

JACOCOCO_CLASS = "com.google.testing.coverage.JacocoCoverageRunner"
Expand Down
1 change: 1 addition & 0 deletions rules/android_neverlink_aspect.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ load(
"//rules:utils.bzl",
"utils",
)
load("@rules_java//java/common:java_info.bzl", "JavaInfo")

StarlarkAndroidNeverlinkInfo = provider(
doc = "Contains all neverlink libraries in the transitive closure.",
Expand Down
1 change: 1 addition & 0 deletions rules/android_sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""Bazel rule for Android sdk."""

load("@rules_java//java/common:java_common.bzl", "java_common")
load(":attrs.bzl", "ANDROID_SDK_ATTRS")

def _impl(ctx):
Expand Down
1 change: 1 addition & 0 deletions rules/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Common attributes for Android rules."""

load("//rules:android_split_transition.bzl", "android_transition")
load("@rules_java//java/common:java_plugin_info.bzl", "JavaPluginInfo")
load(":native_toolchain_attrs.bzl", "ANDROID_SDK_TOOLCHAIN_TYPE_DEFAULT")
load(":utils.bzl", "log")

Expand Down
1 change: 1 addition & 0 deletions rules/bundletool.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ load(
"//rules:utils.bzl",
"ANDROID_TOOLCHAIN_TYPE",
)
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@bazel_skylib//lib:paths.bzl", "paths")
load(":common.bzl", _common = "common")
load(":java.bzl", _java = "java")
Expand Down
2 changes: 2 additions & 0 deletions rules/common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"""Bazel common library for the Android rules."""

load("//rules/android_common:reexport_android_common.bzl", _native_android_common = "native_android_common")
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":utils.bzl", "ANDROID_TOOLCHAIN_TYPE", "get_android_toolchain", _log = "log")

# Suffix attached to the Starlark portion of android_binary target
Expand Down
1 change: 1 addition & 0 deletions rules/dex_desugar_aspect.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""Aspect that transitively build .dex archives and desugar jars."""

load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load(":attrs.bzl", _attrs = "attrs")
load(":desugar.bzl", _desugar = "desugar")
load(":dex.bzl", _dex = "dex")
Expand Down
1 change: 1 addition & 0 deletions rules/java.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""Bazel Java APIs for the Android rules."""

load("@rules_java//java/common:java_common.bzl", "java_common")
load(":path.bzl", _path = "path")
load(":utils.bzl", "log")

Expand Down
1 change: 1 addition & 0 deletions rules/native_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ of split deps
"""

load("//rules:common.bzl", "common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("@bazel_skylib//lib:paths.bzl", "paths")

SplitConfigInfo = provider(
Expand Down
2 changes: 2 additions & 0 deletions rules/resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

load("//rules:acls.bzl", "acls")
load("//rules:min_sdk_version.bzl", _min_sdk_version = "min_sdk_version")
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load(":attrs.bzl", _attrs = "attrs")
load(":busybox.bzl", _busybox = "busybox")
Expand Down
3 changes: 3 additions & 0 deletions test/rules/android_local_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ bzl_library(
name = "bzl",
srcs = glob(["*.bzl"]),
visibility = ["//visibility:private"],
deps = [
"@rules_java//java/common",
],
)

android_local_test(
Expand Down
1 change: 1 addition & 0 deletions test/rules/android_local_test/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rule_test: Inspect and assert on rule providers.

load("//rules:providers.bzl", "AndroidFilteredJdepsInfo")
load("//test/utils:asserts.bzl", "asserts")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")

VALIDATION = "_validation"

Expand Down
1 change: 1 addition & 0 deletions test/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ bzl_library(
],
deps = [
"@rules_java//java:core_rules",
"@bazel_skylib//lib:unittest",
],
)

0 comments on commit ac2386d

Please sign in to comment.