build: remove the tools folder (#24880)

This commit is contained in:
Samuel Attard 2020-08-07 14:13:09 -07:00 committed by GitHub
parent b0ea1e14e1
commit 433956ce4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 19 deletions

39
build/js2c.py Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/env python
import os
import subprocess
import sys
TEMPLATE = """
#include "node_native_module.h"
#include "node_internals.h"
namespace node {{
namespace native_module {{
{definitions}
void NativeModuleLoader::LoadEmbedderJavaScriptSource() {{
{initializers}
}}
}} // namespace native_module
}} // namespace node
"""
def main():
node_path = os.path.abspath(sys.argv[1])
natives = os.path.abspath(sys.argv[2])
js_source_files = sys.argv[3:]
js2c = os.path.join(node_path, 'tools', 'js2c.py')
subprocess.check_call(
[sys.executable, js2c] +
js_source_files +
['--only-js', '--target', natives])
if __name__ == '__main__':
sys.exit(main())