Commit 9453bd46 authored by nbarth@chromium.org's avatar nbarth@chromium.org

Clean up generated_bindings.gyp

This does some cleanup to GYP;
only change to build is consolidating two identical gyp-time files into one.

* Move temporary list file variables to the top, with other variables
  (keeps all these lists together, removes duplicate variables, and removes
   duplicate comments)
* Add comment lines between actions (GYP files are hard to read,
  and we're going to add more actions for caching lexer/parser)
* Fix indentation so consistent
(.gyp file formatting isn't terribly consistent or linted,
but this makes reading and edits easier)

BUG=341748
R=haraken

Review URL: https://codereview.chromium.org/181063013

git-svn-id: svn://svn.chromium.org/blink/trunk@168341 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b123616a
......@@ -44,7 +44,7 @@
],
'variables': {
# For details, see: http://www.chromium.org/developers/web-idl-interfaces
# IDL file lists; see: http://www.chromium.org/developers/web-idl-interfaces
#
# Interface IDL files / Dependency IDL files
# Interface IDL files: generate individual bindings (includes testing)
......@@ -64,16 +64,21 @@
'<@(core_idl_files)',
'<@(modules_idl_files)',
],
# Write list of main IDL files to a file, so that the command line doesn't
# exceed OS length limits.
'main_interface_idl_files_list': '<|(main_interface_idl_files_list.tmp <@(main_interface_idl_files))',
# Static IDL files / Generated IDL files
# Paths need to be passed separately for static and generated files, as
# static files are listed in a temporary file (b/c too long for command
# line), but generated files must be passed at the command line, as they are
# not present at GYP time, when the temporary file is generated
# line), but generated files must be passed at the command line, as their
# paths are not fixed at GYP time, when the temporary file is generated,
# because their paths depend on the build directory, which varies.
'static_idl_files': [
'<@(static_interface_idl_files)',
'<@(static_dependency_idl_files)',
],
'static_idl_files_list': '<|(static_idl_files_list.tmp <@(static_idl_files))',
'generated_idl_files': [
'<@(generated_interface_idl_files)',
'<@(generated_dependency_idl_files)',
......@@ -107,6 +112,7 @@
'<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl',
],
# Python source
'jinja_module_files': [
# jinja2/__init__.py contains version string, so sufficient for package
......@@ -152,6 +158,7 @@
'templates/methods.cpp',
],
'bindings_output_dir': '<(SHARED_INTERMEDIATE_DIR)/blink/bindings',
'conditions': [
......@@ -169,21 +176,18 @@
],
},
'targets': [{
'targets': [
################################################################################
{
'target_name': 'global_constructors_idls',
'type': 'none',
'actions': [{
'action_name': 'generate_global_constructors_idls',
'variables': {
# Write list of IDL files to a file, so that the command line doesn't
# exceed OS length limits.
# Only includes main IDL files (exclude dependencies and testing,
# which should not appear on global objects).
'main_interface_idl_files_list': '<|(main_interface_idl_files_list.tmp <@(main_interface_idl_files))',
},
'inputs': [
'scripts/generate_global_constructors.py',
'scripts/utilities.py',
# Only includes main IDL files (exclude dependencies and testing,
# which should not appear on global objects).
'<(main_interface_idl_files_list)',
'<@(main_interface_idl_files)',
],
......@@ -211,26 +215,21 @@
'message': 'Generating IDL files for constructors on global objects',
}]
},
################################################################################
{
'target_name': 'interfaces_info',
'type': 'none',
'dependencies': [
# Generated IDLs
'global_constructors_idls',
'../core/core_generated.gyp:generated_testing_idls',
],
'actions': [{
'action_name': 'compute_interfaces_info',
'variables': {
# Write list of static IDL files to a file, so that the command line
# doesn't exceed OS length limits.
# Generated IDL files cannot be included, as their path depends on the
# build directory, and must instead be passed as command line arguments.
'idl_files_list': '<|(idl_files_list.tmp <@(static_idl_files))',
},
'inputs': [
'scripts/compute_interfaces_info.py',
'scripts/utilities.py',
'<(idl_files_list)',
'<(static_idl_files_list)',
'<@(static_idl_files)',
'<@(generated_idl_files)',
],
......@@ -242,18 +241,20 @@
'python',
'scripts/compute_interfaces_info.py',
'--idl-files-list',
'<(idl_files_list)',
'<(static_idl_files_list)',
'--interfaces-info-file',
'<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle',
'--event-names-file',
'<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in',
'<@(write_file_only_if_changed)',
'--',
# Generated files must be passed at command line
'<@(generated_idl_files)',
],
'message': 'Computing global information about IDL files, and generating list of Event interfaces',
}]
},
################################################################################
{
# A separate pre-caching step is *required* to use bytecode caching in
# Jinja (which improves speed significantly), as the bytecode cache is
......@@ -279,6 +280,7 @@
'message': 'Caching bytecode of Jinja templates',
}],
},
################################################################################
{
'target_name': 'individual_generated_bindings',
'type': 'none',
......@@ -336,18 +338,16 @@
'message': 'Generating binding from <(RULE_INPUT_PATH)',
}],
},
################################################################################
{
'target_name': 'aggregate_generated_bindings',
'type': 'none',
'actions': [{
'action_name': 'generate_aggregate_generated_bindings',
'variables': {
# Write list of IDL files to a file, so that the command line doesn't
# exceed OS length limits.
'main_interface_idl_files_list': '<|(main_interface_idl_files_list.tmp <@(main_interface_idl_files))',
},
'inputs': [
'scripts/aggregate_generated_bindings.py',
# Only includes main IDL files (exclude dependencies and testing,
# for which bindings are not included in aggregate bindings).
'<(main_interface_idl_files_list)',
],
'outputs': [
......@@ -363,6 +363,7 @@
'message': 'Generating aggregate generated bindings files',
}],
},
################################################################################
{
'target_name': 'generated_bindings',
'type': 'none',
......@@ -371,5 +372,6 @@
'individual_generated_bindings',
],
},
],
################################################################################
], # targets
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment