MCPcopy Index your code
hub / github.com/nodejs/node / main

Function main

tools/generate_config_gypi.py:88–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86 return config_gypi
87
88def main():
89 parser = argparse.ArgumentParser(
90 description='Generate config.gypi file from GN configurations')
91 parser.add_argument('target', help='path to generated config.gypi file')
92 parser.add_argument('--out-dir', help='path to the output directory',
93 default='out/Release')
94 parser.add_argument('--node-gn-path', help='path of the node target in GN',
95 default='//node')
96 parser.add_argument('--dep-file', help='path to an optional dep file',
97 default=None)
98 args, _unknown_args = parser.parse_known_args()
99
100 config = get_gn_config(args.out_dir)
101 v8_config = get_v8_config(args.out_dir, args.node_gn_path)
102
103 # Write output.
104 with open(args.target, 'w') as f:
105 f.write(json.dumps(translate_config(args.out_dir, config, v8_config),
106 sort_keys=True))
107
108 # Write depfile. Force regenerating config.gypi when GN configs change.
109 if args.dep_file:
110 with open(args.dep_file, 'w') as f:
111 f.write('%s: %s '%(args.target, 'build.ninja'))
112
113if __name__ == '__main__':
114 main()

Callers 1

Calls 6

get_gn_configFunction · 0.85
get_v8_configFunction · 0.85
translate_configFunction · 0.85
openFunction · 0.50
add_argumentMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…