diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 04:38:19 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 04:38:19 +0000 |
commit | 558cea6c0d8e342369c34dc9812a3deb0cd2b3bf (patch) | |
tree | 34d720e66745b8daf1632bb1fcd89fb9c0a40894 /toolchains/emulator/toolchain.bzl | |
parent | 7f7740c9ea674bf465c2afe0496065f7a6a0449e (diff) | |
parent | fe4d9ac26508ce8bf14d0bb56f97499664f561a4 (diff) | |
download | bazelbuild-rules_android-558cea6c0d8e342369c34dc9812a3deb0cd2b3bf.tar.gz |
Snap for 10453563 from fe4d9ac26508ce8bf14d0bb56f97499664f561a4 to mainline-adservices-releaseaml_ads_341720000aml_ads_341615050aml_ads_341517040aml_ads_341413000aml_ads_341316030aml_ads_341131050aml_ads_341027030aml_ads_340915050android14-mainline-adservices-release
Change-Id: I1c65346931ef3be1e4cb6034669d6214e10d8a2f
Diffstat (limited to 'toolchains/emulator/toolchain.bzl')
-rw-r--r-- | toolchains/emulator/toolchain.bzl | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/toolchains/emulator/toolchain.bzl b/toolchains/emulator/toolchain.bzl new file mode 100644 index 0000000..6bf2e0f --- /dev/null +++ b/toolchains/emulator/toolchain.bzl @@ -0,0 +1,59 @@ +# Copyright 2019 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. + +"""Defines the emulator_toolchain rule to allow configuring emulator binaries to use.""" + +EmulatorInfo = provider( + doc = "Information used to launch a specific version of the emulator.", + fields = { + "emulator": "A label for the emulator launcher executable at stable version.", + "emulator_deps": "Additional files required to launch the stable version of emulator.", + "emulator_suffix": "An optional path suffix used to find emulator binary under the emulator label path", + }, +) + +def _emulator_toolchain_impl(ctx): + toolchain_info = platform_common.ToolchainInfo( + info = EmulatorInfo( + emulator = ctx.attr.emulator, + emulator_deps = ctx.attr.emulator_deps, + emulator_suffix = ctx.attr.emulator_suffix, + ), + ) + return [toolchain_info] + +emulator_toolchain = rule( + implementation = _emulator_toolchain_impl, + attrs = { + "emulator": attr.label( + allow_files = True, + cfg = "exec", + mandatory = True, + ), + "emulator_deps": attr.label_list( + allow_files = True, + cfg = "exec", + ), + "emulator_head": attr.label( + allow_files = True, + cfg = "exec", + ), + "emulator_head_deps": attr.label_list( + allow_files = True, + cfg = "exec", + ), + "emulator_suffix": attr.string(default = ""), + "emulator_head_suffix": attr.string(default = ""), + }, +) |