Home | History | Annotate | Download | only in chrome
      1 # Copyright (c) 2012 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   'variables': {
      6     'chromium_code': 1,
      7     'package_name': 'chrome_shell_apk',
      8   },
      9   'includes': [
     10     'chrome_android_paks.gypi', # Included for the list of pak resources.
     11   ],
     12   'targets': [
     13     {
     14       'target_name': 'libchromeshell',
     15       'type': 'shared_library',
     16       'dependencies': [
     17         '../base/base.gyp:base',
     18         'chrome_android_core',
     19         'chrome.gyp:browser_ui',
     20         '../content/content.gyp:content_app_browser',
     21       ],
     22       'sources': [
     23         # This file must always be included in the shared_library step to ensure
     24         # JNI_OnLoad is exported.
     25         'app/android/chrome_jni_onload.cc',
     26         'android/shell/chrome_main_delegate_chrome_shell_android.cc',
     27         'android/shell/chrome_main_delegate_chrome_shell_android.h',
     28         "android/shell/chrome_shell_google_location_settings_helper.cc",
     29         "android/shell/chrome_shell_google_location_settings_helper.h",
     30       ],
     31       'include_dirs': [
     32         '../skia/config',
     33       ],
     34       'conditions': [
     35         [ 'order_profiling!=0', {
     36           'conditions': [
     37             [ 'OS=="android"', {
     38               'dependencies': [ '../tools/cygprofile/cygprofile.gyp:cygprofile', ],
     39             }],
     40           ],
     41         }],
     42         [ 'use_allocator!="none"', {
     43           'dependencies': [
     44             '../base/allocator/allocator.gyp:allocator', ],
     45         }],
     46         ['OS=="android"', {
     47           'ldflags': [
     48             # Some android targets still depend on --gc-sections to link.
     49             # TODO: remove --gc-sections for Debug builds (crbug.com/159847).
     50             '-Wl,--gc-sections',
     51           ],
     52         }],
     53       ],
     54     },
     55     {
     56       'target_name': 'chrome_shell_apk',
     57       'type': 'none',
     58       'dependencies': [
     59         'chrome_java',
     60         'chrome_shell_paks',
     61         'libchromeshell',
     62         '../media/media.gyp:media_java',
     63       ],
     64       'variables': {
     65         'apk_name': 'ChromeShell',
     66         'manifest_package_name': 'org.chromium.chrome.shell',
     67         'java_in_dir': 'android/shell/java',
     68         'resource_dir': 'android/shell/res',
     69         'asset_location': '<(PRODUCT_DIR)/../assets/<(package_name)',
     70         'native_lib_target': 'libchromeshell',
     71         'native_lib_version_name': '<(version_full)',
     72         'additional_input_paths': [
     73           '<@(chrome_android_pak_output_resources)',
     74         ],
     75         'conditions': [
     76           ['component != "shared_library" and target_arch != "arm64" and target_arch != "x64"', {
     77             # Only enable the chromium linker on regular builds, since the
     78             # component build crashes on Android 4.4. See b/11379966
     79             'use_chromium_linker': '1',
     80           }],
     81         ],
     82       },
     83       'includes': [ '../build/java_apk.gypi', ],
     84     },
     85     {
     86       # chrome_shell_apk creates a .jar as a side effect. Any java targets
     87       # that need that .jar in their classpath should depend on this target,
     88       # chrome_shell_apk_java. Dependents of chrome_shell_apk receive its
     89       # jar path in the variable 'apk_output_jar_path'.
     90       # This target should only be used by targets which instrument
     91       # chrome_shell_apk.
     92       'target_name': 'chrome_shell_apk_java',
     93       'type': 'none',
     94       'dependencies': [
     95         'chrome_shell_apk',
     96       ],
     97       'includes': [ '../build/apk_fake_jar.gypi' ],
     98     },
     99     {
    100       'target_name': 'chrome_android_core',
    101       'type': 'static_library',
    102       'dependencies': [
    103         'chrome.gyp:browser',
    104         'chrome.gyp:browser_ui',
    105         'chrome.gyp:plugin',
    106         'chrome.gyp:renderer',
    107         'chrome.gyp:utility',
    108         # TODO(kkimlabs): Move this to chrome.gyp:browser when the dependent
    109         #                 is upstreamed.
    110         '../components/components.gyp:enhanced_bookmarks',
    111         '../content/content.gyp:content',
    112         '../content/content.gyp:content_app_browser',
    113       ],
    114       'include_dirs': [
    115         '..',
    116         '<(android_ndk_include)',
    117       ],
    118       'sources': [
    119         'app/android/chrome_android_initializer.cc',
    120         'app/android/chrome_android_initializer.h',
    121         'app/android/chrome_main_delegate_android.cc',
    122         'app/android/chrome_main_delegate_android.h',
    123         'app/chrome_main_delegate.cc',
    124         'app/chrome_main_delegate.h',
    125       ],
    126       'link_settings': {
    127         'libraries': [
    128           '-landroid',
    129           '-ljnigraphics',
    130         ],
    131       },
    132     },
    133     {
    134       'target_name': 'chrome_shell_paks',
    135       'type': 'none',
    136       'dependencies': [
    137         '<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
    138         '<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
    139       ],
    140       'copies': [
    141         {
    142           'destination': '<(chrome_android_pak_output_folder)',
    143           'files': [
    144             '<@(chrome_android_pak_input_resources)',
    145           ],
    146         }
    147       ],
    148     },
    149   ],
    150 }
    151