summaryrefslogtreecommitdiffstats
path: root/build/copy_test_data_ios.gypi
blob: 56a222f9f84375b957ea6d170cf8e6c3ce3954a2 (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
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This file is meant to be included into an action to copy test data files into
# an iOS app bundle. To use this the following variables need to be defined:
#   test_data_files: list: paths to test data files or directories
#   test_data_prefix: string: a directory prefix that will be prepended to each
#                             output path.  Generally, this should be the base
#                             directory of the gypi file containing the unittest
#                             target (e.g. "base" or "chrome").
#
# To use this, create a gyp target with the following form:
# {
#   'target_name': 'my_unittests',
#   'conditions': [
#     ['OS == "ios"', {
#       'actions': [
#         {
#           'action_name': 'copy_test_data',
#           'variables': {
#             'test_data_files': [
#               'path/to/datafile.txt',
#               'path/to/data/directory/',
#             ]
#             'test_data_prefix' : 'prefix',
#           },
#           'includes': ['path/to/this/gypi/file'],
#         },
#       ],
#     }],
# }
#

{
  'inputs': [
    '<!@pymod_do_main(copy_test_data_ios --inputs <(test_data_files))',
  ],
  'outputs': [
    '<!@pymod_do_main(copy_test_data_ios -o <(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix) --outputs <(test_data_files))',
  ],
  'action': [
    'python',
    '<(DEPTH)/build/copy_test_data_ios.py',
    '-o', '<(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix)',
    '<@(_inputs)',
  ],
}