Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / bindings / scripts / global_objects.gypi
blobfa812ee0a8bb82f5493f7c65d8930d111d9d4ec2
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # This file is meant to be included into a target to provide an action
6 # to compute global objects in a component.
8 # To use this, create a gyp target with the following form:
9 # {
10 #   'target_name': 'component_global_objects',
11 #   'variables': {
12 #     'idl_files': '<(list_of_idl_files)',
13 #     'input_files': ['<(some_dir)/GlobalObjectBaseComponent.pickle'],
14 #     'output_file': '<(some_dir)/GlobalObjectsComponent.pickle',
15 #   },
16 #   'includes': ['path/to/this/gypi/file'],
17 # },
19 # Required variables:
20 #  idl_files - List of .idl files that will be searched in.
21 #    This should *only* contain main IDL files, excluding dependencies and
22 #    testing, which should not define global objects.
23 #  output_file - Pickle file of output.
25 # Optional variables:
26 #  input_files - List of input pickle files of global objects in base
27 #    components. In this case make sure to include a dependencies section
28 #    in the target to ensure this is generated.
30 # Spec: http://heycam.github.io/webidl/#Global
31 # Design document: http://www.chromium.org/developers/design-documents/idl-build
34   'type': 'none',
35   'actions': [{
36     'action_name': 'compute_<(_target_name)',
37     'message': 'Computing global objects for <(_target_name)',
38     'variables': {
39       'input_files%': [],
40       'idl_files_list': '<|(<(_target_name)_idl_files_list.tmp <@(idl_files))',
41     },
42     'includes': ['scripts.gypi'],
43     'inputs': [
44       '<(bindings_scripts_dir)/compute_global_objects.py',
45       '<(bindings_scripts_dir)/utilities.py',
46       '<(idl_files_list)',
47       '<@(idl_files)',
48     ],
49     'outputs': [
50       '<(output_file)',
51     ],
52     'action': [
53       'python',
54       '<(bindings_scripts_dir)/compute_global_objects.py',
55       '--idl-files-list',
56       '<(idl_files_list)',
57       '--write-file-only-if-changed',
58       '<(write_file_only_if_changed)',
59       '--',
60       '<@(input_files)',
61       '<(output_file)',
62      ],
63   }],