diff options
author | Wei Li <weiwli@google.com> | 2023-05-05 10:50:47 -0700 |
---|---|---|
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2023-05-19 00:35:29 +0000 |
commit | e51200d82f04a1e762fcb6a7437559bee22095ae (patch) | |
tree | ec7fc6abfc5947b2ce79db2749e714ac7c5af309 /rules/metadata.bzl | |
parent | 6c1b2ef1df8753463a3f99b382ffce0beaed0e8d (diff) | |
download | bazel-e51200d82f04a1e762fcb6a7437559bee22095ae.tar.gz |
Changes in Bazel rules to support SBOM generation of b build unbundled APEXs.
1) Add MetadataFileInfo provider to modules if METADATA file is declared in attribute applicable_licenses, which might be from default_metadata_file of packages
2) cc_aspect collect MetadataFileInfo for some rules that are transitive deps and included in APEXs
3) Generate SBOM for .apex or .capex in apex rule
Bug: 275472038
Test: CIs
Test: b build //packages/modules/adb/apex:com.android.adbd --config=android --output_groups=+apex_sbom
(cherry picked from https://android-review.googlesource.com/q/commit:8efceb357b097cf977cb06ad9dc4f5b3089f9d6a)
Merged-In: I727610608487a12873671dd27d56465fc2c19436
Change-Id: I727610608487a12873671dd27d56465fc2c19436
Diffstat (limited to 'rules/metadata.bzl')
-rw-r--r-- | rules/metadata.bzl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rules/metadata.bzl b/rules/metadata.bzl new file mode 100644 index 00000000..287905cd --- /dev/null +++ b/rules/metadata.bzl @@ -0,0 +1,19 @@ +# Copyright (C) 2023 The Android Open Source Project +# +# 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. + +MetadataFileInfo = provider( + fields = { + "metadata_file": "METADATA file of a module", + }, +) |