diff --git a/rules/android_application/android_application_rule.bzl b/rules/android_application/android_application_rule.bzl index 7980f11c3..c6d992340 100644 --- a/rules/android_application/android_application_rule.bzl +++ b/rules/android_application/android_application_rule.bzl @@ -37,10 +37,12 @@ load( ) load( "//rules:providers.bzl", + "AndroidArchivedSandboxedSdkInfo", "AndroidBundleInfo", "AndroidFeatureModuleInfo", "AndroidIdeInfo", "AndroidPreDexJarInfo", + "AndroidSandboxedSdkBundleInfo", "ApkInfo", "ProguardMappingInfo", "StarlarkAndroidResourcesInfo", @@ -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") diff --git a/rules/android_application/attrs.bzl b/rules/android_application/attrs.bzl index 8596473b9..29ceaf16d 100644 --- a/rules/android_application/attrs.bzl +++ b/rules/android_application/attrs.bzl @@ -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) diff --git a/rules/android_sandboxed_sdk/android_binary_with_sandboxed_sdks_macro.bzl b/rules/android_sandboxed_sdk/android_binary_with_sandboxed_sdks_macro.bzl index 83003f08f..389436491 100644 --- a/rules/android_sandboxed_sdk/android_binary_with_sandboxed_sdks_macro.bzl +++ b/rules/android_sandboxed_sdk/android_binary_with_sandboxed_sdks_macro.bzl @@ -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", @@ -32,7 +32,6 @@ load( _utils = "utils", ) load("//rules:visibility.bzl", "PROJECT_VISIBILITY") -load(":providers.bzl", "AndroidArchivedSandboxedSdkInfo", "AndroidSandboxedSdkApkInfo", "AndroidSandboxedSdkBundleInfo") visibility(PROJECT_VISIBILITY) diff --git a/rules/android_sandboxed_sdk/android_sandboxed_sdk_bundle.bzl b/rules/android_sandboxed_sdk/android_sandboxed_sdk_bundle.bzl index eac371da9..3c47039b1 100644 --- a/rules/android_sandboxed_sdk/android_sandboxed_sdk_bundle.bzl +++ b/rules/android_sandboxed_sdk/android_sandboxed_sdk_bundle.bzl @@ -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) diff --git a/rules/android_sandboxed_sdk/android_sandboxed_sdk_macro.bzl b/rules/android_sandboxed_sdk/android_sandboxed_sdk_macro.bzl index 202a6e84c..3e171f9b1 100644 --- a/rules/android_sandboxed_sdk/android_sandboxed_sdk_macro.bzl +++ b/rules/android_sandboxed_sdk/android_sandboxed_sdk_macro.bzl @@ -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", @@ -28,7 +28,6 @@ load( _get_android_toolchain = "get_android_toolchain", ) load("//rules:visibility.bzl", "PROJECT_VISIBILITY") -load(":providers.bzl", "AndroidSandboxedSdkInfo") visibility(PROJECT_VISIBILITY) diff --git a/rules/android_sandboxed_sdk/asar_import.bzl b/rules/android_sandboxed_sdk/asar_import.bzl index 657c562e8..bed9e6cf6 100644 --- a/rules/android_sandboxed_sdk/asar_import.bzl +++ b/rules/android_sandboxed_sdk/asar_import.bzl @@ -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", @@ -30,7 +31,6 @@ load( _get_android_toolchain = "get_android_toolchain", ) load("//rules:visibility.bzl", "PROJECT_VISIBILITY") -load(":providers.bzl", "AndroidArchivedSandboxedSdkInfo") visibility(PROJECT_VISIBILITY) diff --git a/rules/android_sandboxed_sdk/providers.bzl b/rules/android_sandboxed_sdk/providers.bzl deleted file mode 100644 index 0fa27cd88..000000000 --- a/rules/android_sandboxed_sdk/providers.bzl +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2023 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Providers for Android Sandboxed SDK rules.""" - -load("//rules:visibility.bzl", "PROJECT_VISIBILITY") - -visibility(PROJECT_VISIBILITY) -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.", - ), -) diff --git a/rules/providers.bzl b/rules/providers.bzl index 60278082a..f2b0a5549 100644 --- a/rules/providers.bzl +++ b/rules/providers.bzl @@ -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