1# Copyright (C) 2022 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15PartitionToolchainInfo = provider( 16 doc = "Partitions toolchain", 17 fields = [ 18 "build_image", 19 "mkuserimg_mke2fs", 20 ], 21) 22 23def _partition_toolchain_impl(ctx): 24 toolchain_info = platform_common.ToolchainInfo( 25 toolchain_info = PartitionToolchainInfo( 26 build_image = ctx.file.build_image, 27 mkuserimg_mke2fs = ctx.file.mkuserimg_mke2fs, 28 ), 29 ) 30 return [toolchain_info] 31 32partition_toolchain = rule( 33 implementation = _partition_toolchain_impl, 34 attrs = { 35 "build_image": attr.label(allow_single_file = True, cfg = "exec", executable = True, mandatory = True), 36 "mkuserimg_mke2fs": attr.label(allow_single_file = True, cfg = "exec", executable = True, mandatory = True), 37 }, 38) 39