1# Copyright 2015 gRPC authors. 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"""Buildgen expand binary attributes plugin. 15 16This fills in any optional attributes. 17 18""" 19 20 21def mako_plugin(dictionary): 22 """The exported plugin code for expand_filegroups. 23 24 The list of libs in the build.yaml file can contain "filegroups" tags. 25 These refer to the filegroups in the root object. We will expand and 26 merge filegroups on the src, headers and public_headers properties. 27 28 """ 29 30 targets = dictionary.get('targets') 31 default_platforms = ['windows', 'posix', 'linux', 'mac'] 32 33 for tgt in targets: 34 tgt['flaky'] = tgt.get('flaky', False) 35 tgt['platforms'] = sorted(tgt.get('platforms', default_platforms)) 36 tgt['ci_platforms'] = sorted(tgt.get('ci_platforms', tgt['platforms'])) 37 tgt['boringssl'] = tgt.get('boringssl', False) 38 tgt['zlib'] = tgt.get('zlib', False) 39 tgt['ares'] = tgt.get('ares', False) 40 tgt['gtest'] = tgt.get('gtest', False) 41 42 libs = dictionary.get('libs') 43 for lib in libs: 44 lib['boringssl'] = lib.get('boringssl', False) 45 lib['zlib'] = lib.get('zlib', False) 46 lib['ares'] = lib.get('ares', False) 47