Skip to content

Commit

Permalink
build,src,inspector: break includes cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
refack committed Oct 30, 2018
1 parent 3521f8a commit 2f4f8e7
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 53 deletions.
83 changes: 41 additions & 42 deletions src/inspector/node_inspector.gypi
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
'variables': {
'protocol_tool_path': '../../tools/inspector_protocol',
'node_inspector_path': '../../src/inspector',
'node_inspector_path': './',
'node_inspector_generated_path': '<(SHARED_INTERMEDIATE_DIR)/node_inspector',
'node_inspector_generated_sources': [
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/Forward.h',
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/Protocol.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/Protocol.h',
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/NodeWorker.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/NodeWorker.h',
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/NodeTracing.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/NodeTracing.h',
'<(node_inspector_generated_path)/protocol/Forward.h',
'<(node_inspector_generated_path)/protocol/Protocol.cpp',
'<(node_inspector_generated_path)/protocol/Protocol.h',
'<(node_inspector_generated_path)/protocol/NodeWorker.cpp',
'<(node_inspector_generated_path)/protocol/NodeWorker.h',
'<(node_inspector_generated_path)/protocol/NodeTracing.cpp',
'<(node_inspector_generated_path)/protocol/NodeTracing.h',
],
'node_protocol_files': [
'<(protocol_tool_path)/lib/Allocator_h.template',
Expand Down Expand Up @@ -41,48 +42,46 @@
'HAVE_INSPECTOR=1',
],
'sources': [
'../../src/inspector_agent.cc',
'../../src/inspector_io.cc',
'../../src/inspector_agent.h',
'../../src/inspector_io.h',
'../../src/inspector_js_api.cc',
'../../src/inspector_socket.cc',
'../../src/inspector_socket.h',
'../../src/inspector_socket_server.cc',
'../../src/inspector_socket_server.h',
'../../src/inspector/main_thread_interface.cc',
'../../src/inspector/main_thread_interface.h',
'../../src/inspector/node_string.cc',
'../../src/inspector/node_string.h',
'../../src/inspector/tracing_agent.cc',
'../../src/inspector/tracing_agent.h',
'../../src/inspector/worker_agent.cc',
'../../src/inspector/worker_agent.h',
'../../src/inspector/worker_inspector.cc',
'../../src/inspector/worker_inspector.h',
'../inspector_agent.cc',
'../inspector_io.cc',
'../inspector_agent.h',
'../inspector_io.h',
'../inspector_js_api.cc',
'../inspector_socket.cc',
'../inspector_socket.h',
'../inspector_socket_server.cc',
'../inspector_socket_server.h',
'main_thread_interface.cc',
'main_thread_interface.h',
'node_string.cc',
'node_string.h',
'tracing_agent.cc',
'tracing_agent.h',
'worker_agent.cc',
'worker_agent.h',
'worker_inspector.cc',
'worker_inspector.h',
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/include', # for inspector
'<(SHARED_INTERMEDIATE_DIR)',
'<(SHARED_INTERMEDIATE_DIR)/src', # for inspector
'<(node_inspector_generated_path)',
],
'copies': [
{
'files': [
'<(node_inspector_path)/node_protocol_config.json',
'<(node_inspector_path)/node_protocol.pdl'
'<(node_inspector_path)/node_protocol.pdl',
],
'destination': '<(SHARED_INTERMEDIATE_DIR)',
'destination': '<(node_inspector_generated_path)',
}
],
'actions': [
{
'action_name': 'convert_node_protocol_to_json',
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.pdl',
'<(node_inspector_generated_path)/node_protocol.pdl',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.json',
'<(node_inspector_generated_path)/node_protocol.json',
],
'action': [
'python',
Expand All @@ -95,8 +94,8 @@
'action_name': 'node_protocol_generated_sources',
'process_outputs_as_sources': 0,
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/node_protocol_config.json',
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.json',
'<(node_inspector_generated_path)/node_protocol_config.json',
'<(node_inspector_generated_path)/node_protocol.json',
'<@(node_protocol_files)',
],
'outputs': [
Expand All @@ -107,19 +106,19 @@
'python',
'tools/inspector_protocol/CodeGenerator.py',
'--jinja_dir', '<@(protocol_tool_path)/..',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/',
'--config', '<(SHARED_INTERMEDIATE_DIR)/node_protocol_config.json',
'--output_base', '<(node_inspector_generated_path)',
'--config', '<(node_inspector_generated_path)/node_protocol_config.json',
],
'message': 'Generating node protocol sources from protocol json',
},
{
'action_name': 'concatenate_protocols',
'inputs': [
'../../deps/v8/src/inspector/js_protocol.json',
'<(SHARED_INTERMEDIATE_DIR)/node_protocol.json',
'<(node_inspector_generated_path)/node_protocol.json',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/concatenated_protocol.json',
'<(node_inspector_generated_path)/concatenated_protocol.json',
],
'action': [
'python',
Expand All @@ -132,10 +131,10 @@
'action_name': 'v8_inspector_compress_protocol_json',
'process_outputs_as_sources': 0,
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/concatenated_protocol.json',
'<(node_inspector_generated_path)/concatenated_protocol.json',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/v8_inspector_protocol_json.h',
'<(node_inspector_generated_path)/concatenated_protocol/v8_inspector_protocol_json.h',
],
'process_outputs_as_sources': 1,
'action': [
Expand Down
12 changes: 6 additions & 6 deletions src/inspector/node_protocol_config.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"protocol": {
"path": "node_protocol.json",
"package": "src/node/inspector/protocol",
"output": "node/inspector/protocol",
"package": "protocol",
"output": "protocol",
"namespace": ["node", "inspector", "protocol"]
},
"exported": {
"package": "include/inspector",
"output": "../../include/inspector",
"package": "include",
"output": "include",
"string_header": "v8-inspector.h",
"string_in": "StringView",
"string_out": "std::unique_ptr<StringBuffer>",
"to_string_out": "StringBufferImpl::adopt(%s)",
"export_macro": "V8_EXPORT"
},
"lib": {
"package": "src/node/inspector/protocol",
"output": "node/inspector/protocol",
"package": "protocol",
"output": "protocol",
"string_header": "inspector/node_string.h"
}
}
2 changes: 1 addition & 1 deletion src/inspector/node_string.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "node_string.h"
#include "node/inspector/protocol/Protocol.h"
#include "protocol/Protocol.h"

#include <unicode/unistr.h>

Expand Down
2 changes: 1 addition & 1 deletion src/inspector/tracing_agent.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SRC_INSPECTOR_TRACING_AGENT_H_
#define SRC_INSPECTOR_TRACING_AGENT_H_

#include "node/inspector/protocol/NodeTracing.h"
#include "protocol/NodeTracing.h"
#include "tracing/agent.h"
#include "v8.h"

Expand Down
2 changes: 1 addition & 1 deletion src/inspector/worker_agent.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SRC_INSPECTOR_WORKER_AGENT_H_
#define SRC_INSPECTOR_WORKER_AGENT_H_

#include "node/inspector/protocol/NodeWorker.h"
#include "protocol/NodeWorker.h"
#include "v8.h"


Expand Down
2 changes: 1 addition & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "inspector/tracing_agent.h"
#include "inspector/worker_agent.h"
#include "inspector/worker_inspector.h"
#include "node/inspector/protocol/Protocol.h"
#include "protocol/Protocol.h"
#include "node_internals.h"
#include "node_url.h"
#include "v8-inspector.h"
Expand Down
3 changes: 2 additions & 1 deletion src/inspector_socket_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ std::string FormatWsAddress(const std::string& host, int port,
namespace {

static const uint8_t PROTOCOL_JSON[] = {
#include "v8_inspector_protocol_json.h" // NOLINT(build/include_order)
// NOLINT(build/include_order)
#include "concatenated_protocol/v8_inspector_protocol_json.h"
};

void Escape(std::string* string) {
Expand Down

0 comments on commit 2f4f8e7

Please sign in to comment.