• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4
5{
6  'variables': {
7    'trace_viewer_src_dir': '../../../third_party/trace-viewer',
8    'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing',
9  },
10  'targets': [
11    {
12      'target_name': 'generate_tracing_grd',
13      'type': 'none',
14      'dependencies': [
15        '<(trace_viewer_src_dir)/trace_viewer.gyp:generate_about_tracing',
16      ],
17      'actions': [
18        {
19          'action_name': 'generate_tracing_grd',
20          'script_name': 'generate_trace_viewer_grd.py',
21          'input_pages': [
22            '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/about_tracing.html',
23            '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/about_tracing.js'
24          ],
25          'inputs': [
26            '<@(_script_name)',
27            '<@(_input_pages)'
28          ],
29          'outputs': [
30            '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd'
31          ],
32          'action': [
33            'python', '<@(_script_name)', '<@(_input_pages)', '--output', '<@(_outputs)'
34          ]
35        }
36      ]
37    },
38
39    {
40      'target_name': 'tracing_resources',
41      'type': 'none',
42      'dependencies': [
43        '<(trace_viewer_src_dir)/trace_viewer.gyp:generate_about_tracing',
44        'generate_tracing_grd',
45      ],
46      'variables': {
47        'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing',
48      },
49      'actions': [
50        {
51          'action_name': 'tracing_resources',
52          # This can't use build/grit_action.gypi because the grd file
53          # is generated at build time, so the trick of using grit_info to get
54          # the real inputs/outputs at GYP time isn't possible.
55          'variables': {
56            'grit_cmd': ['python', '../../../tools/grit/grit.py'],
57            'grit_grd_file': '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd',
58            'grit_rc_header_format%': '',
59          },
60          'inputs': [
61            '<(grit_grd_file)',
62            '<!@pymod_do_main(grit_info --inputs)',
63          ],
64          'outputs': [
65            '<(grit_out_dir)/grit/tracing_resources.h',
66            '<(grit_out_dir)/tracing_resources.pak',
67          ],
68          'action': ['<@(grit_cmd)',
69                     '-i', '<(grit_grd_file)', 'build',
70                     '-f', '<(DEPTH)/tools/gritsettings/resource_ids',
71                     '-o', '<(grit_out_dir)',
72                     '-D', 'SHARED_INTERMEDIATE_DIR=<(SHARED_INTERMEDIATE_DIR)',
73                     '<@(grit_defines)',
74                     '<@(grit_rc_header_format)'],
75          'message': 'Generating resources from <(grit_grd_file)',
76        }
77      ],
78      'includes': [ '../../../build/grit_target.gypi' ]
79    }
80  ]
81}
82