summaryrefslogtreecommitdiffstats
path: root/android_webview/android_webview.gyp
blob: 3322ed72c3b3e308147cad54c2831bb8250956eb (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# 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': [
    {
      'target_name': 'libwebview',
      'type': 'shared_library',
      'dependencies': [
        '<(DEPTH)/chrome/chrome.gyp:browser',
        '<(DEPTH)/chrome/chrome.gyp:renderer',
        '<(DEPTH)/content/content.gyp:content',
        '<(DEPTH)/android_webview/native/webview_native.gyp:webview_native',
        '<(DEPTH)/chrome/browser/component/components.gyp:web_contents_delegate_android',
        '<(DEPTH)/chrome/browser/component/components.gyp:browser_component_jni_headers',
      ],
      'include_dirs': [
        '<(DEPTH)',
        '<(DEPTH)/skia/config',
      ],
      'sources': [
        'common/android_webview_message_generator.cc',
        'common/android_webview_message_generator.h',
        'common/render_view_messages.cc',
        'common/render_view_messages.h',
        'browser/renderer_host/aw_render_view_host_ext.cc',
        'browser/renderer_host/aw_render_view_host_ext.h',
        'browser/renderer_host/aw_resource_dispatcher_host_delegate.cc',
        'browser/renderer_host/aw_resource_dispatcher_host_delegate.h',
        'lib/aw_browser_dependency_factory_impl.cc',
        'lib/aw_browser_dependency_factory_impl.h',
        'lib/aw_content_browser_client.cc',
        'lib/aw_content_browser_client.h',
        'lib/main/aw_main_delegate.cc',
        'lib/main/aw_main_delegate.h',
        'lib/main/webview_entry_point.cc',
        'lib/main/webview_stubs.cc',
        'renderer/aw_render_view_ext.cc',
        'renderer/aw_render_view_ext.h',
      ],
    },
    {
      'target_name': 'android_webview',
      'type' : 'none',
      'dependencies': [
        'libwebview',
      ],
      'variables': {
        'install_binary_script': 'build/install_binary',
      },
      'actions': [
        {
          'action_name': 'libwebview_strip_and_install_in_android',
          'inputs': [
            '<(SHARED_LIB_DIR)/libwebview.so',
          ],
          'outputs': [
            '<(android_product_out)/obj/lib/libwebview.so',
            '<(android_product_out)/system/lib/libwebview.so',
            '<(android_product_out)/symbols/system/lib/libwebview.so',
          ],
          'action': [
            '<(install_binary_script)',
            '<@(_inputs)',
            '<@(_outputs)',
          ],
        },
      ],
    },
    {
      'target_name': 'android_webview_java',
      'type': 'none',
      'dependencies': [
        '<(DEPTH)/content/content.gyp:content_java',
        '<(DEPTH)/chrome/browser/component/components.gyp:web_contents_delegate_android_java',
      ],
      'variables': {
        'package_name': 'android_webview_java',
        'java_in_dir': '<(DEPTH)/android_webview/java',
      },
      'includes': [ '../build/java.gypi' ],
    },
    {
      'target_name': 'android_webview_javatests',
      'type': 'none',
      'dependencies': [
        'android_webview_java',
        '<(DEPTH)/base/base.gyp:base_java_test_support',
        '<(DEPTH)/content/content.gyp:content_java',
        '<(DEPTH)/content/content.gyp:content_javatests',
        '<(DEPTH)/chrome/browser/component/components.gyp:web_contents_delegate_android_java',
      ],
      'variables': {
        'package_name': 'android_webview_javatests',
        'java_in_dir': '<(DEPTH)/android_webview/javatests',
      },
      'includes': [ '../build/java.gypi' ],
    },

    {
      'target_name': 'android_webview_apk',
      'type': 'none',
      'actions': [
      {
        'action_name': 'copy_base_jar',
        'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_base.jar'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/java/libs/chromium_base.jar'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_net_jar',
        'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_net.jar'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/java/libs/chromium_net.jar'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_media_jar',
        'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_media.jar'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/java/libs/chromium_media.jar'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_content_jar',
        'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_content.jar'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/java/libs/chromium_content.jar'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_web_contents_delegate_android_java',
        'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_web_contents_delegate_android.jar'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/java/libs/chromium_web_contents_delegate_android.jar'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_android_webview_jar',
        'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_android_webview_java.jar'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/java/libs/chromium_android_webview_java.jar'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_android_webview_test_jar',
        'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_android_webview_javatests.jar'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/java/libs/chromium_android_webview_javatests.jar'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_chrome_pak',
        'inputs': ['<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/assets/chrome.pak'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_chrome_100_percent_pak',
        'inputs': ['<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/assets/chrome_100_percent.pak'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_resources_pak',
        'inputs': ['<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/assets/resources.pak'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_en_pak',
        'inputs': ['<(SHARED_INTERMEDIATE_DIR)/repack/en-US.pak'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/assets/en.pak'],
        'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
      },
      {
        'action_name': 'copy_and_strip_so',
        'inputs': ['<(SHARED_LIB_DIR)/libwebview.so'],
        'outputs': ['<(PRODUCT_DIR)/android_webview/libs/<(android_app_abi)/libwebview.so'],
        'action': [
            '<!(/bin/echo -n $STRIP)',
            '--strip-unneeded',  # All symbols not needed for relocation.
            '<@(_inputs)',
            '-o',
            '<@(_outputs)',
        ],
      },
      {
        'action_name': 'android_webview_apk',
        'inputs': [
          '<(DEPTH)/android_webview/java/android_webview_apk.xml',
          '<(DEPTH)/android_webview/java/AndroidManifest.xml',
          '<(PRODUCT_DIR)/android_webview/java/libs/chromium_android_webview_java.jar',
          '<(PRODUCT_DIR)/android_webview/java/libs/chromium_android_webview_javatests.jar',
          '<(PRODUCT_DIR)/android_webview/java/libs/chromium_base.jar',
          '<(PRODUCT_DIR)/android_webview/java/libs/chromium_net.jar',
          '<(PRODUCT_DIR)/android_webview/java/libs/chromium_media.jar',
          '<(PRODUCT_DIR)/android_webview/java/libs/chromium_content.jar',
          '<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak',
          '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak',
          '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak',
          '<(SHARED_INTERMEDIATE_DIR)/repack/en-US.pak',
          '<(PRODUCT_DIR)/android_webview/libs/<(android_app_abi)/libwebview.so',
        ],
        'outputs': [
          '<(PRODUCT_DIR)/android_webview/AndroidWebView-debug.apk',
        ],
        'action': [
          'ant',
          '-DPRODUCT_DIR=<(ant_build_out)',
          '-DAPP_ABI=<(android_app_abi)',
          '-DANDROID_SDK=<(android_sdk)',
          '-DANDROID_SDK_ROOT=<(android_sdk_root)',
          '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
          '-DANDROID_SDK_VERSION=<(android_sdk_version)',
          '-DANDROID_TOOLCHAIN=<(android_toolchain)',
          '-buildfile',
          '<(DEPTH)/android_webview/java/android_webview_apk.xml',
        ],
        'dependencies': [
          'libwebview',
          'android_webview_java',
          'android_webview_javatests',
          '<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
          '<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
        ],
      }
      ],
    },
    {
      'target_name': 'android_webview_test_apk',
      'type': 'none',
      'dependencies': [
        'android_webview_apk',
        '<(DEPTH)/content/content.gyp:content_javatests',
      ],
      'actions': [
        {
          'action_name': 'copy_base_jar',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_base.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_base.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'copy_base_javatests_jar',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_base_javatests.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_base_javatests.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'copy_net_jar',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_net.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_net.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'copy_media_jar',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_media.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_media.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'copy_content_jar',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_content.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_content.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'copy_web_contents_delegate_android_java',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_web_contents_delegate_android.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_web_contents_delegate_android.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'copy_content_javatests_jar',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_content_javatests.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_content_javatests.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'copy_android_webview_jar',
          'inputs': ['<(PRODUCT_DIR)/lib.java/chromium_android_webview_java.jar'],
          'outputs': ['<(PRODUCT_DIR)/android_webview_test/java/libs/chromium_android_webview_java.jar'],
          'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
        },
        {
          'action_name': 'android_webview_test_generate_apk',
          'inputs': [
            '<(DEPTH)/android_webview/javatests/android_webview_test_apk.xml',
            '<(DEPTH)/android_webview/javatests/AndroidManifest.xml',
            '<!@(find <(DEPTH)/android_webview/javatests/ -name "*.java")'
          ],
          'outputs': [
            '<(PRODUCT_DIR)/android_webview_test/ContentShellTest-debug.apk',
          ],
          'action': [
            'ant',
            '-DPRODUCT_DIR=<(ant_build_out)',
            '-DAPP_ABI=<(android_app_abi)',
            '-DANDROID_SDK=<(android_sdk)',
            '-DANDROID_SDK_ROOT=<(android_sdk_root)',
            '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
            '-DANDROID_SDK_VERSION=<(android_sdk_version)',
            '-DANDROID_TOOLCHAIN=<(android_toolchain)',
            '-buildfile',
            '<(DEPTH)/android_webview/javatests/android_webview_test_apk.xml',
          ]
        }
      ],
    },
  ],
}