Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / third_party / mojo / mojom_bindings_generator.gypi
blob948ce059b2068b6b6a6f6541b5cff2ac29f62ace
1 # Copyright 2013 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.
6   'includes': [
7     'mojom_bindings_generator_variables.gypi',
8   ],
9   'actions': [
10     {
11       'variables': {
12         'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
13         'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_name).stamp',
14       },
15       'action_name': '<(_target_name)_mojom_bindings_stamp',
16       # The java output directory is deleted to ensure that the java library
17       # doesn't try to compile stale files.
18       'action': [
19         'python', '<(DEPTH)/build/rmdir_and_stamp.py',
20         '<(java_out_dir)',
21         '<(stamp_filename)',
22       ],
23       'inputs': [ '<@(_sources)' ],
24       'outputs': [ '<(stamp_filename)' ],
25     }
26   ],
27   'rules': [
28     {
29       'rule_name': '<(_target_name)_mojom_bindings_generator',
30       'extension': 'mojom',
31       'variables': {
32         'mojom_base_output_dir':
33             '<!(python <(DEPTH)/build/inverse_depth.py <(DEPTH))',
34         'java_out_dir': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
35         'mojom_import_args%': [
36          '-I<(DEPTH)',
37          '-I<(DEPTH)/third_party/mojo/src'
38         ],
39         'stamp_filename': '<(PRODUCT_DIR)/java_mojo/<(_target_name)/<(_target_name).stamp',
40       },
41       'inputs': [
42         '<@(mojom_bindings_generator_sources)',
43         '<(stamp_filename)',
44       ],
45       'outputs': [
46         '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).mojom.cc',
47         '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).mojom.h',
48         '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).mojom.js',
49         '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)_mojom.py',
50         '<(SHARED_INTERMEDIATE_DIR)/<(mojom_base_output_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).mojom-internal.h',
51       ],
52       'action': [
53         'python', '<@(mojom_bindings_generator)',
54         './<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).mojom',
55         '--use_bundled_pylibs',
56         '-d', '<(DEPTH)',
57         '<@(mojom_import_args)',
58         '-o', '<(SHARED_INTERMEDIATE_DIR)',
59         '--java_output_directory=<(java_out_dir)',
60         '--dart_mojo_root=//third_party/mojo/src',
61       ],
62       'message': 'Generating Mojo bindings from <(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).mojom',
63       'process_outputs_as_sources': 1,
64     }
65   ],
66   'include_dirs': [
67     '<(DEPTH)',
68     '<(DEPTH)/third_party/mojo/src',
69     '<(SHARED_INTERMEDIATE_DIR)',
70     '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src',
71   ],
72   'direct_dependent_settings': {
73     'include_dirs': [
74       '<(DEPTH)',
75       '<(DEPTH)/third_party/mojo/src',
76       '<(SHARED_INTERMEDIATE_DIR)',
77       '<(SHARED_INTERMEDIATE_DIR)/third_party/mojo/src',
78     ],
79     'variables': {
80       'generated_src_dirs': [
81         '<(PRODUCT_DIR)/java_mojo/<(_target_name)/src',
82       ],
83       'additional_input_paths': [
84         '<@(mojom_bindings_generator_sources)',
85         '<@(_sources)',
86       ],
87     },
88   },
89   'hard_dependency': 1,