summaryrefslogtreecommitdiff
path: root/deps/gyp/test/rules/src/external/external.gyp
blob: b28174f57c3c9155c67ea5888f7229798ac4c00a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Test that the case where there are no inputs (other than the
# file the rule applies to).
{
  'target_defaults': {
    'msvs_cygwin_dirs': ['../../../../../../<(DEPTH)/third_party/cygwin'],
  },
  'targets': [
    {
      'target_name': 'external_rules',
      'type': 'none',
      'sources': [
        'file1.in',
        'file2.in',
      ],
      'conditions': [
        ['OS=="win"', {
          'dependencies': [
            'cygwin',
          ],
        }],
      ],
      'rules': [
        {
          'rule_name': 'copy_file',
          'extension': 'in',
          'msvs_external_rule': 1,
          'outputs': [
            '<(RULE_INPUT_ROOT).external_rules.out',
          ],
          'action': [
            'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
          ],
        },
      ],
    },
  ],
  'conditions': [
    ['OS=="win"', {
      'targets': [
        {
          'target_name': 'cygwin',
          'type': 'none',
          'actions': [
            {
              'action_name': 'setup_mount',
              'msvs_cygwin_shell': 0,
              'inputs': [
                '../../../../../../<(DEPTH)/third_party/cygwin/setup_mount.bat',
              ],
              # Visual Studio requires an output file, or else the
              # custom build step won't run.
              'outputs': [
                '<(INTERMEDIATE_DIR)/_always_run_setup_mount.marker',
              ],
              'action': ['<@(_inputs)'],
            },
          ],
        },
      ],
    }],
  ],
}