summaryrefslogtreecommitdiffstats
path: root/chrome/chrome_android.gypi
blob: 66d44ef1a02bbbdac320efc688fbffd8c6564674 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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.
{
  'variables': {
    'chromium_code': 1,
  },
  'targets': [
    {
      # GN: //chrome:chrome_android_core
      'target_name': 'chrome_android_core',
      'type': 'static_library',
      'dependencies': [
        'chrome.gyp:browser',
        'chrome.gyp:browser_ui',
        'chrome.gyp:child',
        'chrome_features.gyp:chrome_common_features',
        'chrome.gyp:plugin',
        'chrome.gyp:renderer',
        'chrome.gyp:utility',
        '../components/components.gyp:safe_browsing_db_mobile',
        '../content/content.gyp:content',
        '../content/content.gyp:content_app_both',
      ],
      'include_dirs': [
        '..',
        '<(android_ndk_include)',
      ],
      'sources': [
        'app/android/chrome_android_initializer.cc',
        'app/android/chrome_android_initializer.h',
        'app/android/chrome_jni_onload.cc',
        'app/android/chrome_jni_onload.h',
        'app/android/chrome_main_delegate_android.cc',
        'app/android/chrome_main_delegate_android.h',
        'app/chrome_main_delegate.cc',
        'app/chrome_main_delegate.h',
      ],
      'link_settings': {
        'libraries': [
          '-landroid',
          '-ljnigraphics',
        ],
      },
    },
    {
      # GYP: //chrome/android:chrome_version_java
      'target_name': 'chrome_version_java',
      'type': 'none',
      'variables': {
        'template_input_path': 'android/java/ChromeVersionConstants.java.version',
        'version_path': 'VERSION',
        'version_py_path': '<(DEPTH)/build/util/version.py',
        'output_path': '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)/org/chromium/chrome/browser/ChromeVersionConstants.java',

        'conditions': [
          ['branding == "Chrome"', {
            'branding_path': 'app/theme/google_chrome/BRANDING',
          }, {
            'branding_path': 'app/theme/chromium/BRANDING',
          }],
        ],
      },
      'direct_dependent_settings': {
        'variables': {
          # Ensure that the output directory is used in the class path
          # when building targets that depend on this one.
          'generated_src_dirs': [
            '<(SHARED_INTERMEDIATE_DIR)/templates/<(_target_name)',
          ],
          # Ensure dependents are rebuilt when the generated Java file changes.
          'additional_input_paths': [
            '<(output_path)',
          ],
        },
      },
      'actions': [
        {
          'action_name': 'chrome_version_java_template',
          'inputs': [
            '<(template_input_path)',
            '<(version_path)',
            '<(branding_path)',
            '<(version_py_path)',
          ],
          'outputs': [
            '<(output_path)',
          ],
          'action': [
            'python',
            '<(version_py_path)',
            '-f', '<(version_path)',
            '-f', '<(branding_path)',
            '-e', 'CHANNEL=str.upper("<(android_channel)")',
            '<(template_input_path)',
            '<(output_path)',
          ],
        },
      ],
    },
  ],
}