Flutter Engine
The Flutter Engine
parse_manifest.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2#
3# Copyright 2013 The Flutter Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7""" Parses manifest file and dumps it to json.
8"""
9
10import argparse
11import json
12import os
13import sys
14import hashlib
15
16
17def main():
18 parser = argparse.ArgumentParser()
19
20 parser.add_argument('--input', dest='file_path', action='store', required=True)
21 parser.add_argument('--clang-cpu', dest='clang_cpu', action='store', required=True)
22
23 args = parser.parse_args()
24
25 with open(args.file_path) as f:
26 data = json.load(f)
27
28 output = {}
29 target = args.clang_cpu + '-fuchsia'
30
31 for d in data:
32 if target in d['target']:
33 for runtime in d['runtime']:
34 # key contains the soname and the cflags used to compile it.
35 # this allows us to distinguish between different sanitizers
36 # and experiments
37 key = runtime['soname'] + ''.join(d['cflags'])
38 md5 = hashlib.md5(key.encode()).hexdigest()
39 hash_key = 'md5_%s' % md5
40 # Uncomment this line to get the hash keys
41 # print runtime['dist'], d['cflags'], hash_key
42 output[hash_key] = os.path.dirname(runtime['dist'])
43
44 print(json.dumps(output))
45
46 return 0
47
48
49if __name__ == '__main__':
50 sys.exit(main())
Definition: main.py:1
def print(*args, **kwargs)
Definition: run_tests.py:49
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741