Skip to content

Commit

Permalink
inspector,build: stop redundant code-gen
Browse files Browse the repository at this point in the history
* document how to code-gen manually
  • Loading branch information
refack committed Sep 4, 2018
1 parent 4de9f99 commit 2d1469c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 45 deletions.
46 changes: 1 addition & 45 deletions src/inspector/inspector_protocol.gyp
Original file line number Diff line number Diff line change
@@ -1,58 +1,14 @@
{
'variables': {
'protocol_tool_path': '../../tools/inspector_protocol',
'node_inspector_generated_sources': [
'node_protocol/Forward.h',
'node_protocol/Protocol.cpp',
'node_protocol/Protocol.h',
'node_protocol/NodeTracing.cpp',
'node_protocol/NodeTracing.h',
],
},
'targets': [
{
'target_name': 'generate_concatenated_inspector_sources',
'type': 'none',
'actions': [
{
'action_name': 'convert_node_protocol_to_json',
'inputs': [
'node_protocol.pdl',
],
'outputs': [
'node_protocol.json',
],
'action': [
'python',
'<(protocol_tool_path)/ConvertProtocolToJSON.py',
'<@(_inputs)',
'<@(_outputs)',
],
},
{
'action_name': 'node_protocol_generated_sources',
'inputs': [
'node_protocol_config.json',
],
'outputs': [
'<@(node_inspector_generated_sources)',
],
'action': [
'python',
'<(protocol_tool_path)/CodeGenerator.py',
'--jinja_dir', '<@(protocol_tool_path)/..',
'--output_base', '.',
'--config', '<@(_inputs)',
],
'message': 'Generating node protocol sources from protocol json',
},
]
},
{
'target_name': 'generate_concatenated_inspector_protocol',
'type': 'none',
'inputs': [
'../../deps/v8/src/inspector/js_protocol.pdl',
'node_protocol.json',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/v8_inspector_protocol_json.h',
Expand Down
12 changes: 12 additions & 0 deletions src/inspector/node_protocol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This directory was initialy created by the `inspector_protocol` code-gen tool.
The protocol definition is in [../node_protocol.pdl]. It was converted to JSON
and stored in [../node_protocol.json] by running:
```console
python $(INSPECTOR_PROTOCOL_PATH)/ConvertProtocolToJSON.py ../node_protocol.pdl ../node_protocol.json
```

After making changes to the protocol definition, code need to be manuly
regenerated and checked in to git, by running:
```console
python $(INSPECTOR_PROTOCOL_PATH)/CodeGenerator.py --jinja_dir $(JINJA_PATH) --output_base .. --config ../node_protocol_config.json
```

0 comments on commit 2d1469c

Please sign in to comment.