blob: 6947f12d4673c951898d3e95ebb880273c01943e [file] [log] [blame]
Ole Troan5c318c72020-05-05 12:23:47 +02001# CRC generation
2import json
3
Paul Vinciguerra9046e442020-11-20 23:10:09 -05004process_imports = True
5
6
Ole Troan5c318c72020-05-05 12:23:47 +02007#
8# Plugin entry point
9#
10def run(args, input_filename, s):
11 j = {}
12 major = 0
13 if 'version' in s['Option']:
14 v = s['Option']['version']
15 (major, minor, patch) = v.split('.')
Ole Troan5c318c72020-05-05 12:23:47 +020016 for t in s['Define']:
17 j[t.name] = {'crc': f'{t.crc:#08x}', 'version': major,
18 'options': t.options}
19 return json.dumps(j, indent=4, separators=(',', ': '))