Skip to content

Commit

Permalink
Merge sdk providers into top-level providers.bzl
Browse files Browse the repository at this point in the history
This doesn't need to be a separate file.

PiperOrigin-RevId: 671423974
Change-Id: Ic71f07f9bf1e2ae28f542f3ba213b4669688edee
  • Loading branch information
timpeut authored and copybara-github committed Sep 5, 2024
1 parent f7b3251 commit c12e3a1
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 74 deletions.
7 changes: 2 additions & 5 deletions rules/android_application/android_application_rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ load(
)
load(
"//rules:providers.bzl",
"AndroidArchivedSandboxedSdkInfo",
"AndroidBundleInfo",
"AndroidFeatureModuleInfo",
"AndroidIdeInfo",
"AndroidPreDexJarInfo",
"AndroidSandboxedSdkBundleInfo",
"ApkInfo",
"ProguardMappingInfo",
"StarlarkAndroidResourcesInfo",
Expand All @@ -57,11 +59,6 @@ load(
_log = "log",
)
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")
load(
"//rules/android_sandboxed_sdk:providers.bzl",
"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
4 changes: 2 additions & 2 deletions rules/android_application/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ load(
"//rules:attrs.bzl",
_attrs = "attrs",
)
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")
load(
"//rules/android_sandboxed_sdk:providers.bzl",
"//rules:providers.bzl",
"AndroidArchivedSandboxedSdkInfo",
"AndroidSandboxedSdkBundleInfo",
)
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")

visibility(PROJECT_VISIBILITY)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ load("//rules:acls.bzl", "acls")
load("//rules:bundletool.bzl", _bundletool = "bundletool")
load("//rules:common.bzl", _common = "common")
load("//rules:java.bzl", _java = "java")
load("//rules:providers.bzl", "ApkInfo")
load("//rules:providers.bzl", "AndroidArchivedSandboxedSdkInfo", "AndroidSandboxedSdkApkInfo", "AndroidSandboxedSdkBundleInfo", "ApkInfo")
load(
"//rules:sandboxed_sdk_toolbox.bzl",
_sandboxed_sdk_toolbox = "sandboxed_sdk_toolbox",
Expand All @@ -32,7 +32,6 @@ load(
_utils = "utils",
)
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")
load(":providers.bzl", "AndroidArchivedSandboxedSdkInfo", "AndroidSandboxedSdkApkInfo", "AndroidSandboxedSdkBundleInfo")

visibility(PROJECT_VISIBILITY)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ load(
"//rules:common.bzl",
_common = "common",
)
load("//rules:providers.bzl", "AndroidSandboxedSdkBundleInfo", "AndroidSandboxedSdkInfo")
load(
"//rules:utils.bzl",
_get_android_toolchain = "get_android_toolchain",
)
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")
load(":providers.bzl", "AndroidSandboxedSdkBundleInfo", "AndroidSandboxedSdkInfo")

visibility(PROJECT_VISIBILITY)

Expand Down
3 changes: 1 addition & 2 deletions rules/android_sandboxed_sdk/android_sandboxed_sdk_macro.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ load(
_common = "common",
)
load("//rules:java.bzl", _java = "java")
load("//rules:providers.bzl", "ApkInfo")
load("//rules:providers.bzl", "AndroidSandboxedSdkInfo", "ApkInfo")
load(
"//rules:sandboxed_sdk_toolbox.bzl",
_sandboxed_sdk_toolbox = "sandboxed_sdk_toolbox",
Expand All @@ -28,7 +28,6 @@ load(
_get_android_toolchain = "get_android_toolchain",
)
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")
load(":providers.bzl", "AndroidSandboxedSdkInfo")

visibility(PROJECT_VISIBILITY)

Expand Down
2 changes: 1 addition & 1 deletion rules/android_sandboxed_sdk/asar_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ load(
"//rules:common.bzl",
_common = "common",
)
load("//rules:providers.bzl", "AndroidArchivedSandboxedSdkInfo")
load(
"//rules:sandboxed_sdk_toolbox.bzl",
_sandboxed_sdk_toolbox = "sandboxed_sdk_toolbox",
Expand All @@ -30,7 +31,6 @@ load(
_get_android_toolchain = "get_android_toolchain",
)
load("//rules:visibility.bzl", "PROJECT_VISIBILITY")
load(":providers.bzl", "AndroidArchivedSandboxedSdkInfo")

visibility(PROJECT_VISIBILITY)

Expand Down
61 changes: 0 additions & 61 deletions rules/android_sandboxed_sdk/providers.bzl

This file was deleted.

44 changes: 44 additions & 0 deletions rules/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,50 @@ DataBindingV2Info = provider(
),
)

AndroidSandboxedSdkInfo = provider(
doc = "Provides information about a sandboxed Android SDK.",
fields = dict(
internal_apk_info = "ApkInfo for SDKs dexes and resources. Note: it cannot " +
"be installed on a device as is. It needs to be further processed by " +
"other sandboxed SDK rules.",
sdk_module_config = "The SDK Module config. For the full definition see " +
"https://github.com/google/bundletool/blob/master/src/main/proto/sdk_modules_config.proto",
sdk_api_descriptors = "Jar file with the SDK API Descriptors. This can later be used to " +
"generate sources for communicating with this SDK from the app " +
"process.",
),
)

AndroidArchivedSandboxedSdkInfo = provider(
doc = "Provides information about an Android Sandboxed SDK archive.",
fields = dict(
asar = "Android Sandboxed SDK archive file, as generated by Bundletool.",
sdk_api_descriptors = "Jar file with the SDK API Descriptors. This can later be used to " +
"generate sources for communicating with this SDK from the app " +
"process.",
),
)

AndroidSandboxedSdkBundleInfo = provider(
doc = "Provides information about a sandboxed Android SDK Bundle (ASB).",
fields = dict(
sdk_info = "AndroidSandboxedSdkInfo with information about the SDK.",
asb = "Path to the final ASB, unsigned.",
),
)

AndroidSandboxedSdkApkInfo = provider(
doc = "Provides information about App and Sandboxed SDK APKs.",
fields = dict(
app_apk_info = "ApkInfo for the host app.",
sandboxed_sdk_apks = "List of APKs for sandboxed SDK dependencies of the host app. " +
"Only present when compat splits are not requested. APKs are signed " +
"with debug keys.",
sandboxed_sdk_splits = "List of APK splits that contain the sandboxed SDK dependencies " +
"of the host app. Only present when compat splits are requested.",
),
)

# Native defined providers which will be gradually migrated to Starlark.
# We re-export these here so that all our providers can be loaded from this file.
AndroidResourcesInfo = providers.AndroidResourcesInfo
Expand Down

0 comments on commit c12e3a1

Please sign in to comment.