diff options
author | Craig Tiller <ctiller@google.com> | 2016-03-31 13:11:05 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-03-31 13:11:05 -0700 |
commit | c532c21ee52bdcddf7292560673a61538ea3d29f (patch) | |
tree | 2ed1a4e7c77546e5c2d42d7fdf8a02c947e2970c /tools/buildgen/plugins/expand_filegroups.py | |
parent | 3b27de1fc4486d1f62d9c557611ef507143bf120 (diff) | |
parent | 02f5f8de36924b9fe55ccda800fa465b94bd181d (diff) |
Merge github.com:grpc/grpc into split-me-baby-one-more-time
Diffstat (limited to 'tools/buildgen/plugins/expand_filegroups.py')
-rwxr-xr-x | tools/buildgen/plugins/expand_filegroups.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/tools/buildgen/plugins/expand_filegroups.py b/tools/buildgen/plugins/expand_filegroups.py index c40143ef95..14cb616027 100755 --- a/tools/buildgen/plugins/expand_filegroups.py +++ b/tools/buildgen/plugins/expand_filegroups.py @@ -1,4 +1,4 @@ -# Copyright 2015-2016, Google Inc. +# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -75,11 +75,20 @@ def mako_plugin(dictionary): todo.append(cur) else: skips = 0 + assert 'plugins' not in cur + plugins = [] for uses in cur.get('uses', []): + for plugin in filegroups[uses]['plugins']: + if plugin not in plugins: + plugins.append(plugin) for lst in FILEGROUP_LISTS: vals = cur.get(lst, []) vals.extend(filegroups[uses].get(lst, [])) cur[lst] = vals + cur_plugin_name = cur.get('plugin') + if cur_plugin_name: + plugins.append(cur_plugin_name) + cur['plugins'] = plugins filegroups[cur['name']] = cur # the above expansion can introduce duplicate filenames: contract them here @@ -88,13 +97,20 @@ def mako_plugin(dictionary): fg[lst] = sorted(list(set(fg.get(lst, [])))) for lib in libs: + assert 'plugins' not in lib + plugins = [] for fg_name in lib.get('filegroups', []): fg = filegroups[fg_name] - + for plugin in fg['plugins']: + if plugin not in plugins: + plugins.append(plugin) for lst in FILEGROUP_LISTS: vals = lib.get(lst, []) vals.extend(fg.get(lst, [])) lib[lst] = vals - + lib['plugins'] = plugins + if lib.get('generate_plugin_registry', False): + lib['src'].append('src/core/plugin_registry/%s_plugin_registry.c' % + lib['name']) for lst in FILEGROUP_LISTS: lib[lst] = sorted(list(set(lib.get(lst, [])))) |