Home | History | Annotate | Download | only in build
      1 #
      2 # libjingle
      3 # Copyright 2013 Google Inc.
      4 #
      5 # Redistribution and use in source and binary forms, with or without
      6 # modification, are permitted provided that the following conditions are met:
      7 #
      8 #  1. Redistributions of source code must retain the above copyright notice,
      9 #     this list of conditions and the following disclaimer.
     10 #  2. Redistributions in binary form must reproduce the above copyright notice,
     11 #     this list of conditions and the following disclaimer in the documentation
     12 #     and/or other materials provided with the distribution.
     13 #  3. The name of the author may not be used to endorse or promote products
     14 #     derived from this software without specific prior written permission.
     15 #
     16 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     17 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     18 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
     19 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     20 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     21 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     22 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     23 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     24 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     25 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26 
     27 # Copied from Chromium's src/build/isolate.gypi
     28 #
     29 # It was necessary to copy this file because the path to build/common.gypi is
     30 # different for the standalone and Chromium builds. Gyp doesn't permit
     31 # conditional inclusion or variable expansion in include paths.
     32 # http://code.google.com/p/gyp/wiki/InputFormatReference#Including_Other_Files
     33 #
     34 # Local modifications:
     35 # * Removed include of '../chrome/version.gypi'.
     36 # * Removed passing of version_full variable created in version.gypi:
     37 #   '--extra-variable', 'version_full=<(version_full)',
     38 
     39 # This file is meant to be included into a target to provide a rule
     40 # to "build" .isolate files into a .isolated file.
     41 #
     42 # To use this, create a gyp target with the following form:
     43 # 'conditions': [
     44 #   ['test_isolation_mode != "noop"', {
     45 #     'targets': [
     46 #       {
     47 #         'target_name': 'foo_test_run',
     48 #         'type': 'none',
     49 #         'dependencies': [
     50 #           'foo_test',
     51 #         ],
     52 #         'includes': [
     53 #           '../build/isolate.gypi',
     54 #           'foo_test.isolate',
     55 #         ],
     56 #         'sources': [
     57 #           'foo_test.isolate',
     58 #         ],
     59 #       },
     60 #     ],
     61 #   }],
     62 # ],
     63 #
     64 # Note: foo_test.isolate is included and a source file. It is an inherent
     65 # property of the .isolate format. This permits to define GYP variables but is
     66 # a stricter format than GYP so isolate.py can read it.
     67 #
     68 # The generated .isolated file will be:
     69 #   <(PRODUCT_DIR)/foo_test.isolated
     70 #
     71 # See http://dev.chromium.org/developers/testing/isolated-testing/for-swes
     72 # for more information.
     73 
     74 {
     75   'rules': [
     76     {
     77       'rule_name': 'isolate',
     78       'extension': 'isolate',
     79       'inputs': [
     80         # Files that are known to be involved in this step.
     81         '<(DEPTH)/tools/isolate_driver.py',
     82         '<(DEPTH)/tools/swarming_client/isolate.py',
     83         '<(DEPTH)/tools/swarming_client/run_isolated.py',
     84       ],
     85       'outputs': [],
     86       'action': [
     87         'python',
     88         '<(DEPTH)/tools/isolate_driver.py',
     89         '<(test_isolation_mode)',
     90         '--isolated', '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
     91         '--isolate', '<(RULE_INPUT_PATH)',
     92 
     93         # Variables should use the -V FOO=<(FOO) form so frequent values,
     94         # like '0' or '1', aren't stripped out by GYP. Run 'isolate.py help' for
     95         # more details.
     96 
     97         # Path variables are used to replace file paths when loading a .isolate
     98         # file
     99         '--path-variable', 'DEPTH', '<(DEPTH)',
    100         '--path-variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ',
    101 
    102         # Note: This list must match DefaultConfigVariables()
    103         # in build/android/pylib/utils/isolator.py
    104         '--config-variable', 'CONFIGURATION_NAME=<(CONFIGURATION_NAME)',
    105         '--config-variable', 'OS=<(OS)',
    106         '--config-variable', 'asan=<(asan)',
    107         '--config-variable', 'branding=<(branding)',
    108         '--config-variable', 'chromeos=<(chromeos)',
    109         '--config-variable', 'component=<(component)',
    110         '--config-variable', 'disable_nacl=<(disable_nacl)',
    111         '--config-variable', 'enable_pepper_cdms=<(enable_pepper_cdms)',
    112         '--config-variable', 'enable_plugins=<(enable_plugins)',
    113         '--config-variable', 'fastbuild=<(fastbuild)',
    114         '--config-variable', 'icu_use_data_file_flag=<(icu_use_data_file_flag)',
    115         # TODO(kbr): move this to chrome_tests.gypi:gles2_conform_tests_run
    116         # once support for user-defined config variables is added.
    117         '--config-variable',
    118           'internal_gles2_conform_tests=<(internal_gles2_conform_tests)',
    119         '--config-variable', 'kasko=<(kasko)',
    120         '--config-variable', 'lsan=<(lsan)',
    121         '--config-variable', 'msan=<(msan)',
    122         '--config-variable', 'target_arch=<(target_arch)',
    123         '--config-variable', 'tsan=<(tsan)',
    124         '--config-variable', 'use_custom_libcxx=<(use_custom_libcxx)',
    125         '--config-variable', 'use_instrumented_libraries=<(use_instrumented_libraries)',
    126         '--config-variable',
    127         'use_prebuilt_instrumented_libraries=<(use_prebuilt_instrumented_libraries)',
    128         '--config-variable', 'use_openssl=<(use_openssl)',
    129         '--config-variable', 'use_ozone=<(use_ozone)',
    130         '--config-variable', 'use_x11=<(use_x11)',
    131         '--config-variable', 'v8_use_external_startup_data=<(v8_use_external_startup_data)',
    132       ],
    133       'conditions': [
    134         # Note: When gyp merges lists, it appends them to the old value.
    135         ['OS=="mac"', {
    136           'action': [
    137             '--extra-variable', 'mac_product_name=<(mac_product_name)',
    138           ],
    139         }],
    140         ["test_isolation_mode == 'prepare'", {
    141           'outputs': [
    142             '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated.gen.json',
    143           ],
    144         }, {
    145           'outputs': [
    146             '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
    147           ],
    148         }],
    149         ['OS=="win"', {
    150           'action': [
    151             '--config-variable', 'msvs_version=<(MSVS_VERSION)',
    152           ],
    153         }, {
    154           'action': [
    155             '--config-variable', 'msvs_version=0',
    156           ],
    157         }],
    158       ],
    159     },
    160   ],
    161 }
    162